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

Help with LUA


Anth

Question

Hi,

 

So I have the following LUA scene:

 

Please login or register to see this attachment.

 

So it is looking at the AV rack and sending me a notification when the temp in my AV rack is hotter than the previous MAX value.

 

I have two questions:

1. I would expect that this scene is triggered all the time as my temp (device 42) is greater than 20 degrees all the time.

    When I go to the debug screen though my de-bug messages are only being shown when the if statement in the actions becomes true.

    I should also be getting the push notification every time - but I don't.

    Can any one tell me why the scene appears to only be triggered when the IF statement is true in the actions?

 

2. I actually want the trigger to be when the temp sensor is greater than the RackMAX global variable.

     Being new to LUA I'm not sure of the syntax. Could anyone help me with the code?

 

Thanks,

 

Anth

 

 

 

 

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
1 hour ago, Anth said:

Hi,

 

So I have the following LUA scene:

 

Please login or register to see this attachment.

 

So it is looking at the AV rack and sending me a notification when the temp in my AV rack is hotter than the previous MAX value.

 

I have two questions:

1. I would expect that this scene is triggered all the time as my temp (device 42) is greater than 20 degrees all the time.

    When I go to the debug screen though my de-bug messages are only being shown when the if statement in the actions becomes true.

    I should also be getting the push notification every time - but I don't.

    Can any one tell me why the scene appears to only be triggered when the IF statement is true in the actions?

 

2. I actually want the trigger to be when the temp sensor is greater than the RackMAX global variable.

     Being new to LUA I'm not sure of the syntax. Could anyone help me with the code?

 

Thanks,

 

Anth

 

That's the way it works - the conditions is the like "IF" statement.

 If you need your scene to be triggered on any change set

operator="anyValue"

and remove 

value=20

 

Now in your scene you can test the value and if it's greater than 20 do what ever you need.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 21 hours ago, cag014 said:

    That's the way it works - the conditions is the like "IF" statement.

     If you need your scene to be triggered on any change set

    operator="anyValue"

    and remove 

    value=20

     

    Now in your scene you can test the value and if it's greater than 20 do what ever you need.

     

    Hi,

     

    I understand that bit. The issue I have is that the scene was only running the action when the temperature was greater than the global variable. Because this was in the actions part of the script (rather than the conditions) I would expect that this should have no affect on the triggering of the scene (i.e. running the action).  If this is correct - I should have been getting continuous entries on the debug screen but I only received entries when the temp was greater than the global variable.

     

    In addition to that - I am wondering how I would change the conditions for the scene trigger.

    I have the temperature being compared to a set value (20 degrees). IS there a way to change this so the temperature is compared to a variable?

     

    Thanks again,

     

    Anth

     

     

     

     

     

    Link to comment
    Share on other sites

    • 0

    No way to use variables in conditions, but as I said you can compare the temperature value to the global inside your code.

     I don't want to sound like I am trying to advertise my program, but please give a try to  

    Please login or register to see this link.

    at download center - it could help in many cases instead of running endless scene with conditions...

    ?

    Edited by cag014
    Link to comment
    Share on other sites

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