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 (edited)

this is getting frustrating ?? I just can not make it work lol

 

finally gave up using the id of the user and put all the devices as id's and old version works again ?

 

cheers:)

Edited by Momos
Posted (edited)

@jgab need some help pls :)  

 

Please login or register to see this code.

 
log is: 
[21.04.2021] [11:19:33] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"HeldDown"}]>>'Rule:19[WalliController:central => ...]'
[21.04.2021] [11:19:35] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"Released"}]>>'Rule:19[WalliController:central => ...]'
[21.04.2021] [11:19:41] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"Pressed2"}]>>'Rule:19[WalliController:central => ...]'
[21.04.2021] [11:19:43] [DEBUG] [QUICKAPP1149]: [{"keyId":2,"keyAttribute":"Pressed2"}]>>'Rule:19[WalliController:central => ...]'
[21.04.2021] [11:19:46] [DEBUG] [QUICKAPP1149]: [{"keyId":2,"keyAttribute":"Pressed"}]>>'Rule:19[WalliController:central => ...]'
 
What am i doing wrong ? 
 
And second problem:
 
rule("@@01:00 => log(osdate('Uptime %H:%M',api.get('/settings/info/').serverStatus))")
 
Always reports 
 
[21.04.2021] [11:19:17] [TRACE] [QUICKAPP1149]: Uptime 22:44
 
