FHEM > English Corner

Presence detection

(1/1)

andyclimb:
Hi,

Finally got the raspberry pi, COC, and FHEM. And it's ll working very well...  Now I'm trying to get stuck into logic and more advanced stuff.

First task, I want FHEM to detect when I am home, or other people...

I have three devices, and have set presence command to ping them and it works fine.  However I want to integrate these three so at there is a dummy variable amhome that equals yes.  

I've defined a notify that watches the three presence commands and changes amhome when a device is there.
However, I want to build in some buffering... As pinging wifi devices is not continuous. This is where I am stuck.  

define xx watchdog amhome:yes 00:10:00 SAME set amhome NO

works but it only works once, it's state turns to triggered, and it no longer works again... I cant seem to reset it. Other attempts have also failed.  Any help would be appreciated...  

Cheers



andyclimb:

--- Zitat von: andyclimb schrieb am Fr, 01 März 2013 13:08 ---Hi,

Finally got the raspberry pi, COC, and FHEM. And it's ll working very well...  Now I'm trying to get stuck into logic and more advanced stuff.

First task, I want FHEM to detect when I am home, or other people...

I have three devices, and have set presence command to ping them and it works fine.  However I want to integrate these three so at there is a dummy variable amhome that equals yes.  

I've defined a notify that watches the three presence commands and changes amhome when a device is there.
However, I want to build in some buffering... As pinging wifi devices is not continuous. This is where I am stuck.  

define xx watchdog amhome:yes 00:10:00 SAME set amhome NO

works but it only works once, it's state turns to triggered, and it no longer works again... I cant seem to reset it. Other attempts have also failed.  Any help would be appreciated...  

Cheers




--- Ende Zitat ---

Markus Bloch:
Hello Andy,

once the watchdog is triggered, it need to be set to the state "defined" to be able to trigger again.


--- Code: ---setstate xx defined
--- Ende Code ---


Another watchdog example is to execute something after 15 minutes of absence:


--- Code: ---
define watchdog_Presence watchdog xx:absent 00:15 xx:present { fhem "set Light off";; fhem "setstate watchdog_Presence defined";;}
attr watchdog_Anwesenheit regexp1WontReactivate 1

--- Ende Code ---


also in this case, the watchdog needs to be resetted with the setstate command.

Hope this will help you.

Cheers
Markus

andyclimb:
Thanks that worked perfectly.

Cheers

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln