Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unique id not assigned #41

Open
mmaccaroni opened this issue May 29, 2023 · 22 comments
Open

unique id not assigned #41

mmaccaroni opened this issue May 29, 2023 · 22 comments

Comments

@mmaccaroni
Copy link

Hi!
I noticed that in the HA front end is not possible to set the climate entities (e.g. by assigning a room or exposing them to voice assistant), because the climate ip entitis do not have a unique ID set.
I even tried to assign one via yaml in tne configuration as customization of the etntitis, but the result is the same.
What can be done to overcome this?

@wifi75
Copy link

wifi75 commented Jun 15, 2023

I was about to write the same thing.
How can it be done?

@misa1515
Copy link

same issue for other integrations, will help change identifier from IP to MAC, but I not have such knowledge...

@stefan-dumitrescu
Copy link

https://github.com/lucadjc/samsungrac
The folder from this guy (i owe him many beers) is the solution:
In visual studio (in HA) rename the original folder climate_ip from custom components, create a new folder named "climate_ip" and upload the files from the folder in the repo above. Reboot the system and everything works, including the device_id
Kudos @lucadjc

@lainol
Copy link

lainol commented Aug 29, 2023

https://github.com/lucadjc/samsungrac The folder from this guy (i owe him many beers) is the solution: In visual studio (in HA) rename the original folder climate_ip from custom components, create a new folder named "climate_ip" and upload the files from the folder in the repo above. Reboot the system and everything works, including the device_id Kudos @lucadjc

Changed climate_ip folder for the lucadjc's one... still unique_id error.
2 x samsung_2878 ACs

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

https://github.com/lucadjc/samsungrac The folder from this guy (i owe him many beers) is the solution: In visual studio (in HA) rename the original folder climate_ip from custom components, create a new folder named "climate_ip" and upload the files from the folder in the repo above. Reboot the system and everything works, including the device_id Kudos @lucadjc

Changed climate_ip folder for the lucadjc's one... still unique_id error. 2 x samsung_2878 ACs

did you restart HA?

@lainol
Copy link

lainol commented Aug 29, 2023

Yeah, even system restart

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

can you check if the file climate.py under homeassistant\custom_components\climate_ip path has the following statement?

@property
def unique_id(self):
    #if self._unique_id is None and self.rac.unique_id is not None:
    #    _LOGGER.info("About to set unique id {}".format(self.rac.unique_id))
    #    self._unique_id = "climate_ip_" + self.rac.unique_id

    if self._unique_id is None:
        name_value = self._name
        _LOGGER.info("About to set unique id {}".format(name_value))
        self._unique_id = "climate_ip_" + name_value

    _LOGGER.info("Returning unique id of {}".format(self._unique_id))
    return self._unique_id

@lainol
Copy link

lainol commented Aug 29, 2023

Line 252 and ahead of climate.py, correct
Thanks for the support :D

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

turn on the logs into configuration.yaml and see into HA logs and please post here the results

@lainol
Copy link

lainol commented Aug 29, 2023

 - platform: climate_ip
    config_file: '/config/custom_components/climate_ip/samsung_2878.yaml'
    name: 'Ac Despacho'
    ip_address: '192.168....'
    token: 'xxxx-xxxx-xxxx-xxxx-xxxx'
    cert: 'ac14k_m.pem' #set as '' to skip certificate verification
    mac: 'xxxxxxxxxxxx'
    poll: True

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

 - platform: climate_ip
    config_file: '/config/custom_components/climate_ip/samsung_2878.yaml'
    name: 'Ac Despacho'
    ip_address: '192.168....'
    token: xxxx-xxxx-xxxx-xxxx-xxxx'
    cert: 'ac14k_m.pem' #set as '' to skip certificate verification
    mac: 'xxxxxxxxxxxx'
    poll: True

try to evaluate the property
device_id: same as token

@lainol
Copy link

lainol commented Aug 29, 2023

same result with device_id: 'token'

Nothing unusual in the logs.

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

