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
  • 24 minutes ago, jompa68 said:

    @jgab

    error in latest update. Did update this lunch and now it refuse to start

     

    Sorry for that - must have checked in wrong version.

    Updated to V3, B80.

    Link to comment
    Share on other sites

    Jan,

    The only thing I know is that Telebot recently was updating.

    I did not changed anything.

    Thats why I found it weird but my Sonos speaks all my messages is also crashed with an error.

     

     

    At this moment all the Telegram msg are by NodeRed.

    I created two scenes:

    -NodeRed on cmd speak

    -Telegram

    So because Telegram doest work all messages are now initiated by NodeRed

    Link to comment
    Share on other sites

    Fro the spoken Msg I want to do the same

    two scenes to choose witch is operational, two months ago my PI didt functioning result no messages

    In my scenes I have now: remote(1850,#Alarmering001); remote(1516,#Alarmering001);

    Now I am more flexible and reliable and if something ist working I can switch and figure out later what is going wrong.

    Link to comment
    Share on other sites

    Hello Jan,

    Sound is coming from my laptop.

    I have read back in the forum ER and if I have a line yes/no makes no difference.

    Sorry from the troubles

    //Sjakie

     

    Please login or register to see this image.

    /monthly_2019_11/image.png.626f39ef148f74f9ffb6d82cd67a84b4.png" />

    Link to comment
    Share on other sites

    Hi Jan,

    No indication why this scene  stopped.

    Please login or register to see this image.

    /monthly_2019_11/image.png.bfd2cc130cfb1a3312693026e8b48695.png" />

    Link to comment
    Share on other sites

    Hello Jan,

     

    Can I request your support for the following setting?

    My heater is under control of ER

    What I want to check:

    -if the night setting temperature (19 ℃) is done lets say 10 minutes after arming is on

    Sometimes it happens that this setting is not done.

    I can retrieve the info from the heater with cmd:

    http://192.168.1.101/data.json?heater=0

    It will list a bunch of stuff among them:

    Temp. setting of 19 ℃ is a combination of

     

    Please login or register to see this code.

    temperature(°C) = (value_lsb + (value_msb * 256)) / 100.0

    If value return is not equal as value 108 and 7 than launch:

    httpGet('http://192.168.1.101/data.json?heater=0&setpoint=140&thermostat=0')

    Your support is highly appreciated

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, Sjakie said:

    Hello Jan,

     

    Can I request your support for the following setting?

    My heater is under control of ER

    What I want to check:

    -if the night setting temperature (19 ℃) is done lets say 10 minutes after arming is on

    Sometimes it happens that this setting is not done.

    I can retrieve the info from the heater with cmd:

    http://192.168.1.101/data.json?heater=0

    It will list a bunch of stuff among them:

    Temp. setting of 19 ℃ is a combination of

     

    Please login or register to see this code.

    temperature(°C) = (value_lsb + (value_msb * 256)) / 100.0

    If value return is not equal as value 108 and 7 than launch:

    httpGet('http://192.168.1.101/data.json?heater=0&setpoint=140&thermostat=0')

    Your support is highly appreciated

    //Sjakie

     

    Hi,

    I pushed v3, B81 with a new command for doing synchronous http calls in ER (like api.get)

    For the moment it is only get and json return values.

    Anyway.

    if you try 

    Please login or register to see this code.

    ...do you get the json table back?

    If so you can do

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  •   Alternative:

    ER has support for making an asynchronous Lua function into a synchronous EventScript function. This is done by wrapping the function in Util.asyncFun and returning the value with Util.asyncReturn

    Ex.

    Please login or register to see this code.

    To create a getHeaterTemp function would then look like

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    6 hours ago, jgab said:

     

    Hi,

    I pushed v3, B81 with a new command for doing synchronous http calls in ER (like api.get)

    For the moment it is only get and json return values.

    Anyway.

    if you try 

    Please login or register to see this code.

    ...do you get the json table back?

    If so you can do

    Please login or register to see this code.

     

    Great it gives:

    Please login or register to see this code.

    Link to comment
    Share on other sites

    Jan, thanksssssss

    Its working good getting in log the info temp is set pity we cant compare with other value.

    I changed my policy in messages and Telegrams

    For arming/ de arming >>Telegram

    For all other events I only need a message when its not done.

    In this way I will minimize all the messages who are on my phone and I am able to see the important events if they dont work directly.

     btw my sound works again in Sonos >>no clue what was wrong couldt find anything so I restored older version and its working again.

    Thanks again for the support,

    //Sjakie

     

    Link to comment
    Share on other sites

    Jan,

    I get often an error when using:

    once(05:00..08:30,n/10:00 & .......

    bolean value

    ,

    what is wrong?

    In some other lines it is okay to use

    Please advice,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Jan,

    I get often an error when using:

    once(05:00..08:30,n/10:00 & .......

    bolean value

    ,

    what is wrong?

    In some other lines it is okay to use

    Please advice,

    //Sjakie

    Can you show me the whole rule? You need to have an ')' after the n/10:00. E.g. once(05:00..08:30,n/10:00) & .......

     

    There is a new construct since a couple of versions back that is '...' - 3 dots. It's used like '..' but is only true once a day. So it kind of a combination of 'once(X..Y)'

    rule("sensor:isOn & 05:00...08:30 => log('Sensor breached between 5 and 8')")

    is the same as 

    rule("sensor:isOn & once(05:00..08:30,n/10:00) => log('Sensor breached between 5 and 8')")

    '...' is implemented differently and is more efficient to execute. The drawback is that it can't span midnight, i.e. 2 days. (but I have an idea how to fix that too)

    Link to comment
    Share on other sites

    Jan,

    corrected my error.

    Rule.eval([[once(achtertuin.luxsensor:lux < 45 & 16:00...23:15) =>

    or

    Rule.eval([[achtertuin.luxsensor:lux < 45 & 16:00...23:15 =>

    please advice,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, Sjakie said:

    Jan,

    corrected my error.

    Rule.eval([[once(achtertuin.luxsensor:lux < 45 & 16:00...23:15) =>

    or

    Rule.eval([[achtertuin.luxsensor:lux < 45 & 16:00...23:15 =>

    please advice,

    //Sjakie

    Th last rule should work.

    Link to comment
    Share on other sites

    Good morning Jan,

     

      Rule.eval([[sunrise-00:15..sunrise & voortuin.luxsensor:lux > 3 | achtertuin.luxsensor:lux > 3 =>
            post(#eveninglightOff); remote(1613, #eveninglightOff); log('TRIGGER:%s',tjson(env.event)); log('Post eveninglightOff')
                ]])

    This I dont understand

    Its now 5.35 sunrise will be around 08:00 hour

    At 4.54 this rule is executed because achtertuin.luxsensor:lux  value = 2000 (Broken!!!! Gives a revers value? dark 2000 light 2 must see if its day light)

    But how can its not in the range of sunrise?

    Please advice,

    //Sjakie

     

    Link to comment
    Share on other sites

    Jan,

    This one is giving me headache I cant find whats wrong.

    Door hast been open for two days still rule is executing?

     

    Util.defTriggerVar("openfromInsideDoor",false)


    rule([[gastbeneden.door:breached =>
        || trueFor(00:02, voortuin.motionsensor:safe) >> openfromInsideDoor=true
        || voortuin.motionsensor:breached >> openfromInsideDoor=false
        ]])

    rule("openfromInsideDoor==true & 15:00..17:00 => log('TRIGGER:%s',tjson(env.event)); log('gastbeneden - present'); post(#gastbenedenPresent)")

        Rule.eval([[#gastbenedenPresent & @17:00 =>     
            1833:start
                ]])

    rule("openfromInsideDoor==false & 13:00..17:15 => log('TRIGGER:%s',tjson(env.event)); log('gastbeneden afwezig'); 1833:start")
    --------------------------------------


    rule("openfromInsideDoor==false  & sunset-00:30..sunrise+00:30 | voortuin.luxsensor:lux < 350 => gastbeneden.peer1:on; gastbeneden.peer1:value={bri=255, transitiontime=80, col=200}; wait(00:05:01); gastbeneden.peer1:off; log('TRIGGER:%s',tjson(env.event)); log('gastbeneden komt binnen???? voordeur open licht aan en na 5 min - uit')")

     

    rule("openfromInsideDoor==true & sunset-00:30..sunrise+00:30 | voortuin.luxsensor:lux < 350 => gastbeneden.peer1:on; gastbeneden.peer1:value={bri=150, transitiontime=400, col=200}; wait(00:02:00); gastbeneden.peer1:off; log('TRIGGER:%s',tjson(env.event)); log('gastbeneden gaat weg voordeur open licht aan en na 2 min - uit')")

    Please advice,

    //Sjakie

     

    Please login or register to see this image.

    /monthly_2019_11/image.png.f03e7ed80db56105a7a0bc59ffeb9454.png" />

    image.png.c13648b7e0c1e5c01e86c1b34638af55.png

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Good morning Jan,

     

      Rule.eval([[sunrise-00:15..sunrise & voortuin.luxsensor:lux > 3 | achtertuin.luxsensor:lux > 3 =>
            post(#eveninglightOff); remote(1613, #eveninglightOff); log('TRIGGER:%s',tjson(env.event)); log('Post eveninglightOff')
                ]])

    This I dont understand

    Its now 5.35 sunrise will be around 08:00 hour

    At 4.54 this rule is executed because achtertuin.luxsensor:lux  value = 2000 (Broken!!!! Gives a revers value? dark 2000 light 2 must see if its day light)

    But how can its not in the range of sunrise?

    Please advice,

    //Sjakie

     

    Because you have X & Y | Z and & has higher priority than |. This becomes then (X & Y) | Z. So the sunrise test is only for the first sensor.

    Correct way:

      Rule.eval([[sunrise-00:15..sunrise & (voortuin.luxsensor:lux > 3 | achtertuin.luxsensor:lux > 3) =>

     

    or

      Rule.eval([[sunrise-00:15..sunrise & max(voortuin.luxsensor:lux, achtertuin.luxsensor:lux) > 3 =>

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • 6 hours ago, Sjakie said:

    Util.defTriggerVar("openfromInsideDoor",false)

    rule([[gastbeneden.door:breached =>
        || trueFor(00:02, voortuin.motionsensor:safe) >> openfromInsideDoor=true
        || voortuin.motionsensor:breached >> openfromInsideDoor=false
        ]])

    rule("openfromInsideDoor==true & 15:00..17:00 => log('TRIGGER:%s',tjson(env.event)); log('gastbeneden - present'); post(#gastbenedenPresent)")

        Rule.eval([[#gastbenedenPresent & @17:00 =>     
            1833:start
                ]])

    rule("openfromInsideDoor==false & 13:00..17:15 => log('TRIGGER:%s',tjson(env.event)); log('gastbeneden afwezig'); 1833:start")
    --------------------------------------


    rule("openfromInsideDoor==false  & sunset-00:30..sunrise+00:30 | voortuin.luxsensor:lux < 350 => gastbeneden.peer1:on; gastbeneden.peer1:value={bri=255, transitiontime=80, col=200}; wait(00:05:01); gastbeneden.peer1:off; log('TRIGGER:%s',tjson(env.event)); log('gastbeneden komt binnen???? voordeur open licht aan en na 5 min - uit')")

     

    rule("openfromInsideDoor==true & sunset-00:30..sunrise+00:30 | voortuin.luxsensor:lux < 350 => gastbeneden.peer1:on; gastbeneden.peer1:value={bri=150, transitiontime=400, col=200}; wait(00:02:00); gastbeneden.peer1:off; log('TRIGGER:%s',tjson(env.event)); log('gastbeneden gaat weg voordeur open licht aan en na 2 min - uit')")

     

    Couple of quick comments without having tested the rule.

    You can't have trueFor in

    Please login or register to see this code.

    trueFor can only be used in the left hand side of '=>'

    Please login or register to see this code.

    will not trigger on #gastbenedenPresent, but only at 17:00

    The last 2 rules suffer from the '|' problem discussed in the previous post. Add paranthesis where needed.

     

    Link to comment
    Share on other sites

    Hi @jompa68,

    Not me its on the todo list (first I must modify my door lock because its a three point closure system.

    //Sjakie

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