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

Hello Jan,

I need again your expertise.

I implemented your proposal for coming from out side to the inside, works excellent

The bath room is having motion sensor and window sensor

The bed room is only having window and door sensor works good also, my rule was giving alarm when the door position changed, yours not!

My question is both rules are in the same ER scene so I added "2" behind those items who are in both rules to avoid any mistake.

Is that necessary?

 

Util.defTriggerVar("openedFromOutside2",true)

 

rule([[alarmapp.ringbeveiliging:isOn & hoofdslaapkamer.raamB:breached =>
    || hoofdslaapkamer.deur:safe >> openedFromOutside2=true
    || hoofdslaapkamer.deur:breached >> openedFromOutside2=false
    ]])--alarmapp.ringbeveiliging:isOn &

rule("openedFromOutside2==true => post(#RingAlarmState); log('TRIGGER:%s',tjson(env.event)); log('RingAlarmState Slaapkamer raam geopend'); Telegram.msg(TID,'Ring alarm slaapkamer raam volgens rule Jan - geopend')")
rule("openedFromOutside2==false => log('TRIGGER:%s',tjson(env.event)); log('Slaapkamer raam geopend VAN BINNEN UIT rule Jgab')")

//Sjakie

 

 

Link to comment
Share on other sites

  • Topic Author
  • 1 hour ago, Sjakie said:

    My question is both rules are in the same ER scene so I added "2" behind those items who are in both rules to avoid any mistake.

    Is that necessary?

     

    The particular name of the trigger variable is not important.

    The important thing is that there is a unique variable for each door you are monitoring. Ex. "SlaapkamerOpenedFromOutside" - or something in Dutch...

    Link to comment
    Share on other sites

    Jan I have this error:

    Please login or register to see this image.

    /monthly_2019_10/image.png.68a5e5659f1a54e218a335ff775aabea.png" />

    Rule.eval("@@03:00 => if max(hums:value) > max(91.2-1.184*max(temps:value),65) then fans:on else fans:off            ") -- recheck every 3 hours

                                                                                                                                                                                                            end

    If I do this error is gone

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • Yes, I forgot an ‘end’

    - You are getting good at this ?

    Link to comment
    Share on other sites

    Jan,

    Dont be surprised with such a excellent teacher/ coach!!

    Btw I am learning a lot with the error explanation if I do something wrong. Somtimes it will take a day but I can solve a few of them.

     

    To update you:

    Ring alarm does still have errors or a wrong thought to create a rule but I am finalizing it now.

    Bath room in process of full automation.

    Loft automatically light on/off finished today.

    All scenes in the same format almost finished

    ER scenes more logical distrubution of the house

    Combi oven in progress

    Dead nodes solved

    Guest room 1 presence to developed.

    Guest room 2 presence to developed.

    ICal stil doest work

    IOS location doest work

    Harmony hub doest work.

    And what else is popping up on the wish list

    Thanks and have a nice weekend

    Link to comment
    Share on other sites

    Hello Jan,

     

    Can I use sat or hue as trigger? If yes how?

        Rule.eval([[voortuin.spotbeeldbuiten:value=={sat=125} =>

    Thnaksin advice

     

    //Sjakie

     

    Link to comment
    Share on other sites

  • Topic Author
  • 21 hours ago, Sjakie said:

    Hello Jan,

     

    Can I use sat or hue as trigger? If yes how?

        Rule.eval([[voortuin.spotbeeldbuiten:value=={sat=125} =>

    Thnaksin advice

     

    //Sjakie

     

    It's possible but requires some additional lines of code. At the moment, only 'on' and 'buttonevent' is filtered out to generate events.

    I'm fighting with my development environment (Zerobrane) after upgrading my laptop os, so I can't test code at the moment. Hope to fix it soon and I'll show how it can be done.

    Link to comment
    Share on other sites

    Hello Jan,

    No problem at all.

    Dont fight to hard!

    What os are you using, Linux flavor or ordinary Windows?

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 13 minutes ago, Sjakie said:

    Hello Jan,

    No problem at all.

    Dont fight to hard!

    What os are you using, Linux flavor or ordinary Windows?

    //Sjakie

    I'm a Mac user...

    Link to comment
    Share on other sites

  • Topic Author
  • On 10/31/2019 at 7:49 AM, jgab said:

    I'm a Mac user...

    Ok, I'm up and running again! :-)

    If you run ZeroBrane studio and want to try the latest, it seems like 

    Please login or register to see this link.

    is pretty ok. It works on MacOS Catalina  (and Windows and Linux I presume)

    EventRunner works ok, but there may be an issue with HC2.lua (I need to exclude a file, and need to find a way to be backward compatible with ZeroBrane 1.18)

    Link to comment
    Share on other sites

    Good morning Jan,

    Great you are back in businesses!!

    I tried the Zerobrane a while ago but with a lot of errors, perhaps you can remember. Something to pick up in the near future.

    At this moment I am trying to finish and smooth things out in HC2.

    Reporting I need to extend a bit to have a better view of whats happening.

    Calendar , Logitech hub and position is that part what has my priority.

    I have the calendar from jcichon01 working( at last was an error in the GV) and have asked Jonny for the rule for Alexa to read the agenda.

    //Sjakie

     

     

     

    Link to comment
    Share on other sites

    Hello Jan,

    Perhaps you forgot but can there be a link in the fact that as well Calendar and IOS not are functioning on my end?

    //Sjakie

    Link to comment
    Share on other sites

    Hi Jan,

    I dont think this is working?

    Rule.eval("@month('jan') => $Month ='January';  log('Set GV into January')")

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 13 hours ago, Sjakie said:

    Hi Jan,

    I dont think this is working?

    Rule.eval("@month('jan') => $Month ='January';  log('Set GV into January')")

    //Sjakie

    No it doesn't. month() is just a test and can not be used to specify time intervals for '@'

    You need to run the rule every midnight and update the variable. A GV will only trigger other rules (or scenes) if it actually changes value.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Thanks Jan,

    Suddenly Telegram is giving error and stops the scene!

    If I restore an older version of the scene same error.

     

    Please login or register to see this image.

    /monthly_2019_11/image.png.02e6b6f770c44f3d9fd2751b90c90b9f.png" />

     

    Please advice

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 5 hours ago, Sjakie said:

    Thanks Jan,

    Suddenly Telegram is giving error and stops the scene!

    If I restore an older version of the scene same error.

     

    Please login or register to see this link.

     

    Please advice

    //Sjakie

    What are the lines around line 3077 in that scene file?

    Link to comment
    Share on other sites

      function Telegram.bot(key,tag)
        tag = tag or "Telegram"
        Telegram._botkey = key
        if not Telegram._users then Telegram._loadUsers() end
        local url,lastID,msg = "https://api.telegram.org/bot"..key.."/",1,nil
        local function loop()
          Telegram._request(url,"getUpdates",{offset=lastID+1},
            function(messages)
              for _,m in ipairs(messages.result) do
                lastID,msg=m.update_id,m.message
                Telegram._recordUser(msg.from.username,msg.chat.id,key)
                Event.post({type=tag,user=msg.from.username,text=msg.text,id={msg.chat.id,key},info=msg.chat,_sh=true})
     If I send at  a certain time a Telegram Msg with the Telegram Scene it does not give any error!

    The

    Link to comment
    Share on other sites

    Jan, I was using spoken language by Krikrof Sonos scene but it crashed due to an update.

    Now I like to convert my messages in NodeRed but it worked in ER Version 2 in Version 3 I did not used it.

    If I push the test button in NR Sonos will sounds the message.

    In my Escene I have:

    _NodeRed     = "http://192.168.1.89:1880/eventrunner"

      Nodered.connect(_NodeRed)

     

    rule("@21:43 => Nodered.post(#speak{data='test if this message is coming trough by Sonos?'})")

    This doest work

     

    If I use the telegram it will work, shall I use this one instead off;

    Telegram.msg(TID,'Alle binnen verlichting - aan') >>>stopped working yesterday in all scenes due to an update of Telebot????

     rule("@21:44 => Nodered.post(#telegram{msg={content='hello this is a test telegram',chatId='-xxxxxxxxxxxxx',type='message'}})") >>>is functioning

     

    Can you please push me in the right direction?

    //Sjakie

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 21 hours ago, Sjakie said:

      function Telegram.bot(key,tag)
        tag = tag or "Telegram"
        Telegram._botkey = key
        if not Telegram._users then Telegram._loadUsers() end
        local url,lastID,msg = "https://api.telegram.org/bot"..key.."/",1,nil
        local function loop()
          Telegram._request(url,"getUpdates",{offset=lastID+1},
            function(messages)
              for _,m in ipairs(messages.result) do
                lastID,msg=m.update_id,m.message
                Telegram._recordUser(msg.from.username,msg.chat.id,key)
                Event.post({type=tag,user=msg.from.username,text=msg.text,id={msg.chat.id,key},info=msg.chat,_sh=true})
     If I send at  a certain time a Telegram Msg with the Telegram Scene it does not give any error!

    The

     

    So, it still works for me, both receiving messages from the bot and sending messages.

    I suspect that there is something with the botID or chatID - have you changed them recently?

    Anyway, I have pushed a V3, B79 that has a better error message if it receives a unexpected result from Telegram. Please try and see what error message you get?

    12 hours ago, Sjakie said:

    Jan, I was using spoken language by Krikrof Sonos scene but it crashed due to an update.

    Now I like to convert my messages in NodeRed but it worked in ER Version 2 in Version 3 I did not used it.

    If I push the test button in NR Sonos will sounds the message.

    In my Escene I have:

    _NodeRed     = "http://192.168.1.89:1880/eventrunner"

      Nodered.connect(_NodeRed)

     

    rule("@21:43 => Nodered.post(#speak{data='test if this message is coming trough by Sonos?'})")

    This doest work

     

    If I use the telegram it will work, shall I use this one instead off;

    Telegram.msg(TID,'Alle binnen verlichting - aan') >>>stopped working yesterday in all scenes due to an update of Telebot????

     rule("@21:44 => Nodered.post(#telegram{msg={content='hello this is a test telegram',chatId='-xxxxxxxxxxxxx',type='message'}})") >>>is functioning

     

    Can you please push me in the right direction?

    //Sjakie

     

     

    If you do 

    rule("Nodered.post(#speak{data='test if this message is coming trough by Sonos?'})")

    -do you get any log in NR debug window? That it receives the message?

    -do you use other NR functions from ER that works?

    Link to comment
    Share on other sites

    @jgab

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

    Please login or register to see this attachment.

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