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
Juanjo 1
Hi,
I am trying to gradually migrate my scenes in LUA HC2 to LUA HC3 and I am having some doubts/problems:
How I can make a scene that always is running, for example, this infinity loop that checks if the door is open:
HC2:
if (fibaro:countScenes() > 2) then
fibaro:abort()
fibaro:debug ('There is a other scene running')
end
local startSource = fibaro:getSourceTrigger();
while true do
--Check door open
if
( tonumber(fibaro:getValue(125, "value")) > 0 )
then
fibaro:call(234), "sendPush", "Door open");
end
fibaro:sleep(15*60000) --repeat each 15 minutes
end
HC3 (propose with errors):
Condition:
{
conditions = {
{
type = "se-start",
property = "start",
operator = "==",
value = true,
isTrigger = true
}
},
operator = "all",
}
Action:
while true do
--Check door open
if
( tonumber(fibaro:get(125, "value")) > 0 )
then
fibaro.alert('push', {[1] = 234, }, 'Door open')
end
fibaro:sleep(15*60000) --repeat each 15 minute
end
It gives me this error:[03.11.2020] [21:43:29] [ERROR] [SCENE103]: (load):2: Assertion failed: Expected number
any idea where the problem is?
Thanks!
7 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.