planbnet / livisi_unofficial

Unofficial fork of the home assistant livisi integration without dependencies on the abandoned aiolivisi lib
Apache License 2.0
36 stars 5 forks source link

Devices keep going offline after a while #32

Closed Gerrett84 closed 1 year ago

Gerrett84 commented 1 year ago

System Health details

Needed?

Checklist

Describe the issue

After every restart my light/switch devices are offline. As soon as I switch on to off, they are online again. After a while, however, here and there a device goes offline again until you click again.Sometimes Hassio receives a status change that was not carried out via hassio or with .

Reproduction steps

Reboot

Debug logs

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant
Source: custom_components/livisi/light.py:172
Integration: Livisi Unofficial (documentation, issues)
First occurred: 15:32:03 (1 occurrences)
Last logged: 15:32:03

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1001, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/livisi/light.py", line 172, in async_added_to_hass
    level = int(round((float(response) / 100) * 255))
                       ^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'

Diagnostics dump

....

ThMFlive commented 1 year ago

I have the same problem the last days. Probably after the last Update of HA?

Gerrett84 commented 1 year ago

I think the problem started with version 1.4.0.

ThMFlive commented 1 year ago

It looks like everything is working with the new version 1.5.2

Gerrett84 commented 1 year ago

Yes, it looks good. After a restart, all devices are online :-)