CoolKit-Technologies / ha-addon

Apache License 2.0
253 stars 117 forks source link

DUAL-R3 renamed to undefined-1/2 on power loss and lovelace card needs to be resynced manually #118

Closed kenny59 closed 1 year ago

kenny59 commented 1 year ago

Hello. On my HA instance it seems that DUAL R3 switches are mapped individually _1/_2 and when "sysmsg" is received for unavailable/available messages getStateByEntityId doesn't take that into account. I am guessing similar is happening to other multi-switch devices as well.

Here is unavailable message for reference. {"action":"sysmsg","deviceid":"<device-id-without-outlet-number>","apikey":"<api-key>","params":{"online":false}}

Some context: I have heating setup in a way that an external timed trigger turns off the contactor which heating is connected to every 3-5 hours for about 40 minutes. When this happens, my entities are renamed to undefined-1/2 and I need to resync lovelace card before I can control the device again.

coolkit-tony commented 1 year ago

Hi, @kenny59. Thanks for your contributions. :-)

I will test this patch on my local machine.

kenny59 commented 1 year ago

Sure, thank you. Let me know if you need more information.