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

The functions 

<ID>:thermostatSetpoint=<val>

<ID>:setThermostatMode=<val>
<ID>:setCoolingThermostatSetpoint=<val>
<ID>:setThermostatFanMode=<val>

 

work very well.  But these are for the action side of the rule.

 

I am trying to check if the AC is off for X minutes or if the Fan is set to High for example with a rule like:

 

rule("trueFor(00:01:00,(ACScara:thermostatMode=='Off')) => log('test OK')")
or
rule("trueFor(00:01:00,(ACScara:thermostatFanMode=='High')) => log('test OK')")
 
and the error i get is : 
 
[01.07.2021] [18:03:24] [ERROR] [QUICKAPP1312]: Error in 'trueFor(00:01:00,(ACScara:thermostatMode=='Off')) => log('test OK')': ./include/EventRunner.lua:1996: attempt to index a nil value (field '?')[01.07.2021] [18:03:24] [ERROR] [QUICKAPP1312]: main() error:./include/EventRunner.lua:2308: Main() ERROR:./include/EventRunner.lua:2143: ./include/EventRunner.lua:1996: attempt to index a nil value (field '?')
 
I have no idea why, but my guess is that it does not see this device interfaces.
 
The swagger for this device is:
 

Please login or register to see this code.

 

 

Link to comment
Share on other sites

  • Topic Author
  • 14 hours ago, Momos said:

    The functions 

    <ID>:thermostatSetpoint=<val>

    <ID>:setThermostatMode=<val>
    <ID>:setCoolingThermostatSetpoint=<val>
    <ID>:setThermostatFanMode=<val>

     

    work very well.  But these are for the action side of the rule.

     

    I am trying to check if the AC is off for X minutes or if the Fan is set to High for example with a rule like:

     

    rule("trueFor(00:01:00,(ACScara:thermostatMode=='Off')) => log('test OK')")
    or
    rule("trueFor(00:01:00,(ACScara:thermostatFanMode=='High')) => log('test OK')")

     

    v0.5fix64 pushed.

    The set functions (actions) are now

    Please login or register to see this code.

    Note that I removed the prefix "set" from some of the functions - cleaner this way.

     

    Access functions that are available now (yes, there was a bug)

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    @jgab  Thank you very much :) 

     

    unfortunatelly still does not work. I have updated to latest version

     

    My rules are

     

    Please login or register to see this code.

     

    and the log:

     

    Please login or register to see this code.

     

    Simple test rules, rule 8 triggers, rules 9 and 10 do not do anything.

     

    Thank you again ?

    Link to comment
    Share on other sites

  • Topic Author
  • 22 minutes ago, Momos said:

    @jgab  Thank you very much :) 

     

    unfortunatelly still does not work. I have updated to latest version

     

    My rules are

     

    Please login or register to see this code.

     

    and the log:

     

    Please login or register to see this code.

     

    Simple test rules, rule 8 triggers, rules 9 and 10 do not do anything.

     

    Thank you again ?

    Rule 10 seems to not be compiled and is thus not installed.

    Please login or register to see this code.

    Check if you have some invisible characters around the "=>". Rule 9 compiles and I copied both rules to my emulator and they compile there too.

     

    So I did some tests with a false thermostat QA and it works quite well for me. 

    Note that rules are only triggered when the thermostat change the property value that you use in the test.

    A "trueFor" rule will not start to watch the property until the property changes value.

    However, you can force the rule to run when it is defined by adding .start()

    Ex.

    rule("trueFor(00:01:00,(ACScara:thermostatMode=='Off')) => log('test 2 OK')").start()
    rule("trueFor(00:01:00,(ACScara:thermostatFanMode=='High')) => log('test 3 OK')").start()

    That causes the rule to be triggered when the QA starts up and if the ACScara:thermostatMode is 'Off' the trueFor will start monitoring the property. Note that the time is measured from when the rule triggers so if the thermostatMode property has been off for a long time it only counts from when it is triggered.

     

    • Like 1
    Link to comment
    Share on other sites

    rule("trueFor(00:30,(3:alarm.armed == false) => 2:msg=log('Alarm dismarmed for 30 minutes    '); again()").start()

     

    What should be the correct syntax for the above rule? Is it even possible to use "trueFor" to check how long the alarm is disarmed?

    Link to comment
    Share on other sites

    Jan,

    In Children of HUE (I have V1.17) I dont hope I missed a version?

    I still have screen full of see below and my CPU has an extra load of 30%

    CAn you fix or do I need  something to change?

    I want to use the option Lights off/on

    Please login or register to see this attachment.

    Thanks for your service and time,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 43 minutes ago, michal85pl said:

    rule("trueFor(00:30,(3:alarm.armed == false) => 2:msg=log('Alarm dismarmed for 30 minutes    '); again()").start()

     

    What should be the correct syntax for the above rule? Is it even possible to use "trueFor" to check how long the alarm is disarmed?

    Well, use the property :armed directly on the partition

    Please login or register to see this code.

     

    11 minutes ago, Sjakie said:

    Jan,

    In Children of HUE (I have V1.17) I dont hope I missed a version?

    I still have screen full of see below and my CPU has an extra load of 30%

    CAn you fix or do I need  something to change?

    I want to use the option Lights off/on

    Please login or register to see this attachment.

    Thanks for your service and time,

    //Sjakie

     

    In main() do

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Jan

    [02.07.2021] [12:44:21] [ERROR] [QUICKAPP1498]: main.lua:23: attempt to index a nil value (global 'self')

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, Sjakie said:

    Jan

    [02.07.2021] [12:44:21] [ERROR] [QUICKAPP1498]: main.lua:23: attempt to index a nil value (global 'self')

    You need to do it inside function QuickApp:main() where you have your rules

    Link to comment
    Share on other sites

    Jan excuse me

    QA 1498 is Children of Hue

    the error is from 1498 so I added in main QA 1498 line 23 >>

    Please login or register to see this code.

    Link to comment
    Share on other sites

    I dont have rules in Children of HUE

    If I add in QA where HUE is used error in 1498 stays

    Link to comment
    Share on other sites

  • Topic Author
  • On 7/2/2021 at 12:50 PM, Sjakie said:

    Jan excuse me

    QA 1498 is Children of Hue

    the error is from 1498 so I added in main QA 1498 line 23 >>

    Please login or register to see this code.

    ChildrenOfHue is not ER so this is the wrong thread...

    Anyway, here is 1.19 that turns of propwarn and with new btn handlers 

     

    Please login or register to see this attachment.

    Edited by jgab
    Link to comment
    Share on other sites

    Sorry Jan to post in wrong topic.

    Thanks error is not showing anymore.

    Children of HUE V1.18

    Lights off>>works

    Lights On >> Nothing happens

     

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • How does the rule look like where you do On ?

    Link to comment
    Share on other sites

    Jan, in Edit/Preview we have buttons

    Lights On>>> press>>>action is called  in Debug nothing.

    If I switch some HUE lights on and push Lights Off >>>all lights switch off

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 4 minutes ago, Sjakie said:

    Jan, in Edit/Preview we have buttons

    Lights On>>> press>>>action is called  in Debug nothing.

    If I switch some HUE lights on and push Lights Off >>>all lights switch off

    //Sjakie

    Ok, I have never used that button :-) Sure you want to turn on all lights?

    Anyway, that button was configured wrong.

    If you go into the QA editor and press the 'Lights On' button you see that the 'onReleased' field says 'allLightsOffClicked'

    Change that to 'allLightsOnClicked'

    Link to comment
    Share on other sites

    Jan,

    Yes I want all lights on >>> if alarm=true

    Shoot me

    If I change>>save >>push Lights Off>>>push Lights On>>>it will show again old value!

    In control:

    allLightsOn>>>>>must be On too I asume? Doest matter in both cases it happens

    Lights On

    allLightsOnClicked

    Please login or register to see this image.

    /monthly_2021_07/afbeelding.png.47ccc83a0528fd65d96ca8aef7a85ec1.png" />

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, Sjakie said:

    Jan,

    Yes I want all lights on >>> if alarm=true

    Shoot me

    If I change>>save >>push Lights Off>>>push Lights On>>>it will show again old value!

    In control:

    allLightsOn>>>>>must be On too I asume? Doest matter in both cases it happens

    Lights On

    allLightsOnClicked

    Please login or register to see this link.

     

    allLightsOnClicked

    with a capital 'C'.

    Yes, and press save.

    Link to comment
    Share on other sites

    sorry had allready C

    its saved but lights doest switch on or off now

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