change here as following

  • platform: climate_ip
    config_file: '/config/custom_components/climate_ip/samsung_2878.yaml'
    name: 'Ac Despacho'
    ip_address: '192.168....'
    token: xxxx-xxxx-xxxx-xxxx-xxxx'
    cert: 'ac14k_m.pem' #set as '' to skip certificate verification
    mac: 'xxxxxxxxxxxx'
    poll: True
    device_id: same as token
    debug: True

and post the log results

@lainol
Copy link

lainol commented Aug 29, 2023

edited... i'm dumb

@lucadjc
Copy link

lucadjc commented Aug 29, 2023

Have you copied here all the logs? Is the conditioner working?
My version in which folder name have you copied it? This is the log of the folder
climate_ipbackup

@lainol
Copy link

lainol commented Aug 30, 2023

Sorry for the failed log, here is the good one.
Both ACs are working but can't change icon or area due the uinque_id thing.

2023-08-30 16:40:40.257 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2023-08-30 16:40:40.259 INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /config/custom_components/climate_ip/samsung_2878.yaml
2023-08-30 16:40:40.259 INFO (MainThread) [custom_components.climate_ip.climate] ip_address: 192.168.1.141
2023-08-30 16:40:40.259 INFO (MainThread) [custom_components.climate_ip.climate] token: TOKEN_DESPACHO
2023-08-30 16:40:40.259 INFO (MainThread) [custom_components.climate_ip.climate] device id: TOKEN_DESPACHO
2023-08-30 16:40:40.314 INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
2023-08-30 16:40:40.324 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, host: 192.168.1.141:2878
2023-08-30 16:40:40.324 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, token: TOKEN_DESPACHO
2023-08-30 16:40:40.324 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, duid: MAC_DESPACHO
2023-08-30 16:40:40.324 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, cert: /config/custom_components/climate_ip/ac14k_m.pem
2023-08-30 16:40:40.423 INFO (MainThread) [custom_components.climate_ip.climate] Updating state...
2023-08-30 16:40:40.423 INFO (MainThread) [custom_components.climate_ip.climate] Updating getter...
2023-08-30 16:40:40.423 INFO (MainThread) [custom_components.climate_ip.climate] Executing params: {'duid': 'MAC_DESPACHO', 'token': 'TOKEN_DESPACHO', 'host': '192.168.1.141', 'connection_template': '', 'power_template': '{% if value != none %}{% for key, value in device_state.items() %}{% if key == "AC_FUN_POWER" %}{% if value == "Off" %}{% endif %}{% endif %}{% endfor %}{% endif %}', 'value': None, 'device_state': 'unknown'}
2023-08-30 16:40:40.423 INFO (MainThread) [custom_components.climate_ip.climate] Checking power on template:
2023-08-30 16:40:40.423 INFO (MainThread) [custom_components.climate_ip.climate] Power on template found, rendering
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] Power on message:
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] Executing command:
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] OpenSSL 3.1.1 30 May 2023
2023-08-30 16:40:40.424 INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
2023-08-30 16:40:40.426 INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
2023-08-30 16:40:40.426 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
2023-08-30 16:40:40.426 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /config/custom_components/climate_ip/ac14k_m.pem
2023-08-30 16:40:40.430 INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /config/custom_components/climate_ip/ac14k_m.pem
2023-08-30 16:40:40.434 INFO (MainThread) [custom_components.climate_ip.climate] Wrapping socket
2023-08-30 16:40:40.435 INFO (MainThread) [custom_components.climate_ip.climate] Socket wrapped: True
2023-08-30 16:40:40.435 INFO (MainThread) [custom_components.climate_ip.climate] Connecting with 192.168.1.141:2878
2023-08-30 16:40:40.800 INFO (MainThread) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:40.801 INFO (MainThread) [custom_components.climate_ip.climate] Response: DPLUG-1.6
2023-08-30 16:40:40.803 INFO (MainThread) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:40.803 INFO (MainThread) [custom_components.climate_ip.climate] Response:
2023-08-30 16:40:40.804 INFO (MainThread) [custom_components.climate_ip.climate] Sending auth command:
2023-08-30 16:40:40.806 INFO (MainThread) [custom_components.climate_ip.climate] Auth command sent
2023-08-30 16:40:41.808 INFO (MainThread) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:41.808 INFO (MainThread) [custom_components.climate_ip.climate] Timed out, no data to read
2023-08-30 16:40:41.808 INFO (MainThread) [custom_components.climate_ip.climate] Sending command
2023-08-30 16:40:41.809 INFO (MainThread) [custom_components.climate_ip.climate] Handling socket response
2023-08-30 16:40:42.811 INFO (MainThread) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:42.811 INFO (MainThread) [custom_components.climate_ip.climate] Timed out, no data to read
2023-08-30 16:40:42.811 INFO (MainThread) [custom_components.climate_ip.climate] Handling finished
2023-08-30 16:40:42.812 INFO (MainThread) [custom_components.climate_ip.climate] Getter updated with value: {}
2023-08-30 16:40:42.812 INFO (MainThread) [custom_components.climate_ip.climate] Error: update_state
2023-08-30 16:40:42.812 INFO (MainThread) [custom_components.climate_ip.climate] Updating operations...
2023-08-30 16:40:42.814 INFO (MainThread) [custom_components.climate_ip.climate] Updating properties...
2023-08-30 16:40:42.815 INFO (MainThread) [custom_components.climate_ip.climate] current_temperature
2023-08-30 16:40:42.815 INFO (MainThread) [custom_components.climate_ip.climate] min_temp
2023-08-30 16:40:42.816 INFO (MainThread) [custom_components.climate_ip.climate] max_temp
2023-08-30 16:40:42.816 INFO (MainThread) [custom_components.climate_ip.climate] used_power
2023-08-30 16:40:42.817 INFO (MainThread) [custom_components.climate_ip.climate] self._name: Ac Despacho
2023-08-30 16:40:42.819 INFO (MainThread) [custom_components.climate_ip.climate] self._unique_id: Ac Despacho
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: temperature
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: target_temp_high
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: target_temp_low
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: fan_mode
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: swing_mode
2023-08-30 16:40:42.820 INFO (MainThread) [custom_components.climate_ip.climate] Feature: preset_mode
2023-08-30 16:40:44.337 INFO (SyncWorker_4) [custom_components.climate_ip.climate] update
2023-08-30 16:40:44.337 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Updating state...
2023-08-30 16:40:44.337 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Updating getter...
2023-08-30 16:40:44.337 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Executing params: {'duid': 'MAC_SALON', 'token': 'TOKEN_SALON', 'host': '192.168.1.140', 'connection_template': '', 'power_template': '{% if value != none %}{% for key, value in device_state.items() %}{% if key == "AC_FUN_POWER" %}{% if value == "Off" %}{% endif %}{% endif %}{% endfor %}{% endif %}', 'value': None, 'device_state': {}}
2023-08-30 16:40:44.337 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Checking power on template:
2023-08-30 16:40:44.338 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Power on template found, rendering
2023-08-30 16:40:44.338 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Power on message:
2023-08-30 16:40:44.338 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Executing command:
2023-08-30 16:40:44.338 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Getting socket connection
2023-08-30 16:40:44.338 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Sending command
2023-08-30 16:40:44.339 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Handling socket response
2023-08-30 16:40:44.339 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:44.341 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Response:
2023-08-30 16:40:44.341 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Connection authenticated
2023-08-30 16:40:44.341 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Requesting status with command:
2023-08-30 16:40:44.342 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Status request sent
2023-08-30 16:40:44.342 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:44.343 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Response:
2023-08-30 16:40:45.345 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Reading data from socket...
2023-08-30 16:40:45.345 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Timed out, no data to read
2023-08-30 16:40:45.345 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Handling finished
2023-08-30 16:40:45.345 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Getter updated with value: {'AC_FUN_ENABLE': 'Enable', 'AC_FUN_POWER': 'Off', 'AC_FUN_OPMODE': 'Wind', 'AC_FUN_TEMPSET': '24', 'AC_FUN_COMODE': 'Off', 'AC_FUN_ERROR': 'NULL', 'AC_FUN_TEMPNOW': '27', 'AC_FUN_SLEEP': '0', 'AC_FUN_WINDLEVEL': 'Turbo', 'AC_FUN_DIRECTION': 'Fixed', 'AC_ADD_AUTOCLEAN': 'Off', 'AC_ADD_SETKWH': '255', 'AC_ADD_CLEAR_FILTER_ALARM': '240', 'AC_ADD_APMODE_END': '0', 'AC_ADD_STARTWPS': 'Default', 'AC_ADD_SPI': 'Off', 'AC_OUTDOOR_TEMP': '89', 'AC_COOL_CAPABILITY': '25', 'AC_WARM_CAPABILITY': '33', 'AC_SG_WIFI': 'Connected', 'AC_SG_INTERNET': 'Connected', 'AC_ADD2_USEDWATT': '65024', 'AC_ADD2_VERSION': '65024', 'AC_SG_MACHIGH': '34', 'AC_SG_MACMID': '47', 'AC_SG_MACLOW': '105', 'AC_SG_VENDER01': '248', 'AC_SG_VENDER02': '4', 'AC_SG_VENDER03': '46', 'AC_ADD2_PANEL_VERSION': '150203', 'AC_ADD2_OUT_VERSION': '1315110', 'AC_FUN_MODEL': '5', 'AC_ADD2_OPTIONCODE': '32936', 'AC_ADD2_USEDPOWER': '0', 'AC_ADD2_USEDTIME': '40570', 'AC_ADD2_CLEAR_POWERTIME': '254', 'AC_ADD2_FILTERTIME': '500', 'AC_ADD2_FILTER_USE_TIME': '10000'}
2023-08-30 16:40:45.346 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Updating operations...
2023-08-30 16:40:45.347 INFO (SyncWorker_4) [custom_components.climate_ip.climate] Updating properties...
2023-08-30 16:40:45.347 INFO (SyncWorker_4) [custom_components.climate_ip.climate] current_temperature
2023-08-30 16:40:45.347 INFO (SyncWorker_4) [custom_components.climate_ip.climate] min_temp
2023-08-30 16:40:45.347 INFO (SyncWorker_4) [custom_components.climate_ip.climate] max_temp
2023-08-30 16:40:45.347 INFO (SyncWorker_4) [custom_components.climate_ip.climate] used_power
2023-08-30 16:40:45.530 INFO (MainThread) [custom_components.climate_ip.climate] Returning unique id of Ac Salon
2023-08-30 16:40:45.530 INFO (MainThread) [custom_components.climate_ip.climate] Returning unique id of Ac Salon
2023-08-30 16:40:45.530 INFO (MainThread) [custom_components.climate_ip.climate] Returning unique id of Ac Salon
2023-08-30 16:40:45.531 INFO (MainThread) [custom_components.climate_ip.climate] Controller::state_attributes
2023-08-30 16:40:45.531 INFO (MainThread) [custom_components.climate_ip.climate] state_attributes: {'name': 'samsungrac', 'device_state': '{"AC_FUN_ENABLE": "Enable", "AC_FUN_POWER": "Off", "AC_FUN_OPMODE": "Wind", "AC_FUN_TEMPSET": "24", "AC_FUN_COMODE": "Off", "AC_FUN_ERROR": "NULL", "AC_FUN_TEMPNOW": "27", "AC_FUN_SLEEP": "0", "AC_FUN_WINDLEVEL": "Turbo", "AC_FUN_DIRECTION": "Fixed", "AC_ADD_AUTOCLEAN": "Off", "AC_ADD_SETKWH": "255", "AC_ADD_CLEAR_FILTER_ALARM": "240", "AC_ADD_APMODE_END": "0", "AC_ADD_STARTWPS": "Default", "AC_ADD_SPI": "Off", "AC_OUTDOOR_TEMP": "89", "AC_COOL_CAPABILITY": "25", "AC_WARM_CAPABILITY": "33", "AC_SG_WIFI": "Connected", "AC_SG_INTERNET": "Connected", "AC_ADD2_USEDWATT": "65024", "AC_ADD2_VERSION": "65024", "AC_SG_MACHIGH": "34", "AC_SG_MACMID": "47", "AC_SG_MACLOW": "105", "AC_SG_VENDER01": "248", "AC_SG_VENDER02": "4", "AC_SG_VENDER03": "46", "AC_ADD2_PANEL_VERSION": "150203", "AC_ADD2_OUT_VERSION": "1315110", "AC_FUN_MODEL": "5", "AC_ADD2_OPTIONCODE": "32936", "AC_ADD2_USEDPOWER": "0", "AC_ADD2_USEDTIME": "40570", "AC_ADD2_CLEAR_POWERTIME": "254", "AC_ADD2_FILTERTIME": "500", "AC_ADD2_FILTER_USE_TIME": "10000"}', 'last_sync': '2023-08-30 16:40:45', 'AC_FUN_ENABLE': 'Enable', 'AC_FUN_COMODE': 'Enable', 'AC_FUN_ERROR': 'NULL', 'AC_SG_WIFI': 'Connected', 'AC_SG_INTERNET': 'Connected', 'AC_ADD2_USEDWATT': '65024', 'AC_ADD2_VERSION': '65024', 'AC_ADD2_PANEL_VERSION': '150203', 'AC_ADD2_OUT_VERSION': '1315110', 'AC_ADD2_OPTIONCODE': '32936', 'AC_ADD2_USEDTIME': '40570', 'AC_ADD2_FILTER_USE_TIME': '10000', 'hvac_mode': 'off', 'hvac_modes': ['cool', 'heat', 'dry', 'fan_only', 'heat_cool', 'off'], 'preset_mode': 'none', 'preset_modes': ['none', 'Quiet', 'Good Sleep', 'Single User', 'Comfort', 'Fast Turbo'], 'power': 'off', 'purify': 'off', 'auto_clean': 'off', 'special_mode': 'off', 'special_modes': ['off', 'quiet', 'sleep', 'smart', 'softcontrol', 'wind1', 'wind2', 'wind3'], 'fan_mode': 'Turbo', 'fan_modes': ['auto', 'Low', 'Medium', 'High'], 'swing_mode': 'Off', 'swing_modes': ['Horizontal', 'Vertical', 'Off', 'Both'], 'temperature': 24.0, 'current_temperature': 27.0, 'min_temp': 8.0, 'max_temp': 32.0, 'used_power': 0.0}

