diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.52k stars 274 forks source link

Device is unreachable: float division by zero in a Tasmota-like lightbulb #941

Open DiegoJp opened 8 months ago

DiegoJp commented 8 months ago

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

Yes

Description

Hello, when adding a OpenBk (which is Tasmota-like custom firmware for Tuya devices) lightbulb to diyHue from the webapp sometimes the logs floods with:

2023-10-21 10:30:19,826 - services.stateFetch - WARNING - ampolleta-velador is unreachable: float division by zero

In which ampolleta-velador is my device's hostname. Of course this devices is always on and connected to my Wi-Fi network with no issues (I can ping to it with 0% packet loss) imagen

Other lights configured (such as WLED) and disconnected from the network shows as this:

2023-10-21 10:35:33,429 - services.stateFetch - WARNING - wled-f83867_seg0 is unreachable: <urlopen error [Errno 113] Host is unreachable> which is different.

This behaviour _device_ is unreachable: float division by zero causes Hue Essentials app and Hue Sync windows app to sometimes treat the lightbulbs as it were disconnected but they are actually connected and OK.

I do not know if this issue is related to diyHue or OpenBeken so please guide me on how (and who) to proceed with this. I can be of help

Regards, Diego Jp

Errorlog:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...

Add-on: diyHue Emulate a Hue Bridge, add lights, sensors etc. from different vendors into one Ecosystem

Add-on version: 2.0.9 You are running the latest version of this add-on. System: Home Assistant OS 11.0 (amd64 / qemux86-64) Home Assistant Core: 2023.10.3 Home Assistant Supervisor: 2023.10.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. /config/diyhue exists. Your Architecture is = amd64 Serve HTTPS 2023-10-21 10:30:16,412 - configManager.argumentHandler - INFO - Using Host 192.168.1.190:80 2023-10-21 10:30:16,412 - configManager.argumentHandler - INFO - Host MAC given as 02186852322F 2023-10-21 10:30:16,412 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255 2023-10-21 10:30:16,412 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1 2023-10-21 10:30:16,412 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled! 2023-10-21 10:30:16,414 - configManager.argumentHandler - INFO - Using Host 192.168.1.190:80 2023-10-21 10:30:16,415 - configManager.argumentHandler - INFO - Host MAC given as 02186852322F 2023-10-21 10:30:16,415 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255 2023-10-21 10:30:16,415 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1 2023-10-21 10:30:16,415 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled! 2023-10-21 10:30:16,416 - configManager.argumentHandler - INFO - Debug logging disabled! 2023-10-21 10:30:16,564 - configManager.configHandler - INFO - Config loaded 2023-10-21 10:30:16,660 - services.mqtt - INFO - Strting MQTT service... 2023-10-21 10:30:16,660 - services.homeAssistantWS - WARNING - Home Assistant Web Socket Client disconnected trying to (re)connect 2023-10-21 10:30:16,663 - services.homeAssistantWS - INFO - Home Assistant WebSocket Connection Opened 2023-10-21 10:30:16,663 - services.homeAssistantWS - INFO - Home Assistant WebSocket Connection Closed. Code: 1006 Reason Going away 2023-10-21 10:30:16,664 - services.homeAssistantWS - ERROR - Error connecting to Home Assistant WebSocket Traceback (most recent call last): File "/opt/hue-emulator/services/homeAssistantWS.py", line 232, in create_websocket_client homeassistant_ws_client.connect() File "/usr/local/lib/python3.8/site-packages/ws4py/client/init.py", line 247, in connect self.process(body) File "/usr/local/lib/python3.8/site-packages/ws4py/websocket.py", line 462, in process self.reading_buffer_size = s.parser.send(bytes) or DEFAULT_READING_SIZE AttributeError: 'NoneType' object has no attribute 'parser' 2023-10-21 10:30:16,666 - services.remoteDiscover - INFO - Starting discovery service 2023-10-21 10:30:16,675 - services.stateFetch - INFO - start lights sync 2023-10-21 10:30:16,679 - services.ssdp - INFO - starting ssdp... 2023-10-21 10:30:16,680 - services.ssdp - INFO - start ssdp broadcast 2023-10-21 10:30:16,685 - services.mdns - INFO - listener started 2023-10-21 10:30:16,693 - services.mqtt - INFO - Auto discovery message on: homeassistant/light/0xa4c138188c422939/light/config

Steps to reproduce

imagen

If I remove the lightbulbs from diyHue these messages do not appear ever.

Please enter your operating system details here

The install is a Home Assistant setup addon, hosted in a Proxmox VM in a HP mini PC.

What DiyHue version(branch) are you using?

master (latest)