Presence detection

Begonnen von andyclimb, 01 März 2013, 13:08:08

Vorheriges Thema - Nächstes Thema

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



AM

andyclimb

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

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



AM

Markus Bloch

Hello Andy,

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

setstate xx defined

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


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


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

Hope this will help you.

Cheers
Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

andyclimb

Thanks that worked perfectly.

Cheers
AM