Detect if fridge door (contcat sensor) stays open

Hi,

typical problem (at least for me :slight_smile:): The fridge door stays open to long or is not properly closed.

My idea: Adding a contact sensor to the fridge door and create a simple flow which detects it and sends a warning to our google home.

I don't have the sensors yet, but already wanted to play around with a flow.

My first idea was super simple:

The problem with this flow is, if the door is closed and opened while the delay is still active and stays open for a second after the delay is done, there will be a false alarm.

Another idea was this:

This also doesn't work if multiple "CLOSE" and "OPEN" are send.

Does someone has an idea how I can implement such a behaviour?

I think "CLOSE" should always reset the timer and an "OPEN" should start a new timer from scratch so to say

Would this work using trigger node? (tested only quickly but does was @krambriw suggested above)

[{"id":"a9682048.d1fef","type":"inject","z":"bf210454.b85538","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"open","payloadType":"str","x":90,"y":140,"wires":[["6664e7b7.ccf068"]]},{"id":"7319e2e7.1324bc","type":"debug","z":"bf210454.b85538","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":180,"wires":[]},{"id":"575223cd.9cecfc","type":"inject","z":"bf210454.b85538","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"close","payloadType":"str","x":90,"y":220,"wires":[["6664e7b7.ccf068"]]},{"id":"6664e7b7.ccf068","type":"trigger","z":"bf210454.b85538","name":"","op1":"","op2":"DOOR ALARM","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"close","bytopic":"all","topic":"topic","outputs":2,"x":240,"y":180,"wires":[[],["7319e2e7.1324bc"]]}]

I've setup the same thing for our freezer as my girlfriend often fails to close it properly. A Pushover message is then sent to both of our phones. :smile:

I tested this solution, but unfortunately this doesn't as expected.
If I send multiple "open", "close", "open", "close", I also receive multiple of them.

This works perfect for me. Thank you very much.

Great! Please mark the question solved so others don't need to check if there's still an open question. :slightly_smiling_face:

Edit: it was already handled.

Glad to see that your problem is solved. I can recommend the GS-WDS07 door sensors, they give an "open" and "closed" signal, not all door sensors do. They are 433 Mhz sensors.

Good to hear more endorsement for them as I have 5 of them on their (presently slow) way from China! The only door sensors that I have in use are two prohibitively expensive Z-wave ones from the beginning of my automation hobby. Besides them I have one of those frustrating single way only triggering sensors from Sonoff (useless).

Mine came from there too! :slight_smile: I was pleasantly surprised by how well they work.

This is more or less off topic, sorry!

@ghayne I received the door sensors today. My plan is to listen them using a Sonoff RF Bridge (flashed with Espurna).

I noticed the sensors send a rolling code but the last 6 digits seemed to be fixed for each event. Is this how you're interpreting the sensor/event or is there a fancier way?

I am using a RF Bridge flashed with Tasmota and get this in the console:

16:52:56 MQT: tele/rfbridge1/RESULT = {"Time":"2020-06-10T16:52:56","RfReceived":{"Sync":14080,"Low":490,"High":1350,"Data":"E07A0E","RfKey":"None"}}
16:52:59 MQT: tele/rfbridge1/RESULT = {"Time":"2020-06-10T16:52:59","RfReceived":{"Sync":14000,"Low":500,"High":1400,"Data":"E07A0A","RfKey":"None"}}

E07A0E is closed
E07A0A is opened

I use this change node attached to a MQTT in node subscribed to

tele/rfbridge1/RESULT
[{"id":"98294a1e.113d88","type":"change","z":"bfe6a9c4.a758a8","name":"","rules":[{"t":"move","p":"payload.RfReceived.Data","pt":"msg","to":"payload","tot":"msg"},{"t":"change","p":"payload","pt":"msg","from":"E6C60E","fromt":"str","to":"Front door is closed","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"E6C60A","fromt":"str","to":"Front door is open","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"E2CE0E","fromt":"str","to":"Back door is closed","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"E2CE0A","fromt":"str","to":"Back door is open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":100,"wires":[["28a8d473.3f7e6c","ff568651.21b848"]]}]

Thanks! It seems Tasmota is smarter and can interpret the data. I believe E07A0x is the last part of the message. Espurna sends all the data as a single string like 36C401D60546E4050A. xxxxxE4050A is open, xxxxxE4050E is closed in the case of one of the sensors. I'll just create a switch with a "string contains" evaluation like I had to do with Sonoff PIR sensors. :+1: