Thermostat function : open windows detection

Begonnen von moustic999, 05 Dezember 2019, 09:12:39

Vorheriges Thema - Nächstes Thema

moustic999

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 ?

Otto123

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.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

MadMax-FHEM

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
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Beta-User

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
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

moustic999

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.


ch.eick

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
RPI4; Docker; CUNX; Eltako FSB61NP; SamsungTV H-Serie; Sonos; Vallox; Luxtronik; 3x FB7490; Stromzähler mit DvLIR; wunderground; Plenticore 10 mit BYD; EM410; SMAEM; Modbus TCP
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/ch.eick

Peteruser

Ubuntu+Debian FHEM + ESPEasy + Homematic + ConBee + DUROFERN

moustic999

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...