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



jgab

Recommended Posts

Hello Jan,

A while ago you helped me with Hue lights to flicker I gues its wrong now:

Please login or register to see this image.

/monthly_2019_08/image.png.47ff7d8a143732da1aaffac32da6e965.png" />

 

 --ALARM LIGHTS FLIKKERING
 
   colorParams2={  -- Table of color values
    {bri=245, hue=65535, sat=250, transitiontime=1, col=0},
    {bri=50, hue=65535, sat=250, transitiontime=1, col=0},
     {bri=245, hue=65535, sat=250, transitiontime=1, col=0},
    {bri=50, hue=65535, sat=250, transitiontime=1, col=0},
     {bri=245, hue=65535, sat=250, transitiontime=1, col=0},
    {bri=50, hue=65535, sat=250, transitiontime=1, col=0},
     {bri=245, hue=65535, sat=250, transitiontime=1, col=0},
    {bri=50, hue=65535, sat=250, transitiontime=1, col=0},
     {bri=245, hue=65535, sat=250, transitiontime=1, col=0},
    {bri=50, hue=65535, sat=250, transitiontime=1, col=0},
        }
 
  -- Every 15s, pick a new value from colorParams, wrap around at end of table.
  colorShow2 = Rule.eval([[@@00:00:08  =>
    alarmlights:value=colorParams2[colorIndex2];
         colorIndex2=(colorIndex2 % size(colorParams2))+1
    ]]).disable() -- Start disabled, next rules enable us.


  ---- in case of alarm after sunset the light will switch on
          Rule.eval(" ([email protected]) & #AlarmStateUit => wait(00:00:10); woonkamer.ambitvlight:on; wait(00:00:02) ; woonkamer.lampplafondtvzijde:on; wait(00:00:02); woonkamer.lampplafondklokzijde:on; wait(00:00:02); voortuin.spotvlag:on; wait(00:00:02); achtertuin.spotbudha:on; wait(00:00:02); achtertuin.spotfontein:on; wait(00:00:02); achtertuin.spotfontein:on; wait(00:00:02); woonkamer.spotbeeldlinks:on; wait(00:00:02); woonkamer.spotschilderijlinks:on; wait(00:00:02); woonkamer.spotkastlinks:on; colorIndex2=1; enable(colorShow2)") -- Start show
 
        Rule.eval("trueFor(00:15, alarmapp.alarmrelais:isOff)) => {woonkamer.spotbeeldrechts, woonkamer.spotschilderijrechts, woonkamer.spotstoelsjaak}:off")
 

 

