Jump to content

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


Recommended Posts

Posted

this is my script for now

 

Eye = function()
local name_eyes, eyes; 
for i=1, #ID_eye do 
eyes = tonumber(ID_eye); 
name_eyes = fibaro:getName(eyes); 
armed_eyes = fibaro:getValue(eyes, "armed")
value_eyes = fibaro:getValue(eyes, "value")
if armed_eyes == "0"
    then status_eyes = "disarmed"
    else status_eyes = "armed"    
end
if value_eyes == "0"
      then move_eyes = "no movement"
      else move_eyes = "movement"
end
if (name_eyes == nil or name_eyes == string.char(0)) then 
name_eyes = "Unknown" 
end 
DebugGreen("Device:"..name_eyes.." "..status_eyes.." "..move_eyes); 
end
end
 
i get nicely al the Fibaro-eyes and says if the are armed or not and if there i movement or not.
 
can i get a total of eyes where movement is like a count or something
like de debug is then. There are 4 eyes whit movement.
 
thanks
 
 
 
Posted

Someting like this?

Please login or register to see this code.

  • Topic Author
  • Posted

    Thanks, but then i get just a value of the last eye in the table and not the total of all the eyes together

    i did it simmalary whit a count get the same result.

    Posted

    I just created some test code, but it is giving me the count:

    Please login or register to see this code.

    I armed 3 of them and that was also displayed.

     

    Can you share your whole code?

  • Topic Author
  • Posted

    Oeps, neatly cut and paste is also an art  

    Please login or register to see this image.

    /emoticons/default_icon_razz.gif" alt=":-P" />

     

    now i now what i did ronge whit count, did not tostring()

     

     

    thanks a lot 

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />  

     

    i am trying to make a script for fire to make a path. where there is no fire the lights go on and blinds and door are open

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...