Possible reactor question

I think I know the answer to this but wanted to be sure I’m not missing something (again)

I have a scene currently triggered when I press a button on a ZRC-90 that turns the kettle and kitchen lights on. In the summer the light doesn’t need to go on.

Do I need to use two reactor sensors to address this? Both including the button press but one only being true when it’s dark (which turns the light and the kettle), the other being true only when light (kettle only)

Any way to do it with one?

Cheers

C

As of 3.0, there are far fewer cases where multiple ReactorSensors are needed–you can get a lot done with multiple groups inside a single ReactorSensor. In fact, I pretty much have one RS per room in my “production” (spouse-facing) Vera environment, and depending on the room, a potentially large number of groups.

In your case, you could structure it something like this:

Root Group - NUL operator

  • Group “Button Pressed” – AND operator
    • Device state check of ZRC90 button press
  • Group “Winter or Night Button Pressed” – AND operator
    • Device state check of ZRC90 button press
    • Group “Winter or Night” – OR operator
      • Date/time between Oct 15 and Apr 15 or whatever dates mean winter to you
      • Sunrise/sunset between sunset and sunrise

Activities:

  1. “Button Pressed” is TRUE: turn on the kettle
  2. “Winter or Night Button Pressed” is TRUE: turn on the light
  3. All other activities empty/unused.

This is a straight-to-the-task implementation. I’m sure others could boil it down even more, but I think this is a good “readable” form.

Thanks, as ever. I shall give that a try!

C

OK, I think I have the conditions right with one small issue. I can’t see how to get the button press from the ZRC-90

When I select it in the query builder, I get this:

