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

It should work the same as in ER3 however I used in a separate scene for all ID's instead of local:

HT = {

Now I use an auto mated one, if change or add an ID need to press update

 

Please login or register to see this code.

 

Edited by Sjakie
Link to comment
Share on other sites

Hi folks

 

I have a rule like this for my garage door, which is almost a direct copy/paste of the example in

Please login or register to see this link.

Please login or register to see this code.

However, the behaviour I get is a bit different: the door closing doesn't reset the counter. So if it is open for 10 minutes I get the first alert, then let's say I close the door, and in a few hours it gets left open again. 10 minutes after it is opened that second time I get a notification that it has been open for 20 minutes. Once it has done 3 of those it stops giving any alerts until I restart ER4.

 

Any thoughts on what could be the issue?

Link to comment
Share on other sites

I do only 

Please login or register to see this code.

It will give message if door is open for 10 minutes

Link to comment
Share on other sites

I just can´t get my head around this syntax...and I can´t find what I´m doing wrong... 🙄

This is what I do:

Please login or register to see this code.

 

 

This is the result:
[2023-05-22] [09:50:43] [DEBUG] [QUICKAPP728]:
Rules:
Rule:1[@sunrise-00:30 => log('Solen går upp om 30 minuter')]
-Daily(04:10:00) =>... [not triggered]
Rule:2[@sunset-00:30 => log('Solen går ner om 30 minuter')]
-Daily(21:01:00) =>... [not triggered]
Rule:3[@09:51 => lounge1.SpotOppenSpis:on]
-Daily(09:51:00) =>... [not triggered]
[2023-05-22] [09:50:43] [DEBUG] [QUICKAPP728]:
Monday, May 22, ER uptime:0 hours
Sunrise:04:40,  Sunset:21:31
#Events handled :1     ,#Events matched:1
#Rules succeeded:0     ,#Rules false:0
#Rules error    :0
Memory:1052.6kb [100% 100% 100% 100% 100% 100% 100%]
[2023-05-22] [09:51:00] [DEBUG] [QUICKAPP728]: [true]>>'Rule:3[@09:51 => lounge1.SpotOppenSpis:on]'
[2023-05-22] [09:51:00] [ERROR] [QUICKAPP728]: in Rule:3[@09:51 => lounge1.SpotOppenSpis:on]: ./include/EventRunner.lua:1905: ./include/EventRunner.lua:1771: attempting to index non table with key:'SpotOppenSpis'


 

Link to comment
Share on other sites

  • Topic Author
  • The top-root for lounge1 is 'dev' so the value is used like this

    Please login or register to see this code.

    You could declare the sub-table like this

    Please login or register to see this code.

    then it would add all the keys inside HT.dev to be used by the rules and then you could use
     

    Please login or register to see this code.

     

    I see you also have a 'other' top key and you could also, in addition, add the original table to have access to that too...

    Link to comment
    Share on other sites

    Of course! Thanks! Easy, peasy! 👌
    Now I will get on with transferring all my rules from HC2 and build som new ones.

     

    Tack för ett superbt system!

    • Thanks 1
    Link to comment
    Share on other sites

    I have searched this topic but not found what I´m looking for but I believe there is a simple solution to this. 😊
    What I´m looking for is to change the way I´m turning off the outdoor lights within a random time in a timeslot of apx 15 minutes.

    So that one week monday will be for example 23:02 and tuesday will be 23:17 the next week monday will be 23:13 and tuesday 23:06 and so on. 

     

    rule("@23:05 & wday('mon') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:22 & wday('tue') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:15 & wday('wed') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:30 & wday('thu') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@01:17 & wday('sat') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@02:12 & wday('sun') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@22:58 & wday('sun') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
     
    Happy programming! 
    😁 Mike
     
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, kappnet said:

    I have searched this topic but not found what I´m looking for but I believe there is a simple solution to this. 😊
    What I´m looking for is to change the way I´m turning off the outdoor lights within a random time in a timeslot of apx 15 minutes.

    So that one week monday will be for example 23:02 and tuesday will be 23:17 the next week monday will be 23:13 and tuesday 23:06 and so on. 

     

    rule("@23:05 & wday('mon') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:22 & wday('tue') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:15 & wday('wed') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@23:30 & wday('thu') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@01:17 & wday('sat') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@02:12 & wday('sun') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
    rule("@22:58 & wday('sun') => utebelysningen:off & log('Utomhusbelysning släcks av timer') & $UtebelysningStatus='OFF'")
     
    Happy programming! 
    😁 Mike
     

    There is an ER function named 'rnd' that takes 2 arguments, a min and a max value and returns a random value between that.

    So you can then write:

    Please login or register to see this code.

    This will give a random value between -7min30s and +7min30s that is added to the value after @ (+ binds harder then the @ operator).

     

    In generalI would move the action of these rules to a separate rule (handler) like this

    Please login or register to see this code.

    You post an event (#turnOffUte) and declare another rule that triggers on that - like a subroutine...

    It saves some typing and if you need to change the action or the log message is only one place to update.

    This way of collecting common rule actions in separate handler rules are very convenient.

    In this case it also means that you easily could add another rule that trigger on a remote button or another switch and posts the same #turnOffUte to manually turn off the lights outdoors...

    Edited by jgab
    • Like 1
    Link to comment
    Share on other sites

    • 2 weeks later...

    @jgab This is a method of dimming equipment,Is there a faster triggering method,Thank You!

    Please login or register to see this code.

    tag like this:

    Please login or register to see this code.

     

    Edited by lux
    Link to comment
    Share on other sites

  • Topic Author
  • On 6/7/2023 at 12:33 PM, lux said:

    @jgab This is a method of dimming equipment,Is there a faster triggering method,Thank You!

    Please login or register to see this code.

     

     

     

    So, I'm not really understanding.

    delayMotionID is a key button of some kind generating centralSceneEvents ?

    directionMotionID is what kind of device?

     

    Normally, if you have a device that can be dimmed it usually responds to startLevelIncrease and startLevelDecrease - so a keyDown sends the startLevelIncrease and the keyUp sends a levelStop.

    No need to continuously dim in a loop as it is usually experienced as too slow.

     

    Ex.

    Please login or register to see this code.

    ...and with some extra logic to dim up and down.

    Link to comment
    Share on other sites

    Please login or register to see this code.

    Jan QA crashed second time in 24 hours.

    Three minutes later the same post was executed without any problem btw this is when someone enters the hall.

    The QA is an older QA last modification I removed some rules and joined three other rules.

    The HC3 runs since months smoothly just a hick up?

    Link to comment
    Share on other sites

    Hi! I recently discovered the child device feature and am having great success using them on an instance of ER4 that controls the multi-zone AC (the child devices are switches that let me manually override rules, turn off everything, etc, from The Home Remote). There are a few devices that replicate per zone so being able to create them inside loops is very handy. I'm using a separate QuickApp to set the setpoint and mode (which ER4 catches events from - that quickapp doesn't drive any real devices, its sole purpose is to provide a UI to control settings that ER4 picks up). This QA isn't a child device, I manually created it.

     

    However, it would be better to have 4 separate setpoints, one for each zone. To achieve this without manually creating and linking them, I wanted to use the child device functionality to create setpoint controlling devices. I tried 

     

    Please login or register to see this code.

     

    But the device it created, while the right type, had no UI elements and generated no events. 

    Trying to programmatically set properties that tend to exist on other such devices gave 'bad property' errors, e.g.

     

    Please login or register to see this code.

    gives

    Please login or register to see this code.

    How the device looks:

    Please login or register to see this attachment.

     

    Can I do more to programmatically initialise the device with the right UI elements, or is this going to end up being harder and more complicated than just creating them manually and I am actually not doing myself any favours going down this path?

     

    EDIT: decided that last sentence was the case and created the devices manually... 

    Edited by bonhomme
    Link to comment
    Share on other sites

    Hi 

    are ther a way to make  the script  go off like evry 4 w  like 28,32,36 and so on  ?

    Please login or register to see this code.

     

     

    Tanx  for the help :)

    Edited by systemfel
    Link to comment
    Share on other sites

  • Topic Author
  • Please login or register to see this code.

     

    • Like 1
    Link to comment
    Share on other sites

    On 6/13/2023 at 9:40 PM, jgab said:

    Please login or register to see this code.

     

    Tanx  :) tack så mycket 

    Link to comment
    Share on other sites

    I have hopefully a simple question

    I have a logging rule that I want to run either every 5 minutes, or whenever another certain event is caught (a custom event I'm using in other places to trigger other rules).

     

    I have the following:

    Please login or register to see this code.

     

    Elsewhere, I have rules that post that #kicksensor event, e.g.

     

    Please login or register to see this code.

     

    So, based on these 3, when I change the heating setpoint on that device (thermocontroller - it's just a thermostat type QA for frontend UI purposes), I should see both log lines at the same time or thereabouts.

    However, I see only the second one (caught #kicksensor event), not the first one. The first one does dutifully trigger every 5 minutes though, regardless of that event being posted. For example, below I have kept the actual timestamps from the logs

     

    Please login or register to see this code.

     

    Any ideas about what I might be doing wrong?

    Link to comment
    Share on other sites

    On 5/26/2023 at 4:45 PM, Earybeongbeong7 said:

    hello.

    Can you create virtual switches, sensors, etc.?

    You can do this with child devices, see jan's post a few pages back

     

    I've never tried it for sensors. For those HC3 also has a "linked devices" feature which might do what you want?

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