same 22:44 everytime.
 
 
Thank you :) 
 
 
 
 
Edited by Momos
  • Topic Author
  • Posted
    7 hours ago, Momos said:

    @jgab need some help pls :)  

     

    Please login or register to see this code.

     
    log is: 
    [21.04.2021] [11:19:33] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"HeldDown"}]>>'Rule:19[WalliController:central => ...]'
    [21.04.2021] [11:19:35] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"Released"}]>>'Rule:19[WalliController:central => ...]'
    [21.04.2021] [11:19:41] [DEBUG] [QUICKAPP1149]: [{"keyId":1,"keyAttribute":"Pressed2"}]>>'Rule:19[WalliController:central => ...]'
    [21.04.2021] [11:19:43] [DEBUG] [QUICKAPP1149]: [{"keyId":2,"keyAttribute":"Pressed2"}]>>'Rule:19[WalliController:central => ...]'
    [21.04.2021] [11:19:46] [DEBUG] [QUICKAPP1149]: [{"keyId":2,"keyAttribute":"Pressed"}]>>'Rule:19[WalliController:central => ...]'
     
    What am i doing wrong ? 
     
    And second problem:
     
    rule("@@01:00 => log(osdate('Uptime %H:%M',api.get('/settings/info/').serverStatus))")
     
    Always reports 
     
    [21.04.2021] [11:19:17] [TRACE] [QUICKAPP1149]: Uptime 22:44
     
    same 22:44 everytime.
     
     
    Thank you :) 
     

     

    Sorry, a bug had snucked into the ++ (and ===) operators.

    Your code is correct, the error was on my side.

    I have fixed. it now and pushed 0.5,"fix49"

    Posted

    Thank you :)  however my ER4 just does not want to update to fix 49. Checks for new version and thats it. 

    Posted

    Jan, the same here no auto update fix 49 (from fix 48)

    I changed the time and no update.

    //Sjakie

  • Topic Author
  • Posted
    48 minutes ago, Sjakie said:

    Jan, the same here no auto update fix 49 (from fix 48)

    I changed the time and no update.

    //Sjakie

    If you do an update/restart now? (forgot to bump the version number)

    • Like 1
    Posted

    Jan, omg you are human!!! :)

    Yep the QA is updated fix 49 >>>Thanks.

    Perhaps you overlooked please can you convert this I do not get it working!!! I

     

    Please login or register to see this code.

    Thanks,

    //Sjakie

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

    Jan, omg you are human!!! :)

    Yep the QA is updated fix 49 >>>Thanks.

    Perhaps you overlooked please can you convert this I do not get it working!!! I

     

    Please login or register to see this code.

    Thanks,

    //Sjakie

    rule("@now+00:00:03 => http.get('http://192.168.1.24/MainZone/index.put.asp?cmd0=PutMasterVolumeSet/150')")

     

     

    Posted

    Thank you:)  CentralScene working now ! I have to say this is the cleanest way of handling CentralScene i have seen so far ?

     

    Why is 

     

    rule("@@01:00 => log(osdate('Uptime %H:%M',api.get('/settings/info/').serverStatus))")
     
    Always reporting 
     
    [21.04.2021] [11:19:17] [TRACE] [QUICKAPP1149]: Uptime 22:44  ?
  • Topic Author
  • Posted
    20 minutes ago, Momos said:

    Thank you:)  CentralScene working now ! I have to say this is the cleanest way of handling CentralScene i have seen so far ?

     

    Why is 

     

    rule("@@01:00 => log(osdate('Uptime %H:%M',api.get('/settings/info/').serverStatus))")
     
    Always reporting 
     
    [21.04.2021] [11:19:17] [TRACE] [QUICKAPP1149]: Uptime 22:44  ?

    It turns out that .serverStatus is epoch when the box booted up.

    The uptime is then

    ostime()-api.get('/settings/info/').serverStatus

    Then the problem is how to present this. The diff is not epoch and os.date will wrap on. 24hours.

    You could present hours easily

    rule("@@01:00 => log('Uptime %0.0f hours',(ostime()-api.get('/settings/info/').serverStatus))/60)")

    Posted

    nice:) 

     

    rule("@@01:00 => log('Uptime %0.0f hours',((ostime()-api.get('/settings/info/').serverStatus))/60)")  works. Was one more paranthesis that needed to be added.
     
    Cheers :) 
    • Thanks 1
    Posted
    2 hours ago, jgab said:

    rule("@now+00:00:03 => http.get('http://192.168.1.24/MainZone/index.put.asp?cmd0=PutMasterVolumeSet/150')")

    Is it so simple? I did httpGet Idid not have any example.

    This is WAF!!!

    Thanks Jan,

    //Sjakie

    Posted

    Jan ,

     

    i have  a situation -  as i dig more and more into ER4 i have more situations...

     

    Simple rule : 

    rule("LightSensorBirou:lux < 20 & PIRFibaroBirou:breached  => PlafonieraBirou:on & ScafaBirou:on ")
     
    What it should do: should check if LUX is under 20 and motion sensor breached - then if both true turn on two lights.
    And it does that very well.  Too well in fact, as it does much more ?
     
    I'm in the room, lights are on. I want to leave the room so i walk to the door, close the lights from the switch on the wall and leave.  Lights turn off of course but after 3-5 seconds they turn back on ?.  I close them again, 3-5 seconds later they turn back on. - last night at about 3 AM when i noticed this i tried to turn them off about 5 times, even sneaking my hand through the doorway but they still came back on.  I was waay to tired so i gave up and went to sleep and left those light on. They won that battle ?
     
    I guess this has to do with the fact that the fibaro motion sensor stays in the breached state for a few seconds, so as i go out and turn off the lights, LUX drops - the sensor is still in breached state so lights turn back on.
     
    Now the question is: how can adjust that rule to prevent this from happening please ?
     
    Thank you !

     

  • Topic Author
  • Posted
    9 minutes ago, Momos said:

    Jan ,

     

    i have  a situation -  as i dig more and more into ER4 i have more situations...

     

    Simple rule : 

    rule("LightSensorBirou:lux < 20 & PIRFibaroBirou:breached  => PlafonieraBirou:on & ScafaBirou:on ")
     
    What it should do: should check if LUX is under 20 and motion sensor breached - then if both true turn on two lights.
    And it does that very well.  Too well in fact, as it does much more ?
     
    I'm in the room, lights are on. I want to leave the room so i walk to the door, close the lights from the switch on the wall and leave.  Lights turn off of course but after 3-5 seconds they turn back on ?.  I close them again, 3-5 seconds later they turn back on. - last night at about 3 AM when i noticed this i tried to turn them off about 5 times, even sneaking my hand through the doorway but they still came back on.  I was waay to tired so i gave up and went to sleep and left those light on. They won that battle ?
     
    I guess this has to do with the fact that the fibaro motion sensor stays in the breached state for a few seconds, so as i go out and turn off the lights, LUX drops - the sensor is still in breached state so lights turn back on.
     
    Now the question is: how can adjust that rule to prevent this from happening please ?
     
    Thank you !

     

    Simplest is probably

    rule("PIRFibaroBirou:breached  => LightSensorBirou:lux < 20 & PlafonieraBirou:on & ScafaBirou:on ")

    Posted

    but then the LUX conditon is never taken into account.  And lights will trigger dissregarding the lux level

  • Topic Author
  • Posted
    1 minute ago, Momos said:

    but then the LUX conditon is never taken into account.  And lights will trigger dissregarding the lux level

    Yes, it will always trigger on motion, but the actions (right of =>) are combined with AND (&) and will only evaluate expression as long as it is true.

    If ightSensorBirou:lux < 20 is false it will not evaluate the rest.

    It's a short way of writing

    rule("PIRFibaroBirou:breached  => if ightSensorBirou:lux < 20 then PlafonieraBirou:on; ScafaBirou:on end")

    which you can also do as it supports if-then-else statements in the body (actions)

    • Like 1
    Posted
    22 minutes ago, jgab said:

    which you can also do as it supports if-then-else statements in the body (actions)

    very nice :)  

    Posted

    Good morning Jan,

    With this rule I can see the uptime of my HC3 604 Hours

    Please login or register to see this code.

    I have created back up yesterday 23-04-2021 at 21:44

    But it does not tell me the uptime after creating a backup.>>> this is not consequent because I did now a backup and the uptime is now 4 hours???? Can you explain this deviation?

    Thanks in advance,

    //Sjakie

     

     

    Posted

    Jan, I have some errors who I can not resolve.

    This error does not point to the rule but I asume its the first rule after log('Douche........

    1)

    Please login or register to see this code.

     

    HomeTable   doucheRuimte = {deur=836

     

    Rule:

    Please login or register to see this code.

    Any guidance is appriciated,

    //Sjakie

  • Topic Author
  • Posted
    8 minutes ago, Sjakie said:

    Jan, I have some errors who I can not resolve.

    This error does not point to the rule but I asume its the first rule after log('Douche........

    1)

    Please login or register to see this code.

     

    HomeTable   doucheRuimte = {deur=836

     

    Rule:

    Please login or register to see this code.

    Any guidance is appriciated,

    //Sjakie

    If the error occurs when a rule run you will get the rule.

    I think that you are using doucheRuimte.deur in your main() in some non-rule code (without '=>')

    ...and doucheRuimte is not set so it complains about the nil table.

    Maybe you have forgot

    Please login or register to see this code.

    or you use doucheRuimte.deur before you define it.

    That's why you get the "main() error:" message

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