I’m debugging an issue with mqtt_eventstream and zha lights, when I try to turn on/off a light from a remote instance nothing happen, so I started to debug, customizing some components and adding more logging… and now I’m seeing some really weird behavior, here a extract of the log when I try to turn off from remote hassio:
2019-05-30 00:32:41 INFO (MainThread) [custom_components.mqtt] Received message on primary/eventstream: b'{"event_type": "call_service", "event_data": {"domain": "light", "service": "turn_off", "service_data": {"entity_id": "light.sengled_e11_g13_031212df_1"}}}'
2019-05-30 00:32:41 INFO (MainThread) [custom_components.mqtt] Match: Subscription(topic='primary/eventstream/#', callback=<function async_setup.<locals>._event_receiver at 0x733848e8>, qos=0, encoding='utf-8')
2019-05-30 00:32:41 INFO (MainThread) [custom_components.mqtt_eventstream] _event_receiver
2019-05-30 00:32:41 INFO (MainThread) [custom_components.mqtt_eventstream] async_fire: call_service, {'domain': 'light', 'service': 'turn_off', 'service_data': {'entity_id': 'light.sengled_e11_g13_031212df_1'}}
2019-05-30 00:32:41 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_off, service_data=entity_id=light.sengled_e11_g13_031212df_1>
- the message is received by mqtt and passed to mqtt_eventstream
- mqtt_eventstream async fires a call_service, with the proper payload
- homeassistant.core handle the event, and thats all the log that core has…
- nothing more, light still on
But now here is a direct turn_off from the local homeassistant:
2019-05-30 00:32:54 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_off, service_data=entity_id=light.sengled_e11_g13_031212df_1>
2019-05-30 00:32:54 DEBUG (MainThread) [custom_components.zha.light] light.sengled_e11_g13_031212df_1: async_turn_off
2019-05-30 00:32:54 DEBUG (MainThread) [custom_components.zha.core.channels] 0xf9e1:1:0x0006: executed command: off with args: () with kwargs: {} and result: [0, <Status.SUCCESS: 0>]
2019-05-30 00:32:54 DEBUG (MainThread) [custom_components.zha.light] light.sengled_e11_g13_031212df_1: turned off: True
- core directly get the event, and handle it
- zha.light async_turn_off gets called
- the light turn off…
In the first case everything runs fine until step 3, that step looks the same as step 1 on the second example… so, why the first one just stop there? Event looks the same, payload too… whats wrong? what am I missing?
BTW, any chance to put a pdb into the core?.. logging doesn’t looks enough… and BTW, why so little debug messages? I expect debug to be really verbose and tell me what is going on step by step…
thanks in advance!