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


Question

Posted (edited)

In the absence of any offical Fibaro E learning on VDs can someone post a really simple VD to fill my knowledge vacum.

Something that shows the relationship between VD created button presses and their triggers ie button triggering scene, button changing state of variable

And changing state of modules  and variables and ther relationship to changed state of indication on VD buttons.

Ive tried looking at posted VDs but many get a bit complex for newbie.

A tutorial on this would be helpful for me and many others in the future.

Thanks

 

 

Edited by Jamie mccrostie

Recommended Posts

  • 0
  • Inquirer
  • Posted
    4 hours ago, AutoFrank said:

     

    @Jamie mccrostie

     

    I got it running. small error in Line 22 (incorrect variable faultRelay instead of pumpFaultRelay)

    it should be  - 

    Please login or register to see this code.

    I'm not sure I understand how the overall solution concept is to work ...

    Could you explain the variables (pumpRunRelay, pumpFaultRelay, pumpFaultReset, pumpStartRelay)

    Are they all switches/relays ?

    Whats the difference between pumpRunRelay and pumpStartRelay ?

    Whats the purpose of FaultReset or FaultReset

     

    thanks

    f

     

     

     

     

     

     

    @Jamie mccrostie

     

     

     

    Opps missed your line "got it running" sorry will test

    ta

    • 0
  • Inquirer
  • Posted
    2 hours ago, AutoFrank said:

     

    @Jamie mccrostie

     

    yep, that makes sense..

    .. and I think it's always good to start on challenge that has a real life connection even if it won't end up being used

     

    Do you think you have a better idea of how the code and HC2 work now ?

     

    Thankyou

    Success... What a great exercise, all I can say is bring on spell check in LUA. All typos

    This game, you could be a full stop or a million miles away from sucess.

     

    This has really helped me Frank, to see how the functions fit into the script and the use of remote states of devices to change vd labels etc. I now can see now how debug can be used not only to see if main loop doesnt throw fault debug but gives you  a log on actions as they happen to fault find whole solution

    Next stop Im ordering a UBS and probe to play with.

    I also see your tutorial is up to 97 views which is also good to see.

     

    Hope  you dont mind me throwing a "basic scene layout and function tutorial for dummies" request. 

    I know fibaro uk have this but is done a bit in advanced "speak".

    It would make a difference for those of us who havent had progaming experience from making the move from "copy and paste junkies" and "fill in your id heros " to

    Real coders.

    I also think this forum needs Tutorial sub header may be under 'community support' so all this stuff is easier to find.

    Keep up the good work and thanks for giving you time to others so freely.

    cheers

    jamie

    • 0
  • Inquirer
  • Posted
    6 hours ago, AutoFrank said:

    thanks

     

    Also when you have a VD button like the one "set status to running" pressed

    and you also have the remote device, both trying to changing global state  which one takes over or does it toggle as button pressed?

     

    • 0
    Posted
    13 minutes ago, Jamie mccrostie said:

    Thankyou

    Success... What a great exercise, all I can say is bring on spell check in LUA. All typos

    This game, you could be a full stop or a million miles away from sucess.

     

    This has really helped me Frank, to see how the functions fit into the script and the use of remote states of devices to change vd labels etc. I now can see now how debug can be used not only to see if main loop doesnt throw fault debug but gives you  a log on actions as they happen to fault find whole solution

    Next stop Im ordering a UBS and probe to play with.

    I also see your tutorial is up to 97 views which is also good to see.

     

    Hope  you dont mind me throwing a "basic scene layout and function tutorial for dummies" request. 

    I know fibaro uk have this but is done a bit in advanced "speak".

    It would make a difference for those of us who havent had progaming experience from making the move from "copy and paste junkies" and "fill in your id heros " to

    Real coders.

    I also think this forum needs Tutorial sub header may be under 'community support' so all this stuff is easier to find.

    Keep up the good work and thanks for giving you time to others so freely.

    cheers

    jamie

     

    @Jamie mccrostie

    no worries - we all started somewhere and nobody was a HC2 expert out of the box, at least not me.I got a lot f help when I started out and this is my opportunity to give back a little. ( another thin to watch is variables upper/lower case, better to always match in a script as in some places it needs to be the same and it's a good habit to get into to ) 

     

    I'll take on the challenge on the scene tutorial, I also have a few things to add to the VD one like main and favorite for the buttons.

     

    There is a crowd solutions section to the forum but I don't post there as anything posted there needs to be approved by admins and that can take a while sometimes. Doing a search for Tutorial  will find everything no matter where its posted

     

    anyway best of luck with the coding and look for the scenes and posts by the likes of @petergebruers, @Sankotronic, @jompa68, @chaicka to name but a few as they are mines of information ... :-)

     

     

     

     

     

    • 0
  • Inquirer
  • Posted (edited)

    Hey @AutoFrank

    Sorry to bring up this "old chestnut" again. Ive been using these tutorial and your other tutorial skills on a couple of jobs now all good.

    I have a similar situation to pump panel we used as example and would like to know what code in main loop to send email only once on change of global or local v. You mentioned it could be achieved thru the right "if this then that"code being used.

    Ive also been playing with pushover and would be interested in this message also. Can this work in VD? Would you add locals in main loop + the set global command as in your pushover tutorial?

     Your example you have used there is a scene.

    Thanks for your help and looking forward to future tuts

    Jamie

    Edited by Jamie mccrostie
    • 0
    Posted
    12 hours ago, Jamie mccrostie said:

    I have a similar situation to pump panel we used as example and would like to know what code in main loop to send email only once on change of global or local v. You mentioned it could be achieved thru the right "if this then that"code being used.

     

    @Jamie mccrostie

    As you know the main loop code runs continuously any action will be executed repeatably.

    I don't know of any way other that using a reference external to the VD and using a simple global variable would work

     

    create a global variable called counter

    Place the following in the main loop

    Please login or register to see this code.

    when you run it first counter = 0 and the inner loop with the send email will run

    After that counter = 1 and the inner loop wont run again until you set the counter = 0

     

    for the example create a button with the following

    Please login or register to see this code.

     This will allow you to reset the counter to 0 and send the email (+other actions again)

     

    In reality you'll need to figure out under what conditions you want the inner loop to run again include the reset of the counter within that

     

    make sense ?

     

     

     

     

     

     

    • 0
    Posted
    13 hours ago, Jamie mccrostie said:

    Can this work in VD? Would you add locals in main loop + the set global command as in your pushover tutorial?

     Your example you have used there is a scene.

     

    @Jamie mccrostie

     

    this seems like a few questions.. could you break them out and add more context and I can try and help

     

    -f

    • 0
  • Inquirer
  • Posted
    8 hours ago, AutoFrank said:

     

    @Jamie mccrostie

    As you know the main loop code runs continuously any action will be executed repeatably.

    I don't know of any way other that using a reference external to the VD and using a simple global variable would work

     

    create a global variable called counter

    Place the following in the main loop

    Please login or register to see this code.

    when you run it first counter = 0 and the inner loop with the send email will run

    After that counter = 1 and the inner loop wont run again until you set the counter = 0

     

    for the example create a button with the following

    Please login or register to see this code.

     This will allow you to reset the counter to 0 and send the email (+other actions again)

     

    In reality you'll need to figure out under what conditions you want the inner loop to run again include the reset of the counter within that

     

    make sense ?

     

     

     

     

     

     

     

    Somthing for me to chew on thanks Frank

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