Sonoff RF Bridge with door contacts
Posted: Tuesday 03 March 2020 21:33
I have a DzVents script for handeling the data from my door contacts. The sends a notification in the weekends if one of the doors opens and closes.
The problem is the data recieved from the door contacts on the Sonoff RF Bridge is retained to the last value.
When this script is activated during the given time periode it will send a notification every minute when triggered.
The data from RFBridgesensor.rawData[1] keeps its value. Is there an option to clear this of reset it?
Best regards,
Johan
The problem is the data recieved from the door contacts on the Sonoff RF Bridge is retained to the last value.
When this script is activated during the given time periode it will send a notification every minute when triggered.
The data from RFBridgesensor.rawData[1] keeps its value. Is there an option to clear this of reset it?
Code: Select all
return {
on = {
timer = { 'at 23:20-06:30 on fri,sat,sun,mon },
devices = {'Sonoff RF Bridge'}
},
logging = {
level = domoticz.LOG_INFO
},
execute = function(domoticz, device)
local RFBridgesensor = domoticz.devices(16) --Sonoff RF Bridge
local blnContact = 0
if RFBridgesensor.rawData[1] == '11818094' then
dw1message = "Voordeur is geopend \r"
blnContact = 1
elseif RFBridgesensor.rawData[1] == '11818087' then
dw1message = "Voordeur is nu gesloten \r"
blnContact = 1
elseif RFBridgesensor.rawData[1] == '1515630' then
dw1message = "Achterdeur is geopend \r"
blnContact = 1
elseif RFBridgesensor.rawData[1] == '1515623' then
dw1message = "Achterdeur is nu gesloten \r"
blnContact = 1
elseif RFBridgesensor.rawData[1] == '6108270' then
dw1message = "Garage inloopdeur is geopend \r"
blnContact = 1
end
if blnContact == 1 then
domoticz.notify(dw1Onderwerp, dw1message, domoticz.PRIORITY_HIGH, nil, nil, domoticz.NSS_PUSHOVER ) --Verstuur een Pushover
blnContact = 0 --- reset value
end
}
Johan