Use your Mother and a motion cookies to track presence at home.



Setup the presence app on your senseboard on website.
Presence at home
On your Fibaro HomeCenter 2 unit, add a new LUA scene. Add this code into the scene.

%% autostart
%% properties
%% globals

 Mother and moion cookies scene by Jonny Larsson (jompa68)

 An presence scene that use a cookies to track when arrive or leave home
 and set a global variable with the actual value, then you can use the
 variable as trigger to do other things with your HC2 like turnOn a lamp,
 turnOff alarm etc.
 Scene will run every 30 seconds.
 Change this to rows:
 local cookiePresence = 'D6se3zRof0bAB5Mxxxxxxxxxxxxxxxx' <--- id of cookie
 ['Authorization'] = 'Basic xxxxxxxxxxxxxxxx' <--- encoded user and password for login

 2015-02-19 version 0.1

local sourceTrigger = fibaro:getSourceTrigger();
function tempFunc()
local currentDate ="*t");
local cookiePresence = 'D6se3zRofxxxxxxxxxxxxxxxx'
local httpClient = net.HTTPClient();

 httpClient:request(''..cookiePresence..'/events/?limit=1&format=json', {
 success = function(response)
 if tonumber(response.status) == 200 then

 local jsonData = json.decode(
 local total=0
 for i = 1, #jsonData.objects do
 if jsonData.objects[i].profile == 'WalkStandard' then
 if string.sub(jsonData.objects[i].dateEvent,1,10) =="%Y-%m-%d") then
 presence = jsonData.objects[i].data.body
 print('Presence: '..presence)
 fibaro:call(423, "setProperty", "ui.lblPresence.value", presence)
 fibaro:setGlobal("cookie_Jonny", presence)
 print('call::checkUpdate ERROR [HTTPClient:request] status: ' .. response.status)
 options = {
 headers = {
 ['Authorization'] = 'Basic xxxxxxxxxxxxxxxxxxxx'

setTimeout(tempFunc, 30*1000)
if (sourceTrigger["type"] == "autostart") then
 fibaro:debug("Set scene to %%autostart to have it run by automatic")

The scene will update a global variable with actual presence value. Variable can be used in other scene as trigger and for example turnOn or turnOff a lamp, start or stop a alarm scene.  It is also possible to update a virtual device label.

mother motion cookie value