ollo69 / ha-smartthinq-sensors

HomeAssistant custom integration for SmartThinQ LG devices configurable with Lovelace User Interface.
Apache License 2.0
1.15k stars 159 forks source link

[BUG] All LG Devices unavailable after update #174

Closed jordibsk10 closed 3 years ago

jordibsk10 commented 3 years ago

Describe the bug After updating the integration to the last version (v.0.8.10) all my LG devices have gone unavailable.

Expected behavior No major changes apart from the new services added.

Screenshots image

Environment details:

Output of HA logs Logger: custom_components.smartthinq_sensors Source: custom_components/smartthinq_sensors/wideq/device.py:636 Integration: SmartThinQ LGE Sensors (documentation, issues) First occurred: 11:11:32 (4 occurrences) Last logged: 11:12:53

Connection not available. ThinQ platform not ready Traceback (most recent call last): File "/config/custom_components/smartthinq_sensors/init.py", line 201, in async_setup_entry lge_devices = await lge_devices_setup(hass, client) File "/config/custom_components/smartthinq_sensors/init.py", line 576, in lge_devices_setup if not await dev.init_device(): File "/config/custom_components/smartthinq_sensors/init.py", line 349, in init_device features = self._state.device_features File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 1289, in device_features self._update_features() File "/config/custom_components/smartthinq_sensors/wideq/washerDryer.py", line 585, in _update_features self.standby_state, File "/config/custom_components/smartthinq_sensors/wideq/washerDryer.py", line 477, in standby_state status = self.lookup_enum(["Standby", "standby"]) File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 1222, in lookup_enum return self._device.model_info.enum_name( File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 665, in enum_name options = self.value(data) File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 636, in value assert False, "unsupported value type {}".format(data_type) AssertionError: unsupported value type Boolean

jordibsk10 commented 3 years ago

I've just tried going back to v0.8.8 and it went back to working perfectly as always. But when updating to v0.8.10, all LG devices go to unavailable and I get the above error message. (For now, I 'm staying in v0.8.8 as is the last one it works for me. I will try with v0.8.9 afterwards just to see if it's coming from version 9 or 10.)

Don't know what I can provide to give you more details and be able to investigate this issue :(

Nevertheless, really appreciate for your time and your great work!

ollo69 commented 3 years ago

The issue seems to caused by Standby washer / dryer sensors that I added in last release Could you provide the JSON info of your washer so that I can try to understand the format of this data that is causing the issue?

jordibsk10 commented 3 years ago

Sure, but unfortunately I'm don't know where to find it... would you mind pointing me out how can I get that specific JSON? Apologies

ollo69 commented 3 years ago

In HA log, during startup, you could find information line that contain a https address to download the JSON info file. Copying that address in the browser address bar should start the download of the file. After you download it attach it to this thread,

jordibsk10 commented 3 years ago

I've only been able to find this https address (https://version.home-assistant.io/stable.json). But I don't think that's the one you are looking for, right? image

I'm looking for the address here: image Is it correct? Should appear somewhere here, right?

If I'm completely wrong, maybe if you can share the https address you get/refering to, I can try to use it in my system... and see if it works?¿

ollo69 commented 3 years ago

No is wrong. You should look in the HA Log and not supervisor log. Search for Loading model info for ... "Url: https://...

jordibsk10 commented 3 years ago

I don't see any Loading model info for ... "Url: https://... image Should be somewhere here, right? Sorry for the inconveniences. Apologies :(

ollo69 commented 3 years ago

Do not apologies, you are trying to help and this is enough. I think that is the right file, but the information should be before. This info is provided during HA startup, may be you can reboot HA and check again? It could be that your log level is set to warning? In this case you should change setting putting this line in configuration.yaml:

logger:
  default: info
aslabicki commented 3 years ago

I have the same issue with my washer and dryer after the update to 0.8.10 version.

JSON from my Dryer: Dryer_RC90U2_WW.log

ollo69 commented 3 years ago

Could you check if with last release issue is fixed and Standby sensors/attributes is properly detected (standby means that machine is in remote start mode and go in standby)?

aslabicki commented 3 years ago

On the newest version (0.8.11) state of dryer and washer looks good.

I turned on the washer and enabled remote start and state was like this:

model: F_R8_Y___W.A__QEUK-FL
mac_address: xx:xx:xx:xx:xx:xx
run_completed: 'off'
error_state: 'off'
initial_time: '3:34'
remain_time: '3:34'
reserve_time: '0:00'
current_course: Bawełna
run_state: Gotowość
pre_state: Gotowość
error_message: '-'
spin_speed: '-'
water_temp: '-'
tubclean_count: '57'
standby: 'off'
remote_start: 'on'
door_lock: 'on'
child_lock: 'off'
crease_care: 'off'
steam: 'off'
steam_softener: 'off'
pre_wash: 'off'
turbo_wash: 'off'
medic_rinse: 'off'
friendly_name: Washer
icon: mdi:washing-machine

Then I started washing by calling the service

service: smartthinq_sensors.remote_start
data:
  entity_id: sensor.washer

And the current state is:

model: F_R8_Y___W.A__QEUK-FL
mac_address: xx:xx:xx:xx:xx:xx
run_completed: 'off'
error_state: 'off'
initial_time: '1:30'
remain_time: '1:24'
reserve_time: '0:00'
current_course: Bawełna
run_state: Pranie
pre_state: Pranie
error_message: '-'
spin_speed: '1400'
water_temp: 40℃
tubclean_count: '57'
standby: 'off'
remote_start: 'on'
door_lock: 'on'
child_lock: 'off'
crease_care: 'off'
steam: 'off'
steam_softener: 'off'
pre_wash: 'off'
turbo_wash: 'off'
medic_rinse: 'off'
friendly_name: Washer
icon: mdi:washing-machine

Should I wait some time to the washer go to standby mode?

aslabicki commented 3 years ago

Now I can confirm that the standby sensor works also.

model: F_R8_Y___W.A__QEUK-FL
mac_address: xx:xx:xx:xx:xx:xx
run_completed: 'off'
error_state: 'off'
initial_time: '1:30'
remain_time: '0:00'
reserve_time: '0:00'
current_course: '-'
run_state: Gotowość
pre_state: Gotowość
error_message: '-'
spin_speed: '-'
water_temp: '-'
tubclean_count: '58'
standby: 'on'
remote_start: 'on'
door_lock: 'off'
child_lock: 'off'
crease_care: 'off'
steam: 'off'
steam_softener: 'off'
pre_wash: 'off'
turbo_wash: 'off'
medic_rinse: 'off'
friendly_name: Washer
icon: mdi:washing-machine
aslabicki commented 3 years ago

The dryer standby sensor has a different value than on/off. It's a shortcut of the polish word "Włączony" but works also.

model: RC90U2_WW-Dryer
mac_address: xx:xx:xx:xx:xx:xx
run_completed: 'off'
error_state: 'off'
initial_time: '0:00'
remain_time: '0:00'
reserve_time: '0:00'
current_course: '-'
run_state: Gotowość
pre_state: '-'
error_message: '-'
dry_level: '-'
standby: WŁ.
remote_start: 'on'
child_lock: 'off'
friendly_name: Dryer
icon: mdi:tumble-dryer
ollo69 commented 3 years ago

The dryer standby sensor has a different value than on/off. It's a shortcut of the polish word "Włączony" but works also.

This is wrong. It should only be "on" or "off". Could you enable debug for integration and attach here the result for your dryer, I need to understand what is provided in the paylod.

ollo69 commented 3 years ago

May be I found the issue, related to translation order. Pls wait next release to make a new test.

ollo69 commented 3 years ago

Can you try with the last release if standby status now contain the right values?

aslabicki commented 3 years ago

Unfortunately dryer stopped working after update

image

ollo69 commented 3 years ago

Typo error adding new feature to your dryer (process info) 😒. Will release fix soon...

ollo69 commented 3 years ago

It should be fixed with new version 0.8.13 just released

aslabicki commented 3 years ago

The newest version is working well. Thanks a lot.

model: RC90U2_WW-Dryer
mac_address: xx:xx:xx:xx:xx:xx
run_completed: 'off'
error_state: 'off'
initial_time: '0:00'
remain_time: '0:00'
reserve_time: '0:00'
current_course: '-'
run_state: Gotowość
process_state: Badanie wsadu
error_message: '-'
dry_level: '-'
standby: 'on'
remote_start: 'on'
child_lock: 'off'
friendly_name: Dryer
icon: mdi:tumble-dryer
ollo69 commented 3 years ago

Good, can we close this issue?

jordibsk10 commented 3 years ago

It works perfectly well 👍 Thank you all for your help and specially to @ollo69