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

Posted
29 minutes ago, jgab said:

Livingbath_door:safe & (inlivingBathroom = true)

is the same as

if Livingbath_door:safe then inlivingBathroom = true end

So we set the variable inlivingBathroom to true if the door is safe.

 

The logic is that if the sensor is breached and the door is safe, then someone is in the bathroom and we set the variable so we don't turn off light even when if becomes safe again. We assume here that the sensor is inside the bathroom.

Got it .

 

Some of the logic dosent work for me....

 

  1. Works    Gå ind uden af lukke dør, Lys Tænder
  2. Works    Gå Ud uden af lukke dør, Lys Slukker
  3. Works    Gå ind OG lukke dør, Lys Tænder
  4. fails    Gå Ud OG lukke dør, Lys Slukker

 

So... 
If door is open AND light has been turned off from earlier triggers. Then you enter the bathroom. 
Close the door (you are inside)
Open the door (goes out)
Close the door (you are Outside)

Light newer closes.

 

 

 

Please login or register to see this code.

 

so when i expect the first true for rule to trigger as described above, it dosent, but second trueFor works.

Second Rule just posts the status from the 3 involved sensors, 

Please login or register to see this code.


 

  • Topic Author
  • Posted
    1 hour ago, ChristianSogaard said:

    Got it .

     

    Some of the logic dosent work for me....

     

    1. Works    Gå ind uden af lukke dør, Lys Tænder
    2. Works    Gå Ud uden af lukke dør, Lys Slukker
    3. Works    Gå ind OG lukke dør, Lys Tænder
    4. fails    Gå Ud OG lukke dør, Lys Slukker

     

    So... 
    If door is open AND light has been turned off from earlier triggers. Then you enter the bathroom. 
    Close the door (you are inside)
    Open the door (goes out)
    Close the door (you are Outside)

    Light newer closes.

     

     

     

    Please login or register to see this code.

     

    so when i expect the first true for rule to trigger as described above, it dosent, but second trueFor works.

    Second Rule just posts the status from the 3 involved sensors, 

    Please login or register to see this code.

     

     

    I don't think it should be Livingbath_door:value in the first rule. That is true if the door is open/breached.

    I think it should be Livingbath_door:isClosed

    Please login or register to see this code.

     

    The last rule is a bit tricky. It's meant to capture the case when we 

    1. open the door

    2. enters and breach the sensor

    3. close the door

    all within 3s

    4. Never moves again and never breach the sensor again. We are in and we want the inlivingbathroom to be true.

     

    I'm wondering if that one could go wrong, if we exit quickly....(?)

     

     

    When working with doors/windows is more readable to use :isOpen :isClosed instead of :value, :breached etc. even if  they are synonyms.

     

    Posted

    Hi jgab,

     

    Great job as usual. Thanks for your effort and willingness to share your work with the community.

    I have one question : do you intend to up-grade ER5 as to be able to support dimming lights with curves ? 

    I was using Util.dimLight function quite a lot with ER4 and now I am missing-it.

     

    Looking forward to receive your feed-back,

     

    With kind regards,

    Dan

     

  • Topic Author
  • Posted
    5 hours ago, Dann said:

    Hi jgab,

     

    Great job as usual. Thanks for your effort and willingness to share your work with the community.

    I have one question : do you intend to up-grade ER5 as to be able to support dimming lights with curves ? 

    I was using Util.dimLight function quite a lot with ER4 and now I am missing-it.

     

    Looking forward to receive your feed-back,

     

    With kind regards,

    Dan

     

    Yes, it's builtin with the <device>:dim={...} command.

    See discussion here

     

    Posted

    Hi jgab,

    Somehow I'm stuck and need help. I have the following rules.
    Now I want it so that when I turn on the light using the switch, it doesn't turn off automatically but only via the switch. But if I turned on the light and then the motion sensor is broken, the light turns off via the trueFor loop. What am I doing wrong?

     

    Please login or register to see this code.

    Thanks

    Posted
    14 hours ago, KaWi said:

     

    Please login or register to see this code.

     

    I'm not jgab but I would try moving your conditions relating to that override variable to the right side of the rule, e.g.

     

    Please login or register to see this code.

    (I think you can also write ... => !v_light_hall_eg_manu & lights_hall_EG:off but I'm not confident in that syntax..)

     

    You don't need it on the left because rules aren't triggered by variable changes so having it inside a trueFor is going to give you weird results (like if the value goes from true to false during the 45-second timer, it may not cause the timer to stop, the way that say the motion sensor getting breached would). 

     

    Alternatively, you can make child devices (binary switch type) for your overrides instead of using a variable. That gives the benefit, if you need it, of being able to manually toggle the override from something like a Home Remote panel, as well as getting visual feedback about whether the override is on. If you have no use for that though it's probably an unnecessary complication. 

     

     

     

    Posted

    Thanks @bonhomme for the tip.

    I've tried it. But unfortunately it doesn't work.

    Another idea of mine was to disable the rule to turn off as soon as the light is activated via the switch. So far, I have only been able to test with my rules for switching via the app. It works. Tonight I'm going to test it over the switch. I'm curious.

     

    Please login or register to see this code.

     

    The tip with a virtual device is just beyond my capabilities. I still have a lot to learn.😏

     

    Posted (edited)

    Already did some research but could not find the solution, the answer will be pretty simple but cannot find it.

     

    rule("@@00:00:05 => log(bk.vochtmeter:value)")

    rule("bk.vochtmeter:value > 80 => log('Moisture is high')")

     

    [18.02.2024] [13:37:21] [TRACE] [QUICKAPP302]: [Rule:3:181]>> TRUE #%interval%{id=3,_.. -> @@00:00:05 => log(bk.vochtmeter:value)

    [18.02.2024] [13:37:21] [DEBUG] [QUICKAPP302]: 95.0

     

    If the moisture (vochtmeter) is higher than 80, report Moisture is high. The rule is not triggered... Is the syntax not correct? I got other rules with Lux values but those work.

    Edited by Tree
  • Topic Author
  • Posted
    30 minutes ago, Tree said:

    Already did some research but could not find the solution, the answer will be pretty simple but cannot find it.

     

    rule("@@00:00:05 => log(bk.vochtmeter:value)")

    rule("bk.vochtmeter:value > 80 => log('Moisture is high')")

     

    [18.02.2024] [13:37:21] [TRACE] [QUICKAPP302]: [Rule:3:181]>> TRUE #%interval%{id=3,_.. -> @@00:00:05 => log(bk.vochtmeter:value)

    [18.02.2024] [13:37:21] [DEBUG] [QUICKAPP302]: 95.0

     

    If the moisture (vochtmeter) is higher than 80, report Moisture is high. The rule is not triggered... Is the syntax not correct? I got other rules with Lux values but those work.

     

    This should work. When you start the QA and the value is already 95.0 the rule will not be triggered.

    Only when it changes value and the HC3 generates an event.

    You can trigger it at startup with

    Please login or register to see this code.

     

    Posted

    That was it. Thanks for the explanation.

    Posted (edited)

    @jgab Hello Jan,

    Please login or register to see this code.

    doesn't work when using the new App. Do you have any clue what to do?

     

    I have tried it from a block scene, and then it worked.

     

    I think there are some new parameters added. If i remember correctly it was like

    Please login or register to see this code.

    and now the syntax is

     

    Please login or register to see this code.

     

    Edited by Neo Andersson
    Posted
    19 minutes ago, Neo Andersson said:

    @jgab Hello Jan,

    Please login or register to see this code.

    doesn't work when using the new App. Do you have any clue what to do?

     

    I have tried it from a block scene, and then it worked.

     

    I think there are some new parameters added. If i remember correctly it was like

    Please login or register to see this code.

    and now the syntax is

     

    Please login or register to see this code.

     

    there is one more boolean at the end

  • Topic Author
  • Posted
    2 hours ago, Neo Andersson said:

    there is one more boolean at the end

    Try this

    Please login or register to see this code.

    If it works I can patch the code so it is the default behaviour

  • Topic Author
  • Posted
    22 minutes ago, jgab said:

    Try this

    Please login or register to see this code.

    If it works I can patch the code so it is the default behaviour

     

     

    So at the moment

    fibaro.alert('simplePush', {[1] = 923, }, 'hello')
    works from scenes for me but not from QAs.
    'push' does not work in either scenes or QAs for me.
    The extra false arguments are strange/inconsistent as the device structure's action definition says it should only have one argument...

    Please login or register to see this image.

    /monthly_2024_02/image.png.3bb610b37257365e5e1d1db11969a900.png" />
    For some reasons they have different fibaro.*/hub.* api implementations for scenes and QAs and now they don't seem to do the same thing...
    Posted
    1 hour ago, jgab said:

     

     

    So at the moment

    fibaro.alert('simplePush', {[1] = 923, }, 'hello')
    works from scenes for me but not from QAs.
    'push' does not work in either scenes or QAs for me.
    The extra false arguments are strange/inconsistent as the device structure's action definition says it should only have one argument...

    Please login or register to see this link.

    For some reasons they have different fibaro.*/hub.* api implementations for scenes and QAs and now they don't seem to do the same thing...

    Yeah, doesn't work, even with the custom prop functoin added. How on earth should we compete with such an inconsistance in the system. OMG What to do now? How to fix this. I have so many places where push is used.

  • Topic Author
  • Posted
    11 minutes ago, Neo Andersson said:

    Yeah, doesn't work, even with the custom prop functoin added. How on earth should we compete with such an inconsistance in the system. OMG What to do now? How to fix this. I have so many places where push is used.

    Use another push service?

    Posted
    1 minute ago, jgab said:

    Use another push service?

    I dont know any. Som time ago, i used some service with help of Nodered, but never used anything direclty. I dont know any.

    Posted

    Since the push service sometimes stopped or changed I use besides push also telegram. So I don't notice push is out of sending messages.

    Perhaps better I remove them all. Telegram till now never stopped.

    Succes

  • Topic Author
  • Posted

    I've pushed v1.05 with a better hook for custom message functions

     

    Please login or register to see this code.

     

    If the function fibaro.customMessage(id, message) exists, it will be used instead of fibaro.alert

    I have provided a builtin function fibaro.pushoverMessage that uses the

    Please login or register to see this link.

    .

    Before calling the customMessage function it will map the fib userid to the message service user id

    using the table fibaro.customMessageIdMap. (it can also be a function fibId->msgId

    This means that you continue to send messages to "fibaro users", but of course the map could map any numbers...

     

    The message provided to the customMessage function can be anything the function understands.

    Please login or register to see this link.

     

    Please login or register to see this code.

     

    So, example to send a message with a title use

    Please login or register to see this code.

    and it seems that sound and html can be included too.

     

    The builtin pushover function uses my APP_Key and you should probably create your own if you are using it a lot

    and set fibaro.pushoverKey to it.

     

    Telegram has added some complexity but I'm looking at providing a similar function for it too.

    • 2 weeks later...
    Posted (edited)

    Related to an old post of mine

    Please login or register to see this link.

    , what would be the "ER5" or "best" way of doing:

     

    Can rule() detect hits to API end points (or functions defined inside the ER5 QA) ?

     

    rule(self:camera1_triggered => ... )

     

    It's almost like I need to define a virtual device and then reference that in my ER rules?

    Or just define a standard QA that responds to the camera breach/safe and then forward those on to an ER5 function?

    Use TriggerQA somehow?

     

    thx

    Edited by gurpal2000

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