You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is one or more IKEA STYRBAR remote connected to a Zigbee network via zigbee2mqtt, diyhue's MQTT device discovery crashes with a (mostly disguised) error and terminates prematurely.
At this point I decided that raising an issue here might be worthwhile, in case someone more familiar with the MQTT code would be able to fix things more quickly than I can stumble through it ;)
Errorlog:
diyhue-1 | 2025-01-02 18:37:29,995 - configManager.argumentHandler - 119 - INFO - Using Host 172.21.0.2:80
diyhue-1 | 2025-01-02 18:37:29,995 - configManager.argumentHandler - 120 - INFO - Using Host 172.21.0.2:443
diyhue-1 | 2025-01-02 18:37:29,998 - configManager.argumentHandler - 145 - INFO - Host MAC given as xxxx
diyhue-1 | 2025-01-02 18:37:29,999 - configManager.argumentHandler - 119 - INFO - Using Host 172.21.0.2:80
diyhue-1 | 2025-01-02 18:37:29,999 - configManager.argumentHandler - 120 - INFO - Using Host 172.21.0.2:443
diyhue-1 | 2025-01-02 18:37:30,003 - configManager.argumentHandler - 145 - INFO - Host MAC given as xxxx
diyhue-1 | 2025-01-02 18:37:30,006 - configManager.argumentHandler - 29 - INFO - Debug logging disabled!
diyhue-1 | 2025-01-02 18:37:30,052 - configManager.configHandler - 267 - INFO - Config loaded
diyhue-1 | 2025-01-02 18:37:30,201 - services.updateManager - 30 - INFO - no swversion number update from Philips
diyhue-1 | 2025-01-02 18:37:30,477 - services.updateManager - 66 - INFO - no update for diyHue or UI on github
diyhue-1 | 2025-01-02 18:37:30,478 - services.mqtt - 451 - INFO - Strting MQTT service...
diyhue-1 | 2025-01-02 18:37:30,479 - services.remoteDiscover - 10 - INFO - Starting discovery service
diyhue-1 | 2025-01-02 18:37:30,482 - services.stateFetch - 12 - INFO - start lights sync
diyhue-1 | 2025-01-02 18:37:30,483 - services.ssdp - 25 - INFO - starting ssdp...
diyhue-1 | 2025-01-02 18:37:30,485 - services.ssdp - 39 - INFO - start ssdp broadcast
diyhue-1 | 2025-01-02 18:37:30,486 - services.mdns - 8 - INFO - <MDNS> listener started
diyhue-1 | 2025-01-02 18:37:30,487 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x0017880100d91089/light/config
diyhue-1 | 2025-01-02 18:37:30,489 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x00178801043ee580/light/config
diyhue-1 | 2025-01-02 18:37:30,491 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010486c689/light/config
diyhue-1 | * Serving Flask app 'HueEmulator3' (lazy loading)
diyhue-1 | * Environment: production
diyhue-1 | WARNING: This is a development server. Do not use it in a production deployment.
diyhue-1 | Use a production WSGI server instead.
diyhue-1 | * Debug mode: off
diyhue-1 | 2025-01-02 18:37:30,494 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010c00a56f/light/config
diyhue-1 | 2025-01-02 18:37:30,495 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010c00b0ea/light/config
diyhue-1 | * Serving Flask app 'HueEmulator3' (lazy loading)
diyhue-1 | 2025-01-02 18:37:30,496 - werkzeug - 225 - WARNING - * Running on all addresses.
diyhue-1 | WARNING: This is a development server. Do not use it in a production deployment.
diyhue-1 | * Environment: production
diyhue-1 | WARNING: This is a development server. Do not use it in a production deployment.
diyhue-1 | Use a production WSGI server instead.
diyhue-1 | * Debug mode: off
diyhue-1 | 2025-01-02 18:37:30,496 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010491db83/light/config
diyhue-1 | 2025-01-02 18:37:30,496 - werkzeug - 225 - WARNING - * Running on all addresses.
diyhue-1 | WARNING: This is a development server. Do not use it in a production deployment.
diyhue-1 | 2025-01-02 18:37:30,496 - werkzeug - 225 - INFO - * Running on http://172.21.0.2:80/ (Press CTRL+C to quit)
diyhue-1 | 2025-01-02 18:37:30,497 - werkzeug - 225 - INFO - * Running on https://172.21.0.2:443/ (Press CTRL+C to quit)
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_1/light/config
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_2/light/config
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_3/light/config
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_4/light/config
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x0017880108ef9495/light/config
diyhue-1 | 2025-01-02 18:37:30,497 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010c0f3a60/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x30fb10fffed9b9fd/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x30fb10fffed8c69f/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x60b647fffe202b45/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_5/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_6/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0xa4c13886fbf077a2/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0xa4c138148f5c326b/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_7/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0xa4c138a7f20dc5a2/light/config
diyhue-1 | 2025-01-02 18:37:30,498 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/1221051039810110150109113116116_8/light/config
diyhue-1 | 2025-01-02 18:37:30,499 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x001788010c2cc5bb/light/config
diyhue-1 | 2025-01-02 18:37:30,499 - services.mqtt - 251 - INFO - Auto discovery message on: homeassistant/light/0x00178801102c46cc/light/config
diyhue-1 | 2025-01-02 18:37:30,500 - services.mqtt - 314 - INFO - MQTT: Add new mqtt sensor Study controller
diyhue-1 | 2025-01-02 18:37:30,500 - services.mqtt - 417 - INFO - MQTT Exception | 'Remote Control N2'
Steps to reproduce
Start diyhue with MQTT discovery enabled, a zigbee2mqtt instance on the same MQTT broker, and a STYRBAR remote on the Zigbee network that doesn't already exist in diyhue's sensors.yaml.
Please enter your operating system details here
Hue-Emulator Version: 2025-01-02 17:21:42.740778641 +0000 (more usefully, built from jamesremuscat@7afd8bb )
WebUI Version: 2024-12-01 10:25:10.000000000 +0000
Architecture: x86_64
OS: Linux
Linux version: #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024
Linux release: 6.8.0-45-generic
Hardware: N/A / Docker
Upload debug tar
DiyHue > Bridge > Bridge Control > Download debug > Full debug fails and raises several exceptions in the log. Let me know what if anything you need.
What DiyHue version(branch) are you using?
master (latest)
The text was updated successfully, but these errors were encountered:
Hi,
Thank you fro the detailed information.
If i understand correctly with the edit of sensor_types you can add the sensors without diyhue crashing?
For the problem with the remote not doing what you want, most of the mqtt standardSensors are community added.
This means that it is not made by the dev team and there for not tested, to test this you need the actual device.
The person who made this wanted the buttons to do what they do now.
But you can change this, i suggest you change these lines to:
Issue does not already exist?
I have searched and found no existing issue
Select Environment
Docker
Home Assistant related?
No
Description
When there is one or more IKEA STYRBAR remote connected to a Zigbee network via zigbee2mqtt, diyhue's MQTT device discovery crashes with a (mostly disguised) error and terminates prematurely.
These devices have a
model_id
ofRemote Control N2
. There is a (partial) keymap for this device defined in https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/services/mqtt.py#L122. Because of this, MQTT discovery attempts to look up themodel_id
insensorTypes
(https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/services/mqtt.py#L313). There is noRemote Control N2
entry insensorTypes
, so aKeyError
is raised, and caught here - unhelpfully the only error that is logged is:The first thing I tried was giving this model an entry in sensorTypes, copying from one of the other IKEA entries; while this did prevent the exception and allow MQTT discovery to complete, it wasn't sufficient to have the device work correctly.
One issue is that the device does not send button release events, except for release-after-long-press. This means that diyhue interprets a short press of "on" or "off" as a never-ending long press (until another button is pressed), as the shortcut to evaluating the state-change message returns early if
action
is null or empty.At this point I decided that raising an issue here might be worthwhile, in case someone more familiar with the MQTT code would be able to fix things more quickly than I can stumble through it ;)
Errorlog:
Steps to reproduce
Start diyhue with MQTT discovery enabled, a zigbee2mqtt instance on the same MQTT broker, and a STYRBAR remote on the Zigbee network that doesn't already exist in diyhue's
sensors.yaml
.Please enter your operating system details here
Hue-Emulator Version: 2025-01-02 17:21:42.740778641 +0000 (more usefully, built from jamesremuscat@7afd8bb )
WebUI Version: 2024-12-01 10:25:10.000000000 +0000
Architecture: x86_64
OS: Linux
Linux version: #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024
Linux release: 6.8.0-45-generic
Hardware: N/A / Docker
Upload debug tar
DiyHue > Bridge > Bridge Control > Download debug > Full debug
fails and raises several exceptions in the log. Let me know what if anything you need.What DiyHue version(branch) are you using?
master (latest)
The text was updated successfully, but these errors were encountered: