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

Jan, thanks,

I will follow your advice and gonna use a relais.

alarmapp.alarmrelais:isOff is normal 24/7 off in alarmstate it wiil be on and after switch off.

I need only to trigger this moment to switch  lights on. Is this rule okay?
Please advice

 Rule.eval("once(for(00:15, alarmapp.alarmrelais:isOff)) => {woonkamer.spotbeeldrechts, woonkamer.spotschilderijrechts, woonkamer.spotstoelsjaak}:off")
   

  • Topic Author
  • Posted
    7 hours ago, Sjakie said:

    Jan, thanks,

    I will follow your advice and gonna use a relais.

    alarmapp.alarmrelais:isOff is normal 24/7 off in alarmstate it wiil be on and after switch off.

    I need only to trigger this moment to switch  lights on. Is this rule okay?
    Please advice

     Rule.eval("once(for(00:15, alarmapp.alarmrelais:isOff)) => {woonkamer.spotbeeldrechts, woonkamer.spotschilderijrechts, woonkamer.spotstoelsjaak}:off")
       

    In general you don't need to wrap a 'for' in a 'once'. This should be enough

    Please login or register to see this code.

     

    Posted
    On 6/18/2019 at 4:37 PM, jgab said:

    This was difficult. I pushed a new version B12 that fixed it. Fingers crossed.

    Seems to work now, only 1 push this afternoon.

    @jgab how should the setup be if i want to change this line

    Please login or register to see this code.

    to something like this(want to change from fix time to when i change variable instead)
    But it cannot get it to work.

     

    Please login or register to see this code.

     

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

     

    Please login or register to see this code.

     

     

    This should work. Have you declared UHASSleepState as a trigger in the scene header?

    Posted
    7 minutes ago, jgab said:

    Have you declared UHASSleepState as a trigger in the scene header?

    OH NO! o.O 

    Hmm how could i forget that...thanks for heads up @jgab

     

    Happy midsummer :D

    Posted
    9 hours ago, jgab said:

     

    This should work. Have you declared UHASSleepState as a trigger in the scene header?

    Sorry that i quote you again @jgab but it did not work, even with variable in header

    Please login or register to see this code.

     

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

    Sorry that i quote you again @jgab but it did not work, even with variable in header

    Please login or register to see this code.

     

     

    A quick test in the emulator, with UHASSleepState declared in the header (88,99,100,101 not declared but defaults 'safe')

    Please login or register to see this code.

    works as expected in the emulator. 

    Please login or register to see this code.

    If you just add

    Please login or register to see this code.

    before or after the 'for' rule, do you get som log message when you set the variable?

    Posted
    20 minutes ago, jgab said:

    before or after the 'for' rule, do you get som log message when you set the variable?

    Did test with another variable and it seems to work. Must check why my normal variable does not have same effect. Will let you now. 
     

    Please login or register to see this code.

     

    Posted

    Good morning Jan,

    All scenes are still up and running and HC2 is up for 40 hours now.

    In my variables the mailbox list is growing is there a way to delete it automatically?

    Sometimes it happens I can not connect remote with my app the HC2. If I am outside and want to disarm its a kind off frustrated.

    Can I disarm my complex using Telegram? If yes how to do it?

    Please advice

    Posted

    @jgab think i found why repeat does not work when i add variable instead of time on my rule

    If scene is restarted for some reason it will never run this line anymore, only when variable is triggered

     

    Please login or register to see this code.

    Possible to solve it some how or just stick to clock time setup?

  • Topic Author
  • Posted
    47 minutes ago, jompa68 said:

    @jgab think i found why repeat does not work when i add variable instead of time on my rule

    If scene is restarted for some reason it will never run this line anymore, only when variable is triggered

     

    Please login or register to see this code.

    Possible to solve it some how or just stick to clock time setup?

     

    It's simple. 

    Please login or register to see this code.

    .start() triggers the rule once when it starts up. If the condition (dwSensors:safe & pirSensors:safe & $VSL_sleep_5 == 'Sover') is true it will start to repeat

  • Topic Author
  • Posted
    On 6/20/2019 at 7:32 AM, Sjakie said:

    Good morning Jan,

    All scenes are still up and running and HC2 is up for 40 hours now.

    In my variables the mailbox list is growing is there a way to delete it automatically?

     

    Default is that one variable is created per ER scene (ID) - unless you have set _MAILBOXES to a higher number. There is no automatic way to date them but you could run

    Please login or register to see this code.

    to remove them all. However you need to restart the ER scenes afterwards so the ones that exists can recreate their GVs.

     

    On 6/20/2019 at 7:32 AM, Sjakie said:

    Sometimes it happens I can not connect remote with my app the HC2. If I am outside and want to disarm its a kind off frustrated.

    Can I disarm my complex using Telegram? If yes how to do it?

    Please advice

     

    Yes, the node-red flow has support to get messages from Telegram

    You need to setup a chatbot according to instructions for the Telegram node-red node. Search the posts in the event runner thread for Telegram to get more tips. 

    When you can get a Telegram message into ER (of type #telegram{msg=<message>}) it is simple to make rules

    Ex.

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    50 minutes ago, jgab said:

     

    Default is that one variable is created per ER scene (ID) - unless you have set _MAILBOXES to a higher number. There is no automatic way to date them but you could run

    Please login or register to see this code.

    to remove them all. However you need to restart the ER scenes afterwards so the ones that exists can recreate their GVs.

     

    This is a bit more advanced, only removes variables that don't have a corresponding scene

    Please login or register to see this code.

     

    Posted

    I have telegram running on my NR and ER

    Please login or register to see this attachment.

    works perfect. Can arm/disarm alarm remotely that way also. 

    Posted

    I am jalours!

    Posted
    14 minutes ago, Sjakie said:

    I am jalours!

    Can export my flow and ER setup later today

    • Thanks 1
    Posted

    Hi jompa,

    that should be great, thanks in advance!!

    Posted

    Here is my Node-Red flow for telegram
    There is some info how to setup in flow. If you find it difficult you are welcome to ask. Trickiest part is to setup a bot and get chatID and Token.

    Please login or register to see this code.

    My lua code for telegram
    Can also turnOn/turnOff devices or room, change variables.

    Please login or register to see this code.

     

     

    Posted

    Hello guys,

    Jompa thanks for the info, Ialready have a part of it got it from Jan a while ago in the extended NodeRed flow

    I feel myself at the center of the Forrest without any navigation.

    What did I do (wrong)?

    In the Nodered from Jan SonosPollyTts is working since the beginning.

    TelegramBot was working via a Lua scene in HC2, not by ER.

    Jompa I checked all settings and did get not any message on my phone BUT I saw the test message in the debug window in NodeRed!!! So I was looking on the wrong screen,hahaha.

    23-6-2019 12:15:10

    Please login or register to see this link.

    echo : msg.payload : Object

    object

    data: "can I see this in NodeRed?"
    type: "echo"
    _from: 1608
    1608 is Telegram scene from Jan

     -------------- Trigger rules-----------------------------

    Rule.eval("#telegram{msg='$msg'} => cmd=msg.content; log('Telegram command:%s',cmd)")

    function telegram(ref,msg)
        local tmsg = _copy(ref)
        tmsg.content=msg
        Event.postRemote(_myNodeRed,{type='telegram',msg=tmsg})
    end    
        
        
        
     
      Rule.eval("#telegram{msg='disarm'} => post(#alarmOff)")
     
     -- rule("remote(NodeRed,#echo{data='test'})")
    rule("#response{data='$d'} => log('Got back:%s',d.data)")
      Rule.eval("@08:00 => $Telegram='Pillen innemen'")
      Rule.eval("@17:00 => $Telegram='Pillen innemen'")
      Rule.eval("@23:00 => $Telegram='Pillen innemen'")
     
       Rule.eval("@12:14 => $Telegram='test telegram jgab'")
     
      -- Now you post to a node-red server this way

    NodeRed = "http://192.168.1.89:1880/eventrunner" -- save url to server

    Event.postRemote(NodeRed,{type='echo', data='test'})

    -- or

    rule("remote(NodeRed,#echo{data='test'})")
     
      rule("remote(NodeRed,#echo{data='test 3'})")
     

    BUT this works only ( getting the message on my phone) if the lua scene is active?????????????????? So what I am doing wrong?

    Your scene for telegram iI inserted in the ESeneID

    Thanks in advance,

    Please advice

     

     
    Posted

    mmmh something also to correct

    We noticed 5 failed login attempts to your HC2-055203 that seemed suspicious.
    For your security, the following IP address: 192.168.1.89 has been locked for 30 minutes.

     

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