@xAPPO My smoke alert is an “alert only” message. I’ve simply attached an ESP8266 to a regular smoke detector. If smoke is detected the ESP sends an alert message. If the smoke alert is reset the power to the ESP is simply cut, so there will be no “alert ended” message. This is why I configured this as a channel trigger.
@denominator I had the problem with the multiple events several times again. (Every time I changed something in the Home channels) I guess when the binding is re-initializing it simply subscribes every mqtt topic again without unsubscribing the old one’s before. Could this maybe be something that could be fixed in the binding?
Some rules are run when openHAB starys or if you change something in a file it may trigger a rule. Check to make sure the 8266 is only sendin one message it may be a qos setting. I do would do this wit another mqtt client that holds a history of messages like mqttexplorer.
hmm, but that is what it should do. The broker can see same listener subscribing to same topic. That part would be all the same if you rebooted openHAB.
Maybe what is missing is a closedown handshake, or maybe the broker should handle (i.e. not create) duplicate subscriptions.
@denominator I’ve already checked that with MQTT.fx, the device only sends one message. Also after a restart of OpenHab the rule is only triggered once.
@rossko57 I just created a small Python script to test what happens if a client subscribes multiple times to a topic and indeed I receive one message for every subscription. (in this case I received the message twice) Here is the script if you would like to test this yourself:
@denominator@rossko57 I did some quick test and I was able to reproduce the problem. I’ve enabled the MQTT trace log and simply changed the name of one of the channels in PaperUI. In the log I found that only the topics of the first two Homie nodes where unsubscribed, but after that all three nodes where subscribed again. I guess this explains the doubled rule triggers I get. Here is the log after I’ve changed the channel:
In this example I changed the mqtt:homie300:4ce1d806:rollershuttercontroller01:system#rssi channel. Only the rollershutter_1 and rollershutter_2 nodes where unsubscribed. All the properties in the system node where not unsubscribed, but then subscribed again. After this the rule for the mqtt:homie300:4ce1d806:rollershuttercontroller01:system#log triggered twice every time something was published on the topic.
If it’s making the effort to unsubscribe some channels, it sounds like a bug if it’s failing to get 'em all. Present you evidence and analysis in a Github issue.
Presumably this is just a nuisance during development for you now, and will not occur during normal running.