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

Pls Help - New to Lua


Question

Posted

Hi I need our help ( Im new to Lua/HC2 )

 

Ive created VD to operate Aircon via Globalcache, and Id like to add into each of the buttons of the VD a "string" to set certain variable - So if I press "Heating 20C" button, the variable should be set to "H20" - I have no clue how to do it

Please login or register to see this image.

/emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

 

P.S.: The buttons so far are not in lua neither - do can you pls also advise how to chnge them into lua ? Basicaly the command is use so far is:

 

sendir,1:1,1,38554,1,1,367,171,21,65,20,23,20,23,20,23,20,65,20,23,20,23,20,23,20,23,20,23,20,23,20,23,20,23,20,65,20,23,20,23,20,23,20,65,20,23,20,66,20,23,20,65,20,23,20,23,20,65,20,65,20,23,20,65,20,3800,0x0D0x0A

 

 

Thanks a lot

 

4 answers to this question

Recommended Posts

  • 0
Posted

Hi,

 

Simple workaround for this issue is,

 

Create a button for your IR code (String). Hide this button from the interface.

 

Create another button "Heating 20C" and this button will call the IR code button AND set variable to "H20".

 

Hope it works for you.

 

Malvin

  • 0
  • Inquirer
  • Posted

    Thanks, this could be a solution, still wondering if it cant be part of the existing VD/Button - so hw to transform the String sending the IR to LUA and add the line to change a variable ?

     

     

    BTW: Is there a way how to send push notification automatically each time variable changes ? - Id like to have one variable ( being set by the upper LUA script ) and the moment it changes, Push wil sends its Value ?

     

     

    Sorry for the questions, but really new to HC2, so far having no clue about LUA.

     

    Thanks for your help

    • 0
    Posted

    Same button not possible as I have not tried using lua code to send ir codes before.

     

    Create a scene whenever your variable changes to something, send a notification with the value something.

     

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
  • Inquirer
  • Posted

    The point with the scene clear, but no clue how to LUA it - can you please send me an example ?

     

     

    Thanks a lot

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