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

Jan,

Goodmorning, is it possible to integrate the IPhone alarm as trigger in HC2 or HC3?

Thanks in advance,

//Sjakie

Link to comment
Share on other sites

  • Topic Author
  • 49 minutes ago, Sjakie said:

    Jan,

    Goodmorning, is it possible to integrate the IPhone alarm as trigger in HC2 or HC3?

    Thanks in advance,

    //Sjakie

    You can create a iPhone shortcut. There you create a "Personal automation" (at the bottom of the first screen) and select alarm as trigger and the Home Center app as action.

    Unfortunately you can only choose to run a scene on the HC3. So you need to make a simple scene that calls ER4 or ER3 with the event needed. 

    2 minutes ago, jgab said:

    You can create a iPhone shortcut. There you create a "Personal automation" (at the bottom of the first screen) and select alarm as trigger and the Home Center app as action.

    Unfortunately you can only choose to run a scene on the HC3. So you need to make a simple scene that calls ER4 or ER3 with the event needed. 

    Actually, it would be possible to have a web action that calls the HC3 API directly.

    Link to comment
    Share on other sites

    Thanks will look into it later I started again with ER4

    but???

    This rule is copied from HC2

     

    Util.defTriggerVar("openVanBuitenDeurToilet",false)

    rule([[toilet.deur:breached =>
        log('Check!!!!!!!!!! - toilet.pir:safe %s',toilet.pir:safe); log('Check!!!!!!!!! - toilet.deur:safe %s',toilet.deur:safe);
        || toilet.pir:safe >> openVanBuitenDeurToilet=true; toilet.Spottoilet:on; 
        || toilet.pir:breached >> openVanBuitenDeurToilet=false; toilet.Spottoilet:off; 
                ]])

    rule("openVanBuitenDeurToilet==true => log('DEFTRIGGER >>>>>>>>>>>>>>>openVanBuitenDeurToilet true')")
    rule("openVanBuitenDeurToilet==false => log('DEFTRIGGER >>>>>>>>>>>>>>openVanBuitenDeurToilet false')")

    rule("openVanBuitenDeurToilet==true => toilet.Spottoilet:on; log('DefTrigger maaktttttttttt  Spottoilet toilet - aan')")

     

    Unfortuanally it doest switch the toilet light on!

    In debug I see log('Check.........

    But no true rule openvanbuitendeurtoilet??

    If I add toilet.Spottoilet:on; it will switch light on.

    Jan what I am doing wrong?

     

    //Sjakie

    The deftrigger doest operate

    Link to comment
    Share on other sites

    Jan, toilet light is working now with sometimes a miis.

    What is the correct notation in ER4 for:

    fibaro.alert('push', {[1] = 2, }, 'HC3 rebooted')
     
    Thanks in advance,
    //Sjakie
    Link to comment
    Share on other sites

  • Topic Author
  • 8 hours ago, Sjakie said:

    Jan, toilet light is working now with sometimes a miis.

    What is the correct notation in ER4 for:

    fibaro.alert('push', {[1] = 2, }, 'HC3 rebooted')
     
    Thanks in advance,
    //Sjakie

     

    rule("... => 2:push='HC3 rebooted'")

    You can also write 

    rule("... => fibaro.alert('push', {2}, 'HC3 rebooted')")

    Link to comment
    Share on other sites

    Thanks Jan thats working great the msg if HC3 is rebooted.

    Other small problem:

    - I did a HomeTable in QA >> can it show in debug the list of devices?

    - I have one device who gives an error if name is being used >>no trigger?

      if I use the number it shows the action so I checked the name if I copy/past it still give an error

    Thanks,

    //Sjakie

     

    Link to comment
    Share on other sites

  • Topic Author
  • 3 hours ago, Sjakie said:

    Thanks Jan thats working great the msg if HC3 is rebooted.

    Other small problem:

    - I did a HomeTable in QA >> can it show in debug the list of devices?

    - I have one device who gives an error if name is being used >>no trigger?

      if I use the number it shows the action so I checked the name if I copy/past it still give an error

    Thanks,

    //Sjakie

     

    You want to print the HT table?

    You can print out the HT in a readable format with

    Please login or register to see this code.

     

    self:prettyJsonStruct(<table>) returns a readable string representation of the table that is indented and with newlines.

    Link to comment
    Share on other sites

    On 11/17/2020 at 7:55 AM, jgab said:

    Please login or register to see this code.

    90min is 00:90, or 01:30

    Parenthesis missing and misplaced, I changed a bit.

    trueFor(<time>,<expression>)

    takes 2 argument, a time and and expression that should be true for that time.

    Now it triggers on key 2 for Pressed, Pressed2. etc. You could add

    Rule("Matrix:central.keyId==2 & Matrix:central.keyAttribute=='Pressed' => Heating:on")

     

     

    @ is a timmer that starts the rule at a specific time. To test a time use interval test <timeA>..<timeB>

    In general you don't need to use global variables ($) unless you use it to communicate with other scenes

     

    Please login or register to see this code.

    The last rule turns off the light if light is on and door is safe for 10min (both) during the sunset..sunrise period.

     

    Hi 

    This syntax fails - towel_dryer = matrix_badV + 5

    is is not possible, or how should I write it ?

     

    matrix_badV = 182
    towel_dryer = matrix_badV + 5 -- 187 Device/Switch 
    Rule("@06:15 & wday('mon-fri') => towel_dryer:on")

     

    Link to comment
    Share on other sites

  • Topic Author
  • 15 hours ago, ChristianSogaard said:

     

    Hi 

    This syntax fails - towel_dryer = matrix_badV + 5

    is is not possible, or how should I write it ?

     

    matrix_badV = 182
    towel_dryer = matrix_badV + 5 -- 187 Device/Switch 
    Rule("@06:15 & wday('mon-fri') => towel_dryer:on")

     

    Sorry I don't understand 

    towel_dryer = matrix_badV + 5

    is ok syntax ?

    Link to comment
    Share on other sites

    @jgab Can You please tell me how to convert scene like this (with ID Central Scene and it's buttons) to ER4? 

     

    Please login or register to see this image.

    /monthly_2021_01/1245120972_Zrzutekranu2021-01-4o15_38_55.png.946c614060f372304a52d33fa50304ea.png" />

    Link to comment
    Share on other sites

  • Topic Author
  • 28 minutes ago, michal85pl said:

    @jgab Can You please tell me how to convert scene like this (with ID Central Scene and it's buttons) to ER4? 

    My polish is not good :-) Have to guess a bit. The condition (left) is it AND or OR ?

    If I have guessed right it could be something like:

    Please login or register to see this code.

    If you double-click. on key 1 and the salon lamps are on, then turn on the 'binary' lamps.

     

    Link to comment
    Share on other sites

    10 minut temu, jgab napisał:

    My polish is not good :-) Have to guess a bit. The condition (left) is it AND or OR ?

    If I have guessed right it could be something like:

    Please login or register to see this code.

    If you double-click. on key 1 and the salon lamps are on, then turn on the 'binary' lamps.

     

    OK, will be easier if I write it down :)

     

    For example I want to achieve:

    Lamp1:isOff & Lamp2isOff & Double press button 1 > turn both lamps on

    Lamp1:isOn & Lamp2IsOff & Single press button 1 > turn of lamp1

     

     

    This modules has 5 devices:

     

    1030364170_Zrzutekranu2021-01-4o16_32_31.png.ea87031a2f8dd1ff384f3c4f745ff57a.png

     

    Link to comment
    Share on other sites

  • Topic Author
  • 5 minutes ago, michal85pl said:

    For example I want to achieve:

    Lamp1:isOff & Lamp2isOff & Double press button 1 > turn both lamps on

    Lamp1:isOn & Lamp2IsOff & Single press button 1 > turn of lamp1

    Please login or register to see this code.

     

    Alternatively

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    On 1/2/2021 at 5:56 AM, jgab said:

    Sorry I don't understand 

    towel_dryer = matrix_badV + 5

    is ok syntax ?

    I wanted to create a new variable - towel_dryer (this is Key 2 on Matrix )

    matrix has device ID 182 

    So new variable based on first variable with device ID 182 +1+2+2 = 187

    I hope i explained it better ?

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, ChristianSogaard said:

    I wanted to create a new variable - towel_dryer (this is Key 2 on Matrix )

    matrix has device ID 182 

    So new variable based on first variable with device ID 182 +1+2+2 = 187

    I hope i explained it better ?

    It should work if you do 

    Please login or register to see this code.

    'towel_dryer' should be accessible inside the rule.

    Note that it has to be a Lua global. You can't declare it local

    local towel_dryer = matrix_badV + 5 -- Will not work!

     

    You could also create a rule variables

    Please login or register to see this code.

    towel_dryer and matrix_badV is only accessible inside rules and not visible to outside Lua code.

    • Thanks 1
    Link to comment
    Share on other sites

    2 minuty temu, jgab napisał:

    rule([[button:central.keyId==1 & button:central.keyAttribute=='Pressed2' & Lamp1:isOff & Lamp2:isOff => {Lamp1,Lamp2}:on]])

    It doesn't work...and I think I can't because rule doesn't know which button check?, we have "button:central.keyId==1" but from  which module should it take from? maybe I get it wrong?

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, michal85pl said:

    It doesn't work...and I think I can't because rule doesn't know which button check?, we have "button:central.keyId==1" but from  which module should it take from? maybe I get it wrong?

    button is a variable that should be assigned the deviceId of the remote/keypad

    Ex. rule("button=88")

    You could write

    rule([[88:central.keyId==1 & 88:central.keyAttribute=='Pressed2' & 99:isOff & 88:isOff => {99,88}:on]])

    but using rule variables are more convenient

    Edited by jgab
    Link to comment
    Share on other sites

     

    rule([[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &

           486:isOff & 487:isOff => {486,487}:on]])

     

    i recieve: 

     

    [QUICKAPP453]: in Rule:7[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &...]: {"err":".\/include\/EventRunner.lua:1851: bad deviceID 'nil' for '%prop' '\"button\"?'","src":"Rule:7[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &...]","msg":"Error executing instruction:'[\"%prop\",1,\"central\"]'","ERR":true}

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, michal85pl said:

     

    rule([[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &

           486:isOff & 487:isOff => {486,487}:on]])

     

    i recieve: 

     

    [QUICKAPP453]: in Rule:7[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &...]: {"err":".\/include\/EventRunner.lua:1851: bad deviceID 'nil' for '%prop' '\"button\"?'","src":"Rule:7[485:central.keyId==2 & button:central.keyAttribute=='Pressed2' &...]","msg":"Error executing instruction:'[\"%prop\",1,\"central\"]'","ERR":true}

    You missed second 'button' in the rule

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    3 minuty temu, jgab napisał:

    You missed second 'button' in the rule

    Please login or register to see this code.

     

    OMG...sorry for that, too many hours in front of the screen

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