2019-02-14 16:18:02.030 [ome.event.ItemCommandEvent] - Item ‘Sonoff1’ received command ON
==> /var/log/openhab2/openhab.log <==
2019-02-14 16:18:02.257 [WARN ] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ‘broker’ was lost: Verbindung wurde getrennt : ReasonCode 32109 : Cause : Connection reset
2019-02-14 16:18:02.259 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restoring connection to broker ‘broker’
rule “My Dash Button pressed”
when
Channel “amazondashbutton:dashbutton:38-f7-3d-8a-58-9a:press” triggered
then
logInfo(“dash”,“log”)
Sonoff1.sendCommand(ON)
end
If I put the sendCommand in a rule for a other device(Xiaomi Cube) it is working
And in your rule you used the wrong quotation marks “” !!!
rule “My Dash Button pressed”
when
Channel “amazondashbutton:dashbutton:38-f7-3d-8a-58-9a:press” triggered
then
logInfo(“dash”,“log”)
Sonoff1.sendCommand(ON)
end
.
. Here are the correct quotation marks:
rule "My Dash Button pressed"
when
Channel "amazondashbutton:dashbutton:38-f7-3d-8a-58-9a:press" triggered
then
logInfo("dash","log")
Sonoff1.sendCommand(ON)
end
The quotation marks where the right one in the code.
The trigger is reached correctly. I added loging before and after to visualize the problem.
New rule
rule “My Dash Button pressed”
when
Channel “amazondashbutton:dashbutton:38-f7-3d-8a-58-9a:press” triggered
then
logInfo(“dash”,“before”)
Sonoff1.sendCommand(ON)
logInfo(“dash”,“after”)
end
working rule outside dashbutton:
rule “Garagentor”
when
Item GarageGate1 received command ON
then
createTimer(now.plusSeconds(1)) [|
sendCommand(GarageGate1, OFF)
]
end
2019-02-14 21:04:03.192 [INFO ] [.eclipse.smarthome.model.script.dash] - before
==> /var/log/openhab2/events.log <==
2019-02-14 21:04:03.198 [ome.event.ItemCommandEvent] - Item ‘Sonoff1’ received command ON
==> /var/log/openhab2/openhab.log <==
2019-02-14 21:04:03.200 [INFO ] [.eclipse.smarthome.model.script.dash] - after
2019-02-14 21:04:03.427 [WARN ] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ‘broker’ was lost: Verbindung wurde getrennt : ReasonCode 32109 : Cause : Connection reset
2019-02-14 21:04:03.429 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restoring connection to broker ‘broker’
Yes I also tried the profile.
But I found out that if I delay the mqtt send by 5s than it works. 5s is the intervall set for the dashbutton to ignore multiple button presses. Maybe it somehow prevents mqtt trafic as well