Platform: Synology Diskstation DS214+ with DSM 6.2
Openhab 2.2.0.010
Mosquitto 1.4.14-9
I have a few Sonoff switches for a group of lamps and normally everything is working quite well.
But sometimes one of the switches comes in a loop and continues to switch on and off without possibility to break the loop. This happens normally in combination or short after I have used the button on the switch to manually switch on or off the lamp.
Can anybody give me some hints, how to find the reason for this behaviour? I guess there is something wrong or missing in the configuration.
Below you see the content of the configuration files:
OpenHab configuration
=== Things ===
(openhab/conf/things/default.things)
ntp:ntp:demo [ hostname="se.pool.ntp.org", refreshInterval=60, refreshNtp=30 ]
=== Services ===
(openhab/conf/services/mqtt.cfg)
mybroker.url=tcp://192.168.1.51:1883
mybroker.clientId=nas
=== Items ===
(openhab/conf/items/default.items)
Switch Balkong "Balkongdörr" {mqtt=">[mybroker:/BalkongdorrLamp/gpio/12:command:ON:1],>[mybroker:/BalkongdorrLamp/gpio/12:command:OFF:0],<[mybroker:/BalkongdorrLamp/lightState/Switch:command:OFF:0],<[mybroker:/BalkongdorrLamp/lightState/Switch:command:ON:1]"}
Switch Fonster "Fönster" {mqtt=">[mybroker:/VardagsrumLamp/gpio/12:command:ON:1],>[mybroker:/VardagsrumLamp/gpio/12:command:OFF:0],<[mybroker:/VardagsrumLamp/lightState/Switch:command:OFF:0],<[mybroker:/VardagsrumLamp/lightState/Switch:command:ON:1]"}
Switch Garage "Garage" {mqtt=">[mybroker:/UtomhusBalkong/gpio/12:command:ON:1],>[mybroker:/UtomhusBalkong/gpio/12:command:OFF:0],<[mybroker:/UtomhusBalkong/lightState/Switch:command:OFF:0],<[mybroker:/UtomhusBalkong/lightState/Switch:command:ON:1]"}
Switch Kontor "Kontor" {mqtt=">[mybroker:/UtomhusKontoret/gpio/12:command:ON:1],>[mybroker:/UtomhusKontoret/gpio/12:command:OFF:0],<[mybroker:/UtomhusKontoret/lightState/Switch:command:OFF:0],<[mybroker:/UtomhusKontoret/lightState/Switch:command:ON:1]"}
Number InneTemp "Temperatur inomhus [%.1f °C]" <temperatur> { mqtt="<[mybroker:/UtomhusBalkong/InneTemp/Temperatur:state:default]" }
Number InneFukt "Fuktighet inomhus [%.0f %]" <fuktighet> { mqtt="<[mybroker:/UtomhusBalkong/InneTemp/Fuktighet:state:default]" }
DateTime Date "Date [%1$tY-%1$tm-%1$td %1$tH:%1$tM]" { channel="ntp:ntp:demo:dateTime" }
=== Rules ===
(openhab/conf/rules/default.rules)
rule "lichtuit"
when
Time cron "0 0 0 ? * *"
then
sendCommand(Balkong, OFF)
sendCommand(Fonster, OFF)
sendCommand(Garage, OFF)
end
rule "lichtaan"
when
Channel 'astro:sun:906dd801:set#event' triggered START
then
sendCommand(Balkong, ON)
sendCommand(Fonster, ON)
sendCommand(Garage, ON)
end
rule "klockan_1800_on"
when
Time cron "0 0 18 ? * *"
then
sendCommand(Balkong, ON)
end
=== Sitemap ===
(openhab/conf/rules/default.rules)
sitemap default label="Huset" {
Frame label="Datum" {
Text item=Date
}
Frame label="Vardagsrummet" {
Switch item=Balkong label="Balkongdörr" icon="light"
Switch item=Fonster label="Fönster" icon="light"
}
Frame label="Utomhus" {
Switch item=Framdorr label="Framdörr" icon="light"
Switch item=Garage label="Garage" icon="light"
Switch item=Kontor label="Kontor" icon="light"
}
}
=========================================================
BalkongdorrLamp (Sonoff S20 with ESP Easy)
Rules set1 (to be able to switch the light on and off with the button on S20)
on lightSwitch#Switch do
if [lightState#Switch]=0
gpio,12,1
else
gpio,12,0
endif
endon