FHEM Forum

FHEM => English Corner => Thema gestartet von: moustic999 am 05 Dezember 2019, 09:12:39

Titel: Thermostat function : open windows detection
Beitrag von: moustic999 am 05 Dezember 2019, 09:12:39
Does someone already implemented a function to detect that windows or doors are open by monitoring a quick temperature change in a room ?
some new "intelligent" thermostat have such function ( without sensor ).

I would like to implement such thing is it does not exist yet, but I don't know where to begin ....

some ideas ?
Titel: Antw:Thermostat function : open windows detection
Beitrag von: Otto123 am 05 Dezember 2019, 10:23:46
I have no solution but two ideas:
In Theorie you have to count the differential of the measured curve
userReadings have the differential function:
ZitatuserReadings
A comma-separated list of definitions of user-defined readings. Each definition has the form:
<reading>[:<trigger>] [<modifier>] { <perl code> }
After a single or bulk readings update, the user-defined readings are set by evaluating the perl code { <perl code> } for all definitions and setting the value of the respective user-defined reading <reading> to the result. If <trigger> is given, then all processing for this specific user reading is only done if one of the just updated "reading: value" combinations matches <trigger>, which is treated as a regexp.
Examples:
attr myEnergyMeter userReadings energy { ReadingsVal("myEnergyMeter","counters.A",0)/1250.0;; }
attr myMultiMeter userReadings energy1:counters.A.* { ReadingsVal("myMultiMeter","counters.A",0)/1250.0;; }, energy2:counters.B.* { ReadingsVal("myMultiMeter","counters.B",0)/1250.0;; }
<modifier> can take one of these values:
none: the same as it would not have been given at all.
difference: the reading is set to the difference between the current and the previously evaluated value.
differential: the reading is set to the difference between the current and the previously evaluated value divided by the time in seconds between the current and the previous evaluation. Granularity of time is one second. No value is calculated if the time past is below one second. Useful to calculate rates.
In my experience the change of the humidity is more dramatic then the temperature if you open door or window.
one example attached.
Titel: Antw:Thermostat function : open windows detection
Beitrag von: MadMax-FHEM am 05 Dezember 2019, 10:42:35
Zitat von: Otto123 am 05 Dezember 2019, 10:23:46
In my experience the change of the humidity is more dramatic then the temperature if you open door or window.

Yes, but depends on the difference between inside humidity and outside ("dewpoint")...

And (in my opinion) the whole thing depends on how quick (and/or often) the temperature is measured.
If measured only every some minutes you might already closed the window again before an opening was detected that way ;)

Regards, Joachim
Titel: Antw:Thermostat function : open windows detection
Beitrag von: Beta-User am 05 Dezember 2019, 10:54:07
Hmm, some (e.g. the ZigBee-Xiaomi) will ONLY send new data in case there's a significant change... So in these cases, you could use this as kind of opening event. But for closing? Sounds tricky, maybe a rise on temp would do when using such a sensor.

Other option: I did some arduino programming wrt. to quick rises in warmwater circuit to detect if someone opened the tap. Works pretty well. The node measures the temp in short cyrcles (every 10 seconds or so), but will send out info also only every 3 minutes in case there's no need/significant change (togehter with a lot of other sensor values). The arduino is sending it's data to FHEM via MySensors (RS485 as transport layer).

So it really depends on what you want to achieve, what kind of hardware you want to use ...

Regards,

Beta-User
Titel: Antw:Thermostat function : open windows detection
Beitrag von: moustic999 am 05 Dezember 2019, 12:01:11
my goal is to create an alarm if windows is open ( mainly during cold period, winter ) so if temp drop slightly in a period of time, I want an alarm to be triggered to remind to close the window. and in the same time, that will change the room thermostat to frost protection.

Titel: Antw:Thermostat function : open windows detection
Beitrag von: ch.eick am 05 Dezember 2019, 13:23:54
Zitat von: moustic999 am 05 Dezember 2019, 12:01:11
my goal is to create an alarm if windows is open ( mainly during cold period, winter ) so if temp drop slightly in a period of time, I want an alarm to be triggered to remind to close the window. and in the same time, that will change the room thermostat to frost protection.
Hi,
So that comes back to Ottos first example.
You may only use temp. instead of humidity.

Regards Christian

Gesendet von meinem SM-G930F mit Tapatalk
Titel: Antw:Thermostat function : open windows detection
Beitrag von: Peteruser am 13 Dezember 2019, 13:14:53
Hello,
as most thermostats offer already a funktion like that, you what to rebuild a thing that is already build. As you did not mention what system is used, i like point to
https://www.amazon.co.uk/Guangmaoxin-Security-Intelligent-Equipment-Connection/dp/B07Q2YMXSZ/ref=sr_1_3_sspa?crid=O13VXIBUNE66&keywords=aqara+door+window+sensor&qid=1576239094&sprefix=Aqara+windo%2Caps%2C158&sr=8-3-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFFOTNQWUROQVJJMFQmZW5jcnlwdGVkSWQ9QTAyMjMwNTQzTzBZOUNKWUU2S1BLJmVuY3J5cHRlZEFkSWQ9QTAwMTg4NDQzSUJRMlRKVzhMUzhUJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ== (https://www.amazon.co.uk/Guangmaoxin-Security-Intelligent-Equipment-Connection/dp/B07Q2YMXSZ/ref=sr_1_3_sspa?crid=O13VXIBUNE66&keywords=aqara+door+window+sensor&qid=1576239094&sprefix=Aqara+windo%2Caps%2C158&sr=8-3-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFFOTNQWUROQVJJMFQmZW5jcnlwdGVkSWQ9QTAyMjMwNTQzTzBZOUNKWUU2S1BLJmVuY3J5cHRlZEFkSWQ9QTAwMTg4NDQzSUJRMlRKVzhMUzhUJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==)

Things like that work 100% because the do not rely to other information and there is not a lot of money to spend.

Peter
Titel: Antw:Thermostat function : open windows detection
Beitrag von: moustic999 am 13 Dezember 2019, 17:39:53
I have knx thermostats in each room, they does not have this fonction, so I would liké to simulate this.. in thé future I will have Windows sensors installed...