Link to comment
Share on other sites

  • Topic Author
  • 18 minutes ago, Sjakie said:

    Hello Jan,

    A while ago you helped me with Hue lights to flicker I gues its wrong now:


      ---- in case of alarm after sunset the light will switch on
              Rule.eval(" ([email protected]) & #AlarmStateUit => wait(00:00:10); woonkamer.ambitvlight:on; wait(00:00:02) ; woonkamer.lampplafondtvzijde:on; wait(00:00:02); woonkamer.lampplafondklokzijde:on; wait(00:00:02); voortuin.spotvlag:on; wait(00:00:02); achtertuin.spotbudha:on; wait(00:00:02); achtertuin.spotfontein:on; wait(00:00:02); achtertuin.spotfontein:on; wait(00:00:02); woonkamer.spotbeeldlinks:on; wait(00:00:02); woonkamer.spotschilderijlinks:on; wait(00:00:02); woonkamer.spotkastlinks:on; colorIndex2=1; enable(colorShow2)") -- Start show
     
            Rule.eval("trueFor(00:15, alarmapp.alarmrelais:isOff)) => {woonkamer.spotbeeldrechts, woonkamer.spotschilderijrechts, woonkamer.spotstoelsjaak}:off")
     

     

     

    It's the "Rule.eval(" (su[email protected]ise) ..." that causes the error.

    Should probably be

    Rule.eval("#AlarmStateUit & sunset..sunrise  => ...

     

    Link to comment
    Share on other sites

    Sorry for this stupid error.

    Great that in this version shows the error.

    Have a good night,

     

    Link to comment
    Share on other sites

    Tonight I discovered that my door lock wouldn't lock. 

    The rule is like this.

    @22:00 => frontdoor.doorlock:wake; wait(00:00:10); frontdoor.doorlock:secure.

     

    Error messageID

    :373 does not support action 'wakeUpDeadDevice
     

    Is this something that will work in the future?

    Link to comment
    Share on other sites

  • Topic Author
  • Thanks, I had missed that.

    I'll have a new version for tomorrow morning with a fix for that (and some more stuff)

    Link to comment
    Share on other sites

    13 hours ago, jgab said:

    The #VirtualSensor event that you receive in B you re-post inside B as a #property event - this will look exactly like a fibaro trigger for the rules.

    You can then reat them like any device that have triggered B and do things like this in B:

    Please login or register to see this code.

    Was that an answer to you question?

    i have now setup like this but not 100% working solution, have i done something wrong with my logic?

    Please login or register to see this code.

    Debug(from ZBS)

    I see posting but do not turnOn lights

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 8 minutes ago, jompa68 said:

    i have now setup like this but not 100% working solution, have i done something wrong with my logic?

    Please login or register to see this code.

    Debug(from ZBS)

    I see posting but do not turnOn lights

    Please login or register to see this code.

     

     

    You accidentally quoted the device variables (pirSensor.kallaren, dwSensor.kallardorr), you want their values.

    Please login or register to see this code.

     

    Because you can only get #VirtualSensor from the 2 sensors you subscribe to you can make one generic handler for incoming #VirtualSensorns

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    3 minutes ago, jgab said:

    You accidentally quoted the device variables, you want their values.

    Ah! an small ' have the power to destroy everything. Thanks @jgab ?

    Link to comment
    Share on other sites

     

    @jgab how can i decrease the sonos tts to only 1 time when coffee timer have stop(now it say tts 2 times)

     

    Please login or register to see this code.

    more debug

    Please login or register to see this code.

     

    Edited by jompa68
    Link to comment
    Share on other sites

  • Topic Author
  • 25 minutes ago, jompa68 said:

     

    @jgab how can i decrease the sonos tts to only 1 time when coffee timer have stop(now it say tts 2 times)

    Please login or register to see this code.

     

     

    Can you post me the rules? (I tried the coffee rule in an earlier post and I only get one notification after the timer expires)

    Can it be that you have kafferyggaren both as an VirtualDevice and also declared it as a trigger in the scene? (I guess you would get double triggers then)

    Link to comment
    Share on other sites

    1 minute ago, jgab said:

     

    Can you post me the rules? (I tried the coffee rule in an earlier post and I only get one notification after the timer expires)

    Can it be that you have kafferyggaren both as an VirtualDevice and also declared it as a trigger in the scene? (I guess you would get double triggers then)

     

     

    Please login or register to see this code.

    i have both power and value in header, should not be a problem, or?

    Link to comment
    Share on other sites

  • Topic Author
  • 13 minutes ago, jompa68 said:

     

     

    Please login or register to see this code.

    i have both power and value in header, should not be a problem, or?

    Hmm, every time you set coffeeTimer it will trigger the trueFor rule (because the left hand side contains $coffeeTimer).

    THis is normally not a problem... but my suspicion is that the loop that counts down coffeeTimer sets coffeeTimer to 0, just after the trueFor has become true. The problem is that the trueFor makes a wait (for the sonos) before it turns off kafferyggaren. During that wait, the trueFor is triggered by coffeeTimer becoming zero and runs the action again.

    When a rule makes a 'wait' there is the potential that another rule is scheduled in.

    The solution is to move turning off kafferyggaren earlier, before the wait.

    Please login or register to see this code.

    Try that and see if it works.

    Link to comment
    Share on other sites

    6 minutes ago, jgab said:

    Try that and see if it works.

    Yeah, did work perfect.
    Another question, how come log say 

    Please login or register to see this code.

    but i set it to 02:10 in rule

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • Maybe the rule is overly complicated. Maybe this works (no need for trueFor as we can test on coffeeTimer==0)

    Please login or register to see this code.

     

    3 minutes ago, jompa68 said:

    Yeah, did work perfect.
    Another question, how come log say 

    Please login or register to see this code.

    but i set it to 02:10 in rule

    Please login or register to see this code.

     

     

    How does the rest of the dishwasher rules look like? Seems like HM is broken or HM is called with strange value.

    Link to comment
    Share on other sites

    @jgab

    I have problem with hue support in v3:

     

    Please login or register to see this code.

    result is error in ZBS:

     

    [31mSat/Aug/03,11:50:18:[217:1] Error in 'HueVypinacChodbaPrizemiDvere:buttonevent => log('Hue key:%s',HueVypinacChodbaPrizemiDvere:buttonevent)': EventRunnerLights.lua:2159: attempt to index a nil value
    [31mSat/Aug/03,11:50:18:[217:1] 
    Line 2157:    ['%set'] = function(e,s) if isTriggerVar(e[2]) or isGlob(e[2]) then error("Can't assign variable in rule header") end end,
    Line 2158:    ['%prop'] = function(e,s) 
    Line 2159:>>>      if not getFuns[e[3]][4] then return end
    Line 2160:      local pn = getFuns[e[3]][2]
    Line 2161:      local cv = ScriptCompiler.compile2(e[2])
    [0m
    [31mSat/Aug/03,11:50:18:[217:1] Error loading rules:EventRunnerLights.lua:2288: EventRunnerLights.lua:2159: attempt to index a nil value
     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, petrkl12 said:

    @jgab

    I have problem with hue support in v3:

    Please login or register to see this code.

     

     

    Ok, it should work again - pushed v3, B32.

     

    I'm trying to come up with a smother model for "user defined" devices like Hue lights with user defined properties. It should be much easier to create them.

    Link to comment
    Share on other sites

    16 hours ago, sonnyboy said:

    Tonight I discovered that my door lock wouldn't lock. 

    The rule is like this.

    @22:00 => frontdoor.doorlock:wake; wait(00:00:10); frontdoor.doorlock:secure.

     

    Error messageID

    :373 does not support action 'wakeUpDeadDevice
     

    Is this something that will work in the future?

     

    16 hours ago, jgab said:

    Thanks, I had missed that.

    I'll have a new version for tomorrow morning with a fix for that (and some more stuff)

     

    Now this works again :)

    Thank you!

    will se if i can find som more tonight ;) 

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