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

  • Topic Author
  • 19 minutes ago, Sjakie said:

    @Joel,

    I use  this QA (also from JGab) and its doing what isnecessary.

    //Sjakie

    The commands supported (like to set colors) are listed here

     

    Link to comment
    Share on other sites

    thanks @jgab @Sjakie

     

    I'll have a play, I was hoping to use the Hue All in one QA, purely because I can trigger the built in hue scenes. I was assuming it would be simple matter of adding the fibaro call to that QA into the ruleset:

     

    Please login or register to see this code.

     but I get an error, which seems to be complaining that it needs a string, not a number

     

    [ERROR] [QUICKAPP130]: in Rule:9[BATH_Motion:breached => fibaro:call(HUE_Main, "HueCommands", {type='Hue', action...]: ./include/EventRunner.lua:1953: ./include/EventRunner.lua:270: Wrong parameter type, string required. Provided param '175' is type of number[22.02.2022] [12:59:00] [ERROR] [QUICKAPP153]: Unknown error occurred:

    Link to comment
    Share on other sites

  • Topic Author
  • fibaro.call is with a ‘.’ on the HC3. Not ‘:’

    Link to comment
    Share on other sites

    17 minutes ago, jgab said:

    fibaro.call is with a ‘.’ on the HC3. Not ‘:’

     

    Thanks, I must have been looking at ER3 examples

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 19 hours ago, kallecux said:

    Sorry, but i will not work:

     

    This is the QA:

     

    Please login or register to see this attachment.

     

    and this is the rule log:

     

    Please login or register to see this attachment.

     

    and yes, there are many logs after your debug-hint, but no one from device 810.

     

    Greetings.

    Karl Heinz 

    That is a mystery. 
    I haven't been able to try exact your code - will see if I have the time tonight.
    Instead of the sleep loop have you tried

    Please login or register to see this code.

    ...just thinking if there is some issue with not giving background time to the QA...

    Link to comment
    Share on other sites

    Guest kallecux

    I have two other binary sensors (787 und 788) and i made some tests and i THINK that there is NO event, when changing the log.

     

    These are the ER4 rules:

     

    Please login or register to see this spoiler.

     

    Greetings

    Karl Heinz

     

    P.S.

    I changed the code to:

     

    function QuickApp:onInit()    

       print("Bin da")    

       setInterval(function() self:updateProperty("log",os.date("%S")) end,3000)

    end

     

    but no reaction in the ER4 log.

    Edited by kallecux
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, kallecux said:

    I have two other binary sensors (787 und 788) and i made some tests and i THINK that there is NO event, when changing the log.

     

    These are the ER4 rules:

     

    Please login or register to see this spoiler.

    ...I think I know what's going on - let me run some tests tonight and I will be back. 

    Link to comment
    Share on other sites

  • Topic Author
  • Ok, Its'a problem with fibaroextra that ER uses.

    Actually, for some reason the log property is not reported in the usual way like other property changes - instead it's reported in the .changes files the state returned by /refreshStates.

    It means some extra coding to lift that event so it's visible to ER.

    I will try to find some time tomorrow to code it.

    It means that there will also be a new version of ER4 to support the new event.

    Link to comment
    Share on other sites

  • Topic Author
  • Ok, I fixed the log issue.

    It will appear as a device event with property 'log'.

    #device{id=<id>, property='log', value='...'}

     

    New version of ER4 (0.77) 

    New version of fibaroExtra.lua (0.934)

    New version of TQAE emulator.

    Link to comment
    Share on other sites

    Guest kallecux

    Hi @jgab it works! Thank you very much for your work and your support! 

    Have a good time!

    Greetings Karl Heinz 

    Link to comment
    Share on other sites

    • 2 weeks later...

    Hello Jan,

    How can I send 

    Please login or register to see this code.

    to Nodered?

    Or must I ask how to import this post into Nodered?

    //Sjakie

    Link to comment
    Share on other sites

    Hi Jan,

    Thanks again for a great QA.

    I have run into a problem with a trigger from a tibber QA, that the value is "CHEAP", "NORMAL" with "" in the value can i somehow use like /" to escape in your rules?

    Link to comment
    Share on other sites

  • Topic Author
  • Single quotes also works for strings.

    '' == ""

    rule("77:value=='' => log('Value is empty string')")

     

    Link to comment
    Share on other sites

    yeah but the this is the value contains " " so the rule would be like

    rule("77:value=='"CHEAP"' => log('Value is "CHEAP"')")

    Link to comment
    Share on other sites

  • Topic Author
  • 30 minutes ago, Qwerty1979 said:

    yeah but the this is the value contains " " so the rule would be like

    rule("77:value=='"CHEAP"' => log('Value is "CHEAP"')")

    Ok, now I understand what you mean. I bit strange though that the value is quoted.

    Anyway, either

    rule("77:value=='\"CHEAP\"' => log('Value is \"CHEAP\"')")

    or use [[ ... ]] as outer quotation for the rule string

    rule([[77:value=='"CHEAP"' => log('Value is "CHEAP"')]])

    Link to comment
    Share on other sites

    Thanks Jan it worked great.

    rule([[$tibber_currentLevel_410=='"CHEAP"' => log('Tibber level is "CHEAP"');49:msg = log('Tibber level is now CHEAP')]])
    • Like 1
    Link to comment
    Share on other sites

    Hello Jan,
    can you help me finding right notation for rules in reference to keyfob?
    example like this brings error:

     

    LiDeckeWZ = 407
    --EG1
    rule("KF_LiSchFluerEG:central.keyId==2.keyAttribute='Pressed' => LiDeckeWZ:toggle")
    --EG2
    rule("KF_LiSchFluerEG:central.keyId==2.keyAttribute==Pressed => LiDeckeWZ:toggle")

    Thanks in advance!
    Link to comment
    Share on other sites

  • Topic Author
  • 22 hours ago, Speedo67 said:

    Hello Jan,
    can you help me finding right notation for rules in reference to keyfob?
    example like this brings error:


    Thanks in advance!

     

    The correct  way is to check each field separate (keyid and keyAttribute) with an AND '&' between them

    Please login or register to see this code.

     

    It's a bit repetitive and  verbose so I usually make a special rule for the keyfob  that reposts the event as a #keyFob event where the keyAttribute and keyId is concatenated.

     

    Please login or register to see this code.

     

    It also makes it easy to "fake" a key fob press to toggle the device automatically

    Ex.

    rule("@sunset+00:10 => post(#keyFob{value='Pressed2'})") --  Toggle device 10 past sunset...

    Edited by jgab
    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...