Device State: Master_Bedr_ZRC-90 (#7) NumButtons equals “9-1-9”

(16,1-1-1=ui7_lang_tap_button 1,2-1-2=ui7_lang_double_tap_button 1,3-1-3=ui7_lang_tap_button 2,4-1-4=ui7_lang_double_tap_button 2,5-1-5=ui7_lang_tap_button 3,6-1-6=ui7_lang_double_tap_button 3,7-1-7=ui7_lang_tap_button 4,8-1-8=ui7_lang_double_tap_button 4,9-1-9=ui7_lang_tap_button 5,10-1-10=ui7_lang_double_tap_button 5,11-1-11=ui7_lang_tap_button 6,12-1-12=ui7_lang_double_tap_button 6,13-1-13=ui7_lang_tap_button 7,14-1-14=ui7_lang_double_tap_button 7,15-1-15=ui7_lang_tap_button 8,16-1-16=ui7_lang_double_tap_button 8)

So I’ve set it to = 9-1-9 (Attempting to get a response from a tap of button 5) but I suspect that’s not what this means?

Here’s the logic summary

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 109
    System: Vera version 1.7.4453 on Sercomm G450; loadtime 1561481959; systemReady 1561481973; ALTUI v2.40; Lua 5.1
Local time: 2019-06-25T18:27:49+0100; DST=1
House mode: plugin 1; system 1; tracking on
  Sun data: { "stamp": 2019176, "civdawn": 1561431198, "nautdawn": 1561426614, "sunset": 1561494143, "nautdusk": 1561501628, "latitude": 51.7766, "astrodusk": null, "longitude": 0.11158, "civdusk": 1561497044, "astrodawn": null, "sunrise": 1561434099 }
  Geofence: not running
====================================================================================================================================
New_Morning_Lights (#132)
    Version 19082.9 06/25/19 18:03:53
    Message/status: Not tripped
    Condition group "Reactor Sensor 7" (NUL) false as of n/a <root>
      Z-?-comment "" <cond0>
      Z-F-group "grpes9c3cv" (AND) false as of 17:56:23 <grpes9c3cv>
      |     &-F-service Master_Bedr_ZRC-90 (7) urn:micasaverde-com:serviceId:SceneController1/NumButtons = 9-1-9 [16,1-1-1=ui7_lang_tap_button 1,2-1-2=ui7_lang_double_tap_button 1,3-1-3=ui7_lang_tap_button 2,4-1-4=ui7_lang_double_tap_button 2,5-1-5=ui7_lang_tap_button 3,6-1-6=ui7_lang_double_tap_button 3,7-1-7=ui7_lang_tap_button 4,8-1-8=ui7_lang_double_tap_button 4,9-1-9=ui7_lang_tap_button 5,10-1-10=ui7_lang_double_tap_button 5,11-1-11=ui7_lang_tap_button 6,12-1-12=ui7_lang_double_tap_button 6,13-1-13=ui7_lang_tap_button 7,14-1-14=ui7_lang_double_tap_button 7,15-1-15=ui7_lang_tap_button 8,16-1-16=ui7_lang_double_tap_button 8 at 17:56:23; F/F as of 17:56:23/17:56:23] <condes9c4ta>
      Z-F-group "grpes9cysw" (AND) false as of 17:56:23 <grpes9cysw>
      |     &-F-service Master_Bedr_ZRC-90 (7) urn:micasaverde-com:serviceId:SceneController1/NumButtons = 9-1-9 [16,1-1-1=ui7_lang_tap_button 1,2-1-2=ui7_lang_double_tap_button 1,3-1-3=ui7_lang_tap_button 2,4-1-4=ui7_lang_double_tap_button 2,5-1-5=ui7_lang_tap_button 3,6-1-6=ui7_lang_double_tap_button 3,7-1-7=ui7_lang_tap_button 4,8-1-8=ui7_lang_double_tap_button 4,9-1-9=ui7_lang_tap_button 5,10-1-10=ui7_lang_double_tap_button 5,11-1-11=ui7_lang_tap_button 6,12-1-12=ui7_lang_double_tap_button 6,13-1-13=ui7_lang_tap_button 7,14-1-14=ui7_lang_double_tap_button 7,15-1-15=ui7_lang_tap_button 8,16-1-16=ui7_lang_double_tap_button 8 at 17:56:23; F/F as of 17:56:23/17:56:23] <condes9d0o8>
      |     &-F-sun before sunrise+20, [1561482056 => 1561482234 at 18:03:54; F/F as of 17:56:23/17:56:23] <condes9dn4f>
    Activity grpes9c3cv.true
        Delay 1 start
        Device 5 (Kettle_Plug) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Activity grpes9cysw.true
        Delay 13 start
        Device 5 (Kettle_Plug) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device 15 (Kitchen_Lights) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Events
        06/25/19 17:59:28 start: 
        06/25/19 17:59:54 configchange: 
        06/25/19 18:00:46 configchange: 
        06/25/19 18:00:55 configchange: 
        06/25/19 18:03:53 configchange: 

Thanks!

C

You probably want to look at (test) sl_SceneActivated.

Also see caution/impending upgrade in this related topic: Reactor Sensor for LightWave Scene Selector - #2 by rigpapa - Reactor - Ezlo Community

Thanks

Reading the Lua log it appears that it’s
sl_CentralScene equals “9”

However that stays as a constant value until another button is pressed. This shouldn’t be an issue in the way that I use it, but I need to look at how to un-trip that condition without another button press or the kettle will come on a just after midnight (I think!)

Really appreciate your help!

C

That’s the linked post. Stay tuned for later update.

Yeah, read it now. Thanks!

Will hold off for it, seems the most sensible thing

C

Hi chap

So I am going to express extreme stupidity.

I don’t get the logic here :frowning:

I’ve managed to get the button presses to register and execute an action using the sl_CentralScene = and sl_CentralScene udpates.

But I’m completely baffled by the next step.

Can you use words of <1 syllable to explain how I can do this without two sensors? My primary issue is I can only see how to have 1 activity for true and 1 for false. This use case seems to have thee states:
Button pressed and daytime
Button pressed and night time
Button not pressed

Cheers!

C

That depends on what the next step is. You didn’t really explain that.

Ahh OK sorry :slight_smile:

So how to get from my use case to a functioning reactor sensor…

The original case:

Press a button on the ZRC90

When it’s day time: Switch the kettle on
When it’s night time: Switch the kettle on and turn the kitchen lights on

It’s simple with two sensors (clearly). Struggling to do it with one as it appears to me that three states are required (with 3 different activities)

  1. Button not pressed > No activity
  2. Button pressed at night > Kettle and lights
  3. Button pressed during the day > Kettle only.

I feel I must be missing something but…

Cheers

C

…annnnd I think I’ve just worked out the answer

C

OK, but just to follow up… only two states are required. The button not pressed state doesn’t matter.

And the only activities you care about are TRUE activities. No false transition should be given an activity (at least, not for the task explained in your reply).

You will need at least one group per button on the ZRC-90… each has its own “equals” comparison to the button number, and an updates operator. The group is an AND.

In the case where time of day also factors in, you can just add make a group with the button test for the correct button, and add the time of day test to the group.

So for button 1:

Group “Button 1 Pressed Daytime” – AND

  • Device State, ZRC-90, sl_CentralScene equals 1
  • Device State, ZRC-90, sl_CentralScene updates
  • Time between sunrise and sunset (for example)

Group “Button 1 Pressed Nighttime” – AND

  • Device State, ZRC-90, sl_CentralScene equals 1
  • Device State, ZRC-90, sl_CentralScene updates
  • Time between sunset and sunrise (note start/end swapped)

And then for button two, any time of day…

Group “Button 2 Pressed” – AND

  • Device State, ZRC-90, sl_CentralScene equals 2
  • Device State, ZRC-90, sl_CentralScene updates

Then, for activities, you place actions only in the TRUE state activities for each button group.

  • “Button 1 Pressed Daytime” is TRUE: turn the kettle on
  • “Button 1 Pressed Nighttime” is TRUE: turn on the kettle, turn on the lights
  • “Button 2 Pressed” is TRUE: frighten the cat, etc…

You can make as many groups as you want. All the buttons on the ZRC-90 (16 different scenes with double-press) can be handled in one ReactorSensor. Even if you add other conditions (like time of day), still all in the same ReactorSensor.

1 Like

Yep got there. What threw me was I didn’t realise that you each group’s status was separate. So a different activities are per group. Not sure how I can test but I’ll work that out :smiley:

Thanks, again!

C

Test is pretty easy. You can just watch the Status display. It will do a good job of telling you what’s going on. The only thing I’d recommend is adding a “delay reset” on each of the updates conditions of a few seconds. Normally, the pulse from that operator is so quick, it goes true and back to false faster than UI7 updates data, so you never see the transition (even though other things happen so you can prove it did occur). The additional delay on the reset will not affect the logic or delay these actions.

1 Like

Thanks, I’d just about got there as well :slight_smile:

Final question? Delay time: minutes? Seconds? Probably obvious, but I seem to be making a prat of myself so :smiley:

Cheers

C

If not otherwise marked, always seconds.

1 Like