Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
rickydehaas 4
Hi All,
Desperately need your help with the following:
I'm trying to accomplish to send a pushmessage to my in-wall dashboards when motion is detected. After motion is detected the scene needs to check every 10 min if the motions lastBreached is lower then 30 min and send the pushmesssge again until lastBreached is more then 30 min
This is what i have so far:
--[[
%% properties
203 value
%% weather
%% events
%% globals
USBWKScreen
--]]
if (fibaro:countScenes() >1)
then
fibaro:abort();
end
-- Local
local hc=fibaro;
local StartSource=hc:getSourceTrigger();
local iosDeviceID = {43}; -- inwall dashboards
local motionID = {203}; -- PIR sensors
local movement = 600; -- 10 min
local screen = "USBWKScreen"; -- variabele
local screenMapping = {On="Aan", Off="Uit"};
-- Send notification to devices
function setScreenOn()
if(#iosDeviceID > 0)
then
for i = 1, #iosDeviceID do
hc:call(iosDeviceID, "sendPush", "ScreenOn");
hc:debug("Message send to device - "..iosDeviceID);
end
else
hc:debug(" No devices found");
end
end
-- Main
if(hc:getGlobalValue(screen)==screenMapping.On)
then
for i=1,#motionID do
if ( (tonumber(os.time()) - tonumber(fibaro:getValue(motionID, "lastBreached"))) < tonumber(movement) )
then
setScreenOn();
else
hc:debug("Scene runned")
end
end
else
hc:debug("Scene runned"))
end
Thanks in advance!
Edited by rickydehaas5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.