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
  • 9 hours ago, edwink023 said:
    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    First off @jgab you are a genius.

    You made my first experience with home automation a whole lot easier, if there is a way to buy you coffee or something stronger like whiskey let me know.

     

    Iam started to automate my home, first off is the lighting and for now I have a small setup like i want with as few interaction with me and the system as possible.

    I still get an error sometimes and I think it has to do with my rule when I control my lght manually but cannot figure it out yet.

    in Rule:4[trueFor(time,229:safe) =>  208:off; time=00:20:00]: ./include/EventRunner.lua:1954: ./include/EventRunner.lua:1755: attempt to perform arithmetic on a nil value (local 'time')

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    The error with "local time being nil"  is probably because because the 'time' given to trueFor is nil.

    Is it a version of the code I posted earlier where you should have used Util.defTriggerVar to define 'time'?

    Otherwise post the whole rule(s) and I can have a look at it.

     

     

    9 hours ago, edwink023 said:

    Read somewhere that you can color the debug lines but I cannot find it anymore (read so many pages) can you plz point me in the right direction.

     

    rule("now => log('This is #C:red#ABCDEFG')")

    You can only have one color  per line and it starts with the #C:...# directive.

    @Sjakie is a frequent user of this - maybe he has some tips.

     

    9 hours ago, edwink023 said:

     

    And I have the following rule when I turn of my hue light (180,203,175)of I want to turn of the main light but cannot figure it out.

    rule("207:scene ==  21.single   =>  {180,203,175}:on ; 208:off")

    also tried the follow 

    rule("207:scene ==  21.single   =>  {180,203,175}:on & 208:off")



     

    Is 208 your main light?  and 208:off doesn't work?

    Link to comment
    Share on other sites

  • Topic Author
  • 9 hours ago, edwink023 said:
    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    First off @jgab you are a genius.

    You made my first experience with home automation a whole lot easier, if there is a way to buy you coffee or something stronger like whiskey let me know.

     

    Iam started to automate my home, first off is the lighting and for now I have a small setup like i want with as few interaction with me and the system as possible.

    I still get an error sometimes and I think it has to do with my rule when I control my lght manually but cannot figure it out yet.

    in Rule:4[trueFor(time,229:safe) =>  208:off; time=00:20:00]: ./include/EventRunner.lua:1954: ./include/EventRunner.lua:1755: attempt to perform arithmetic on a nil value (local 'time')

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    The error with "local time being nil"  is probably because because the 'time' given to trueFor is nil.

    Is it a version of the code I posted earlier where you should have used Util.defTriggerVar to define 'time'?

    Otherwise post the whole rule(s) and I can have a look at it.

     

     

    9 hours ago, edwink023 said:

    Read somewhere that you can color the debug lines but I cannot find it anymore (read so many pages) can you plz point me in the right direction.

     

    rule("now => log('This is #C:red#ABCDEFG')")

    You can only have one color  per line and it starts with the #C:...# directive.

    @Sjakie is a frequent user of this - maybe he has some tips.

     

    9 hours ago, edwink023 said:

     

    And I have the following rule when I turn of my hue light (180,203,175)of I want to turn of the main light but cannot figure it out.

    rule("207:scene ==  21.single   =>  {180,203,175}:on ; 208:off")

    also tried the follow 

    rule("207:scene ==  21.single   =>  {180,203,175}:on & 208:off")



     

    Is 208 your main light?  and 208:off doesn't work?

    9 hours ago, edwink023 said:
    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    First off @jgab you are a genius.

    You made my first experience with home automation a whole lot easier, if there is a way to buy you coffee or something stronger like whiskey let me know.

     

    Iam started to automate my home, first off is the lighting and for now I have a small setup like i want with as few interaction with me and the system as possible.

    I still get an error sometimes and I think it has to do with my rule when I control my lght manually but cannot figure it out yet.

    in Rule:4[trueFor(time,229:safe) =>  208:off; time=00:20:00]: ./include/EventRunner.lua:1954: ./include/EventRunner.lua:1755: attempt to perform arithmetic on a nil value (local 'time')

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    The error with "local time being nil"  is probably because because the 'time' given to trueFor is nil.

    Is it a version of the code I posted earlier where you should have used Util.defTriggerVar to define 'time'?

    Otherwise post the whole rule(s) and I can have a look at it.

     

     

    9 hours ago, edwink023 said:

    Read somewhere that you can color the debug lines but I cannot find it anymore (read so many pages) can you plz point me in the right direction.

     

    rule("now => log('This is #C:red#ABCDEFG')")

    You can only have one color  per line and it starts with the #C:...# directive.

    @Sjakie is a frequent user of this - maybe he has some tips.

     

    9 hours ago, edwink023 said:

     

    And I have the following rule when I turn of my hue light (180,203,175)of I want to turn of the main light but cannot figure it out.

    rule("207:scene ==  21.single   =>  {180,203,175}:on ; 208:off")

    also tried the follow 

    rule("207:scene ==  21.single   =>  {180,203,175}:on & 208:off")



     

    Is 208 your main light?  and 208:off doesn't work?

    Link to comment
    Share on other sites

    14 hours ago, jgab said:

     

    Yes, it requires a bit more advanced rules.

    Please login or register to see this code.

     

    The interval test <time1>..<time2> will trigger the rule at <time1>, but it also checks and is true between the times in the interval. (We shrink the end interval with 1s to not  overlap with the other rule starting at that time)

    The .start() added to the end of the rule will trigger the rule when it is defined (i.e. ER starts up) and if the interval check is true it will set the correct variable value.

     

    Thanks @jgab I understand how that should work now, however weirdly, the $DayTime variable doesn't seem to be being set, even though debug shows the rule as true, either that or I have the logging syntax wrong:

     

    Please login or register to see this code.

     

    Debug shows:

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Tip (from JGab)

    you can add in your rule

    Please login or register to see this code.

    It will give in log the state of your GV

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 25 minutes ago, Joel said:

     

    Thanks @jgab I understand how that should work now, however weirdly, the $DayTime variable doesn't seem to be being set, even though debug shows the rule as true, either that or I have the logging syntax wrong:

     

    Please login or register to see this code.

     

    Debug shows:

     

    Please login or register to see this code.

     

     

    Have you created the DayTime global in the variables panel in the Web UI?

    If not I get the same behaviour  as you - it's not defined so it returns nil in the 5s log rule.

    You can make sure that the global is created by adding

    Please login or register to see this code.

    in the beginning. It will create the global if it doesn't already exist. If it exists it's a nop.

     

    Link to comment
    Share on other sites

    43 minutes ago, jgab said:

     

    Have you created the DayTime global in the variables panel in the Web UI?

    If not I get the same behaviour  as you - it's not defined so it returns nil in the 5s log rule.

    You can make sure that the global is created by adding

    Please login or register to see this code.

    in the beginning. It will create the global if it doesn't already exist. If it exists it's a nop.

     

     

    Ah, I had, but there was a spelling mistake...

     

    All working, now to build some more rules!

    Link to comment
    Share on other sites

  • Topic Author
  • Another way to use the log function is to separate your own log statements from the log statements that ER spits out.

    Please login or register to see this code.

    If you define the 'L' function like above and use it when logging in rules like

    log(L(<color>,' text'))

    it will log the text with the color specified and it will do it with a log tag "ER<QA ID>"

    This means that in the Web UI you can select the log tag "ER53" if the ER's id is 53 and only see your own log outputs and not have it mixed with ER's log output that will have the tag "QUICKAPP53"

    ...and one can also select both tags to see both logs at the same time.

     

     

    Edited by jgab
    Link to comment
    Share on other sites

    mmmhhh Jan, seems to give a better complete view.

    You know I am "box" less at the moment but I will implement it already.

     

    JGab >>>>>you will stay the best!!!! Another excellent idea to place HA on a higher spot.

    Btw when Fibaro will hire you??

    Greatings,

    //Sjakie

    Link to comment
    Share on other sites

    2 hours ago, jgab said:

    Another way to use the log function is to separate your own log statements from the log statements that ER spits out.

    Please login or register to see this code.

    If you define the 'L' function like above and use it when logging in rules like

    log(L(<color>,' text'))

    it will log the text with the color specified and it will do it with a log tag "ER<QA ID>"

    This means that in the Web UI you can select the log tag "ER53" if the ER's id is 53 and only see your own log outputs and not have it mixed with ER's log output that will have the tag "QUICKAPP53"

    ...and one can also select both tags to see both logs at the same time.

     

     

    That's extremely useful, thanks.

     

    Another question, is it possible to grab the status of something and feed it to a variable to be used.

     

    What I want to do is grab the status of my Sonos and use it as part of a rule - I cant figure quite how to make it work. I do have the Sonos quick app installed

     

    Please login or register to see this code.

     

    Basically I want to open the garage door, turn on the lights, if the lights are on for more than a minute, and the Sonos isn't already playing to start playing and set the volume.

     

    Link to comment
    Share on other sites

  • Topic Author
  • If you use the Sonos controller from @Krikroff you get the state in the state property of the QA

    Please login or register to see this code.

    You can do

    Please login or register to see this code.

    I'm unsure why you call play twice...

     

    You can trigger on the state changing

    Please login or register to see this code.

     

     

    Link to comment
    Share on other sites

    Jan question since QA operates different as scenes.

    I am using still remote, if a device is triggered in another QA.

    Is it better to change it in the same rule in the other QA?

    Thanks in advance,

    //Sjakie

    Link to comment
    Share on other sites

    @jgab thank you for your reply.

    @Sjakiebedankt voor je reactie.

    I don't think I understand how to implement these things.

    -Util.defTriggerVar to define 'time'?-- in the debug its says no triggers found in header.where do implement this

    -Can you give me an example how to use the color function for the log.

    -rule("207:scene ==  21  =>  {180,203,175}:on & 208:of  f")  this rule is working my bad.

    -I have an Denon qa and when i turn it on between sunset en sunrise I want to turn on my Hue lamp {180,203,175} but I cannot get it t work with the on command.

    - is there an way to do the same thing with Plex as is have with kodi?

    I will put my rule down below, if you have any suggestion to make it more stream lined or more efficient I would love to hear it.

    i am a total beginner so probably I made some rookie mistakes :)

    Thanks in advance,

     

    edwin

     

     

      local HT = { 
        keyfob = 26, 
        motion= 218,235,229,
        temp = 219,230,236,
        lux = 220,237,231,
        lights=78,208,207,38,
        hue=180,203,175,
        
      }
     
      Util.defvars(HT)
      Util.reverseMapDef(HT)
     
    rule("global('time')")



     
      --------Daytime-------------------------------------
      rule("global('DayTime')")
      rule("07:00..12:00-1 => $DayTime='Morning'").start()
      rule("12:00..18:00-1 => $DayTime='Day'").start()
      rule("18:00..23:00-1 => $DayTime='Evening'").start()
      rule("23:00..07:00-1 => $DayTime='Night'").start()
     
      rule("log('Current version is %s - %s',E_VERSION,E_FIX)")
      --------------------Gang tafelamp------------------
      rule("218:breached & 220:lux < 10=> 38:on")
      --Tafel lamp aan na beweeg en lux onder 10.Auto uit na 3 min.
      rule("trueFor(00:03,218:safe) =>  38:off")--lamp automatisch uit na 3 min geen beweging.
     
    -----------------------Woonkamer --------------------
      rule("229:breached & {208,180,175,203}:isOff & 231:lux < 25=> || sunset-00:30..19:00 >> 208:value=20 || 19:00..21:00 >> 208:value=15 || 21:00..23:59 >> 208:value=10 || 23:00..sunrise >> 208:value=1")
      ---Spotjes na beweeg en lux onder de 20 aan.Hue lampen uit.Lumen afhankelijk van de  tijd.
      rule("trueFor(00:20,229:safe) =>  208:off")--Spotjes automatisch uit na 20 min geen bweging.
      --rule("208:isOn & 208:manual >= 0 => 208:off")
     rule("207:scene ==  21  =>  {180,203,175}:on & 208:off")--Hndmatig Hue lampen aan en spotjes uit.
     rule("207:scene ==  20 => {180,203,175}:off")--Handmatig Hue lampen uit.
    rule("290:on & sunset-00:30..sunrise+00:30 => {180,203,175}:value=70")--reciever aan hue lampen aan
    rule("#device{id=194,property='state',value='playing'} & sunset-00:30..sunrise+00:30 => ({175,180,203}:value=30) & 208:off") --Kodi play Hue aan gedimt 30%. Spotjes uit.
    rule("#device{id=194,property='state',value='paused'}  & sunset-00:30..sunrise+00:30=> {175,180,203}:value=50")--Kodi pauze Hue lampen gedimt 50%
    rule("#device{id=194,property='state',value='stopped'} & sunset-00:30..sunrise+00:30 => {175,180,203}:value=70")--Kodi stop hue lampen gedimt 70%.
     
      ---------------------Keuken lamp-------------------
      rule("235:breached &  237:lux < 20=> || sunset-00:30..19:00 >> 78:value=20 || 19:00..21:00 >> 78:value=15 || 21:00..23:59 >> 78:value=10 || 23:00..sunrise >> 78:value=5")--Lamp na beweeg en lux onder de 20 aan.Lumen afhankelijk van de  tijd.
      rule("78:isOn & 78:manual.single >= 0 => time=04:00:00")--Hand override na 4 uur uit
      rule("trueFor(00:03,235:safe) =>  78:off")-- lamp automatisch uit na 2 min geen beweging.
    Link to comment
    Share on other sites

    Hi @jgab! Thanks to @Sjakie I found your INCREDIBLE job here. Congratulations! I have zero idea on how to deal with this, I am now learning a lot, to be honest, and your posts here are just all I need.

     

    Let me ask your advice for four different situations:

     

    Quote

    Situation 1

    I have an alarm (by Coolcam) and I have just installed The Button so I can set my "Alarm" profile or "Home" profile, depending on its pushings. For example, if I push once, I have 15 seconds to close the door and the "alarm" profile activates (if any of the doors/windows suddenly opens, the alarm will sound). If I break into my main door, I have 15 seconds to push The Button twice to avoid the alarm triggering, if I do it, it goes to "Home" profile. Is it possible to establish any kind of countdown within the alarm itself? I mean make the alarm sound half-second during 10 seconds just before the profile change, just to 'inform' you that the alarm is about to be setted up or it is going to activate. I have also Alexa and it would be great that she can make a countdown but, for some reason, I can't activate routines with "Digital Home" decives....

     

    Quote

    Situation 2

    When I establish my "Alarm" profile, I should be aware that none of the windows are opened, so I need to receive a push notification (or email) indicating that one of the windows is opened (you could get a A+++ if I can get WHICH window is open :) ). If I implement a "regular scene" with a push notification when windows are open and "Away" profile is ON, I will just receive this notification if the window sensor changes its status.

     

    Quote

    Situation 3

    In all my bedrooms I have temperature sensors (by Coolcam also, I don't know their accurancy...). I would like to implement an scene where, if the temperature is lower than idontknowhowmanydegrees, the heater is on, and the opposite, and I will need to make this verification every half an hour or something.

     

    Quote

    Situation 4 (more "question 4")

    Is it possible to activate/deactivate a device bu your application? I have a PIR sensor (again, by Coolcam) and its battery drenage is massive due to it's placed in the living room's sofa. I use it to activate a "going to bed" scene (i.e. if balcony door is closed, it's more than 21h and the PIR is not detecting anyu movement, then close ruller shutter, turn off lights and so on...). I just need that this sensor will be able from 21 to, let's say, 3. So I assume it's battery drenage will be far away less than it is now.

    That's all :) I just casn say thank you again, and ask when the heck are those Fibaro guys going to hire you?! Anyway, I don't know if you have paypal of something like that, I will be appreciated to help you there, for sure.

     

    Cheers!

    Link to comment
    Share on other sites

  • Topic Author
  • 9 hours ago, edwink023 said:

    don't think I understand how to implement these things.

    -Util.defTriggerVar to define 'time'?-- in the debug its says no triggers found in header.where do implement this

    -Can you give me an example how to use the color function for the log.

    -rule("207:scene ==  21  =>  {180,203,175}:on & 208:of  f")  this rule is working my bad.

    -I have an Denon qa and when i turn it on between sunset en sunrise I want to turn on my Hue lamp {180,203,175} but I cannot get it t work with the on command.

     

    Something like below. (I haven't been able to test run the rules so there could still be some issues and spelling mistakes)

    I think you should use the HT to define names for your device - like I did for woonkamer.motion

    Then you can use their names in the rules instead of the device number. Device numbers may change if you need to reinstall a device. Then you only need to update the HT and not all the rules.

     

    Now the L log command separates user  logs from ER logs. Set USERTAG back to QUICKAPP if you want them in the same log.

     

    Are your Hue lamps Philips only - or you use some 3rd part signee lamps?

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 7 hours ago, Vicent13 said:

    Let me ask your advice for four different situations:

    Situation 1 and 2

    Please login or register to see this code.

     

    By "watching" a partition you will get an event when the partition is armed. Here we check if any devices is breached and in that case cancel the alarm and sends a notification.

    You could also start to do some countdown but then you need some device to talk to and have code/QA for that. There is no built-in support in ER  for that as the devices out there varies so much.

     

    Situation 3.

    If you coolcam gives a temperature it's just simple rules

    Please login or register to see this code.

    Then you can make it more complex if there should be some delay etc.

     

    Situation 4.

    No there is no support to "turn off" z-wave devices in this respect. At least not in ER.

    One can experiment with setting device parameters to make the device less active and thus save battery but it's highly device specific.

     

    Link to comment
    Share on other sites

    @

    Please login or register to see this link.

     , asbypass for your Denon plug it in a wall plug.

    If power higher than x >>on and lower than x >>off

    //Sjakie

     

    Link to comment
    Share on other sites

    @jgab

    I'm trying to move to newest ER version but I have following error:

     

    self.EM.SECTION = "AutoHeating"

     

    [05.02.2022] [09:16:14] [ERROR] [QA_ER4_996]: Main() ERROR:./include/main.lua:113: attempt to index a nil value (field 'EM')

     

    Link to comment
    Share on other sites

  • Topic Author
  • 9 minutes ago, petrkl12 said:

    @jgab

    I'm trying to move to newest ER version but I have following error:

     

    self.EM.SECTION = "AutoHeating"

     

    [05.02.2022] [09:16:14] [ERROR] [QA_ER4_996]: Main() ERROR:./include/main.lua:113: attempt to index a nil value (field 'EM')

     

    Yes, its moved to fibaro.EM

    Do

    Please login or register to see this code.

    for now and I will add it to the next ER version.

    • Thanks 1
    Link to comment
    Share on other sites

    Hi guys, 

     

    I am trying to get my head around events and how to manage more complicated rules.

     

    I've been trying to create a rule so that when the door opens, the lights come on, and if the lights are on for more than a minute then play the Sonos, but if the switch is flicked manually to leave the lights off, I was having an issue when if I turned the lights off when the door was open it would turn the lights back on:

     

    Please login or register to see this code.

     

     

    Under my HT definition I have:

     

    GAR_L_State = false,

     

    and then

     

    Util.defTriggerVar('GAR_L_State',false) in the main area

     

    But I get this error

     

    [06.02.2022] [11:23:58] [ERROR] [QUICKAPP130]: Error in 'GAR_L_State = true => GAR_Lights:on': ./include/EventRunner.lua:1953: ./include/EventRunner.lua:1645: no triggers found in header[06.02.2022] [11:23:58] [ERROR] [QUICKAPP130]: Main() ERROR:./include/EventRunner.lua:2036: ./include/EventRunner.lua:1953: ./include/EventRunner.lua:1645: no triggers found in header

     

    I am sure I am missing something simple

     

    thanks in advance

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