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


  • 0

[Virtual Device] Toggleswitch, change status global variable


Question

Posted

This is my first programming effort to create a Virtual Switch to toggle a global variable which I use to 'arm' my IP-camera on my balcony.

It works but maybe you got comments. Please do!

Please login or register to see this image.

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

Global Variable:

BalkonBew_AU - with value '0' and '1'

Main Loop

Please login or register to see this code.

1 button Label: Aan/Uit (means On/Off) ID: button_0_0

Please login or register to see this code.

Label1 Label: Balkonbewaking (means Balconysecurity) ID: Label1

Please login or register to see this attachment.

9 answers to this question

Recommended Posts

  • 0
Posted

in Main Loop use fibaro:sleep, for better performance

  • 0
  • Inquirer
  • Posted
    in Main Loop use fibaro:sleep, for better performance

    Can you give me full command and place to insert, please?

    • 0
    Posted

    that will give you 10s pause

    Please login or register to see this code.

    but you can do that code in other way

    • 0
    Posted

    Put fibaro:sleep(60000) at the end of your main loop script ;/), loop refresh every minutes with 60000

    [ Added: 2013-09-09, 23:05 ]

    Sorry A.Socha

    Please login or register to see this image.

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

    • 0
  • Inquirer
  • Posted

    Thanx guys!

    Updated my first posting.

    • 0
    Posted
    in Main Loop use fibaro:sleep, for better performance

    Hi all,

    Just for clarification, that means calls to main loop are not stacked !!!

    I understood that main loop was called each second some there is no problem to call the sleep command into a procedure that is called each second ?

    Thanks

    David

    • 0
    Posted

    yes, next loop will start when last loop will end, so it will not be every 1s, but every time what you will use in sleep

    • 0
    Posted

    Thanks...This is an important information

    I have 2 virtual devices that request ethernet cards but it take some seconds before receiving the result. These devices seem to be on standby sometime so I thought it was because of the call each second to the main loop

    • 0
    Posted

    I need help please.

    I tried to modify the VD from Lambik and make a simple VD to see the status of the kitchen TV depending on a global variable:

    Value 1: TV ON

    Value 0: TV OFF

    The status should be updated only if the global variable changes and not check the variable each e.g. 10 sec.

     

    ...but without success

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" />

     

    My problems are:

    1) the lable don't change

    2) the status will be chacked each 10 sec.

    3) the status text appears only for a short time

     

     

     

     

     

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Join the conversation

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

    Guest
    Answer this question...

    ×   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...