Door contact, open/close IDX svalue MQTT
Posted: Sunday 18 November 2018 15:23
Hi all,
I also bought the cheap door contact

But connect it through a Sonoff RF bridge, which is flashed with Tasmota firmware.
The door contact sends different svalues for the status of 'open' and 'closed', however it is both sended by the same Idx (In my case Idx 5 (in Tasmota under "Sensor idx 6 Count/PM1") to Domoticz.
In the Log of Domoticz I'll get the following messages:
9243402 = Open
9243406 = Closed
But if I look in the Log of the Dummy switch with Idx 5 i'll see when I open ánd close the sensor:
Both messages are "Off"
So I want to make a switch that gives the right status.
I tried things with a LUA script, but I'm a noob
So I don't understand it.
Can somebody help me with making the script, so I'll get a Dummy switch that distinguishes the different svalue and translate it to the right status of the dummy switch?
Thanks a lot!
I also bought the cheap door contact
But connect it through a Sonoff RF bridge, which is flashed with Tasmota firmware.
The door contact sends different svalues for the status of 'open' and 'closed', however it is both sended by the same Idx (In my case Idx 5 (in Tasmota under "Sensor idx 6 Count/PM1") to Domoticz.
In the Log of Domoticz I'll get the following messages:
Code: Select all
2018-11-18 15:18:49.967 MQTT: Topic: domoticz/in, Message: {"idx":5,"nvalue":0,"svalue":"9243402","Battery":64,"RSSI":8}
2018-11-18 15:18:52.276 MQTT: Topic: domoticz/in, Message: {"idx":5,"nvalue":0,"svalue":"9243406","Battery":64,"RSSI":8}
9243406 = Closed
But if I look in the Log of the Dummy switch with Idx 5 i'll see when I open ánd close the sensor:
Code: Select all
2018-11-18 15:18:52 Off
2018-11-18 15:18:49 Off
So I want to make a switch that gives the right status.
I tried things with a LUA script, but I'm a noob

Can somebody help me with making the script, so I'll get a Dummy switch that distinguishes the different svalue and translate it to the right status of the dummy switch?
Thanks a lot!