Okay, I think I’ve got logging set up now. I had some trouble at first, naturally.
Here are the mqtt related bundles in my system:
openhab> list -s | grep -i mqtt
222 │ Active │ 80 │ 1.2.0 │ org.eclipse.paho.client.mqttv3
236 │ Active │ 80 │ 0.11.0.oh250M1 │ org.eclipse.smarthome.binding.mqtt
237 │ Active │ 80 │ 0.11.0.oh250M1 │ org.eclipse.smarthome.binding.mqtt.generic
242 │ Active │ 80 │ 0.11.0.oh250M1 │ org.eclipse.smarthome.io.transport.mqtt
org.eclipse.paho.client.mqttv3 is unbelievably chatty. Like 15 kilobytes per event. I think that may be too extreme to be useful, becase it’s going to end up being an insane amount of data in several hours? The things logged are all at DEBUG level, so changing it from TRACE to DEBUG wouldn’t help either.
org.eclipse.smarthome.binding.mqtt is much more reasonable but it only show publishings, not subscriptions.
For example:
2019-07-01 10:17:34.747 [DEBUG] [home.binding.mqtt.action.MQTTActions] - MQTT publish to home/mcu/kitchen-fan-1/inbound/speed performed
2019-07-01 10:17:34.760 [DEBUG] [home.binding.mqtt.action.MQTTActions] - MQTT publish to home/mcu/kitchen-fan-2/inbound/speed performed
2019-07-01 10:17:34.773 [DEBUG] [home.binding.mqtt.action.MQTTActions] - MQTT publish to home/mcu/kitchen-fan-3/inbound/speed performed
That’s what my script publishes to the actual fan MCUs. That part has never failed. Even when the openhab generic mqtt item’s subscription has failed, I can still push these buttons:
…and the script picks up on it and publishes the MQTT messages for the fan MCUs. The fans go “bleep” and then start spinning.
Note the absense of any incoming MQTT messages, though.
org.eclipse.smarthome.binding.mqtt.generic doesn’t yield any logs at all.
The LAST one, org.eclipse.smarthome.io.transport.mqtt, seems to be the winner.
Check this out.
2019-07-01 10:22:39.599 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' : KitchenFan*long
2019-07-01 10:22:39.603 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$name
2019-07-01 10:22:39.604 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$homie
2019-07-01 10:22:39.606 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$state
2019-07-01 10:22:39.607 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex home/mcu/LivingRoomMCU/433mhz/KitchenFan
2019-07-01 10:22:39.609 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$nodes
2019-07-01 10:22:39.703 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 133 delivered.
2019-07-01 10:22:39.726 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 134 delivered.
2019-07-01 10:22:39.752 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 135 delivered.
That’s the one you meant isn’t it?
Posting log items from intentionally changing the topic subscription in the detail block below for posterity.
mosquitto.log:
1561954634: Received UNSUBSCRIBE from openhab
1561954634: home/mcu/LivingRoomMCU/433mhz/KitchenFan2
1561954634: openhab home/mcu/LivingRoomMCU/433mhz/KitchenFan2
1561954634: Received SUBSCRIBE from openhab
1561954634: home/mcu/LivingRoomMCU/433mhz/KitchenFan (QoS 1)
1561954634: openhab 1 home/mcu/LivingRoomMCU/433mhz/KitchenFan
1561954634: Sending SUBACK to openhab
mqtt.log (org.eclipse.smarthome.io.transport.mqtt)
2019-07-01 11:16:57.826 [TRACE] [.transport.mqtt.MqttBrokerConnection] - Unsubscribing message consumer for topic 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' from broker '127.0.0.1'
2019-07-01 11:17:14.321 [TRACE] [.transport.mqtt.MqttBrokerConnection] - Unsubscribing message consumer for topic 'home/mcu/LivingRoomMCU/433mhz/KitchenFan2' from broker '127.0.0.1'
2019-07-01 11:20:41.335 [TRACE] [ansport.mqtt.internal.ClientCallback] - Received message on topic 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' : KitchenFan*long
2019-07-01 11:20:41.336 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$name
2019-07-01 11:20:41.337 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$homie
2019-07-01 11:20:41.339 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$state
2019-07-01 11:20:41.340 [TRACE] [ansport.mqtt.internal.ClientCallback] - Topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex home/mcu/LivingRoomMCU/433mhz/KitchenFan
2019-07-01 11:20:41.341 [TRACE] [ansport.mqtt.internal.ClientCallback] - No topic match for 'home/mcu/LivingRoomMCU/433mhz/KitchenFan' using regex homie/TestMQTTdev/\$nodes
2019-07-01 11:20:41.473 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 158 delivered.
2019-07-01 11:20:41.487 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 159 delivered.
2019-07-01 11:20:41.498 [TRACE] [ansport.mqtt.internal.ClientCallback] - Message with id 160 delivered.
It seems that the org.eclipse.smarthome.io.transport.mqtt shows unsubscribes but not subscribes. Still, mosquittos own logging shows it, so let’s see what happens. Will leave this for now and keep working on my homie v3 esp8266 code.