@lucadjc
Copy link

lucadjc commented Aug 30, 2023

can you text both the configuration of configuration.yaml file?
is the log complete? i'm asking because i see messages related to .141 device only

@lainol
Copy link

lainol commented Aug 30, 2023

Yeah, I was trying only in one of my 2 ACs.
Don't know why the other .140 show up on the log

climate:
  - platform: climate_ip
    config_file: 'samsung_2878.yaml'
    name: 'Ac Salon'
    ip_address: '192.168.1.140'
    token: 'token_salon'
    cert: 'ac14k_m.pem' #set as '' to skip certificate verification
    mac: 'mac_salon'
    poll: True    
  - platform: climate_ip
    config_file: '/config/custom_components/climate_ip/samsung_2878.yaml'
    name: 'Ac Despacho'
    ip_address: '192.168.1.141'
    token: 'token_despacho'
    cert: 'ac14k_m.pem' #set as '' to skip certificate verification
    mac: 'mac_despacho'
    poll: True
    device_id: 'token_despacho'
    debug: True

@lucadjc
Copy link

lucadjc commented Aug 30, 2023

I'm a bit confused, into this configuration.yaml you've .140 with name "AC Salon", .141 with "Ac Despacho"
in the log you've .141 with name AC Salon

@lainol
Copy link

lainol commented Aug 30, 2023

@lucadjc!! WTF?!?! Now both ACs have unique_id working after last reboot for fresh logs, haven't changed anything in the config and lots of reboots and system reboots.

Thank you so much for your support and for the custom component!

@lucadjc
Copy link

lucadjc commented Aug 30, 2023

Welcome, I'm supposing that HA was linking still the old version

@Blodskjegg
Copy link

I had the same error, but had to edit this:
self.unique_id = "climate_ip" + name_value
to
self.unique_id = "climate_ip" + str(name_value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants