Trying to subscribe to a MQTT topic out of an own logic code I realized that callback never gets called. Test was done with 1.9.0 but seems to happen also with 1.8.2
Enabling some debug logging you can see that caller-type not being recognized as "Logic" but "Unknown"
Logging output at subscription
DEBUG modules.mqtt _get_caller_type: inspect.stack()[2][1] = '/usr/local/smarthome_1.9.0/logics/kiosk.py', split = ['', 'usr', 'local', 'smarthome_1.9.0', 'logics', 'kiosk.py']
INFO modules.mqtt _get_caller_type: inspect.stack()[2][1] = '/usr/local/smarthome_1.9.0/logics/kiosk.py', split = ['', 'usr', 'local', 'smarthome_1.9.0', 'logics', 'kiosk.py']
DEBUG modules.mqtt 'subscribe_topic()' - called from Unknown by '()'
INFO modules.mqtt subscribe_topic: Adding topic 'fully/event/screenOn'
INFO modules.mqtt _add_subscription_definition: Unknown 'kiosk_browser' is subscribing to topic 'fully/event/screenOn'
INFO modules.mqtt subscribe_topic: mqtt module is subscribing to topic 'fully/event/screenOn' with qos=1 at broker (result=0, mid=29)
Logging output when topic received
DEBUG modules.mqtt _on_mqtt_message: RECEIVED topic 'fully/event/screenOn', payload 'b'{"deviceId":"xxxxxxx","event":"screenOn"}', QoS '1', retain '0'
DEBUG modules.mqtt _on_mqtt_message: subscription 'kiosk_browser': {'subscriber_type': 'unknown', 'callback': 'kiosk_browser', 'payload_type': 'str', 'bool_values': None}
ERROR modules.mqtt _on_mqtt_message: received topic for unknown subscriber_type 'unknown'
ERROR modules.mqtt _on_mqtt_message: Received topic 'fully/event/screenOn', payload 'b'{"deviceId":"xxxxxxx","event":"screenOn"}'', QoS '1', retain '0' WITHOUT matching item/logic
I was able to fix the issue for my szenario by updating an array-index within modules/mqtt/init.py:728 function _get_caller_type
instead of elif split[-3] == 'logics' use elif split[-2] == 'logics'
Trying to subscribe to a MQTT topic out of an own logic code I realized that callback never gets called. Test was done with 1.9.0 but seems to happen also with 1.8.2
Enabling some debug logging you can see that caller-type not being recognized as "Logic" but "Unknown"
Logging output at subscription
Logging output when topic received
I was able to fix the issue for my szenario by updating an array-index within modules/mqtt/init.py:728 function _get_caller_type instead of elif split[-3] == 'logics' use elif split[-2] == 'logics'