Reactor Sensor for LightWave Scene Selector

image

This is the switch.
The area in red shows up as device 219, the area in blue shows up as device 220.
Hitting “ALL OFF” on device 220 is doing a fast reset of device 219

Is this RFXtrx operating 219 as an impulse switch? Scene? What’s doing the quick reset?

Here’s how it shows up in rfxtrx controller:
image
219 is a simple on/off switch. Status goes to 1 when you press the top button, 0 when you press the bottom button

OK, so how is the fast transition accomplished? Is it the RFXtrx plugin doing it automatically? What’s the configuration of “ALL OFF”?

I think rfxtrx is doing it automatically.
Which configuration? Reactor?

OK. I think I’ve got the picture.

The current stable release on Github (3.3develop-19178) should handle the RFXtrx transition a little better, at least for now.

This version also implements a new “updates” operator for device state conditions. This will trigger a true pulse (like the “changes” operator with no terminal values) when a state variable is rewritten if Vera sends watch callbacks for that change–Vera/Luup does not do that for all variables, but it does it for sl_SceneActivated and sl_SceneDeactivated, which is what we need.

If you would, please try your “ALL OFF” using the 0 → -1 check, to confirm that the timing fix works.

Once we’ve established that that is work, then you can go back to checking sl_SceneDeactivated.

Edit: install instructions, if needed…

  1. Go to the Github stable branch
  2. Click the green “Clone or download” button and choose “Download ZIP”
  3. Unzip the zip file to a folder.
  4. Upload the unzipped files by selecting them all and dragging the group to the upload tool at Apps > Develop apps > Luup files. This will also reload Luup after the uploads are done.
  5. Hard-refresh your browser.

Just managed to test.
All Off using 0 → -1 does work.
Using the new UPDATES operator also works. :smile::smile:

1 Like

Just confirming, you mean/tried “UPDATES”?

yes - UPDATES, not CHANGES.

1 Like

Woot! That’s awesome!

I’ve been moving my vera scenes to reactor over the weekend and have one final issue.
If I select a scene, then all off, then the same scene again the sensor will not trip as it is still tripped from before.
Is there any way round this?

Please post a logic summary

Here you go.
The last 3 steps are me pressing Scene 1 (successful as it changes from 113 to 111), All Off then Scene 1 again (unsuccessful as it the sensor is still 111 from the previous button press)

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.3develop-19178 config 19178 cdata 19082 ui 19178 pluginDevice 73
    System: Vera version 1.7.4320 on Sercomm NA301; loadtime 1561981479; systemReady 1561981493; Lua 5.1
Local time: 2019-07-01T13:30:18+0100; DST=1; Tonbridge, England United Kingdom
House mode: plugin 2; system 2; tracking off
  Sun data: { "stamp": 2019182, "civdawn": 1561950045, "nautdawn": 1561945803, "sunset": 1562012264, "nautdusk": 1562019300, "latitude": 51.1953, "astrodusk": null, "longitude": 0.27363, "civdusk": 1562015058, "astrodawn": null, "sunrise": 1561952839 }
  Geofence: not running
====================================================================================================================================
MasterBed Reactor (#277)
    Version 19082.21 06/28/19 18:32:18
    Message/status: Not tripped
    Condition group "Master Bedroom" (AND) false as of 06-26.15:33:22 <root>
      &-F-group "Main Switch" (AND) false as of 06-26.15:33:22 <grpetjp6tt>
      |     &-F-service MastBed Main Switch (219) urn:upnp-org:serviceId:SwitchPower1/Status = 1 [-1 => 0 at 13:29:58; F/F as of 06-29.22:25:38/06-29.22:25:38] <condetjpjcy>
      |     &-T-group "Scene 1" (AND) TRUE as of 13:29:51 <grpetjq9dm>
      |     |     &-T-service MastBed Mood Switch (220) urn:micasaverde-com:serviceId:SceneController1/sl_SceneActivated change ,111 [113 => 111 at 13:29:51; T/T as of 13:29:51/13:29:51] <condetjqe5e>
 [true at 13:29:51; T/T as of 13:29:51/13:29:51]      |     &-F-group "Scene 2" (AND) false as of 21:34:30 <grpetjqfky>
      |     |     &-F-service MastBed Mood Switch (220) urn:micasaverde-com:serviceId:SceneController1/sl_SceneActivated change ,112 [113 => 111 at 13:29:51; F/F as of 21:34:30/21:34:30] <condetjqksz>
 [true => false at 21:34:30; F/F as of 21:34:30/21:34:30]      |     &-F-group "Scene 3" (AND) false as of 13:29:51 <grpetjqlwi>
      |     |     &-F-service MastBed Mood Switch (220) urn:micasaverde-com:serviceId:SceneController1/sl_SceneActivated change ,113 [113 => 111 at 13:29:51; F/F as of 13:29:51/13:29:51] <condetjqsir>
 [true => false at 13:29:51; F/F as of 13:29:51/13:29:51]      |     &-F-group "All Off" (AND) false as of 13:30:00 <grpetjqtuq>
      |     |     &-F-service MastBed Mood Switch (220) urn:micasaverde-com:serviceId:SceneController1/sl_SceneDeactivated update  [1561981480 => 1561984198 at 13:29:58; F/F as of 13:30:00/13:30:00] <condetjqyqy>
 [true => false at 13:30:00; F/F as of 13:30:00/13:30:00] [false at 06-26.15:33:22; F/F as of 06-26.15:33:22/06-26.15:33:22]    Activity grpetjqlwi.true
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="25" )
        Device Master Bedroom Spots (59) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="25" )
    Activity grpetjp6tt.false
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Activity grpetjp6tt.true
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="100" )
    Activity grpetjqtuq.true
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
        Device Master Bedroom Spots (59) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Activity grpetjq9dm.true
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="75" )
        Device Master Bedroom Spots (59) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="75" )
    Activity grpetjqfky.true
        Device Master Bed Pendant (102) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
        Device Master Bedroom Spots (59) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="50" )
    Events
        07/01/19 12:44:47 reload: notice=Luup reload
        07/01/19 12:44:48 start: 
        07/01/19 12:44:49 condchange: newState=true, cond=condetjqyqy, oldState=false
        07/01/19 12:44:49 evalchange: newState=true, cond=condetjqyqy, oldState=false
        07/01/19 12:44:49 condchange: newState=true, cond=grpetjqtuq, oldState=false
        07/01/19 12:44:49 evalchange: newState=true, cond=grpetjqtuq, oldState=false
        07/01/19 12:44:49 startscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true
        07/01/19 12:44:49 runscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true, notice=Deferring scene execution; waiting for system ready.
        07/01/19 12:44:51 condchange: newState=false, cond=condetjqyqy, oldState=true
        07/01/19 12:44:51 evalchange: newState=false, cond=condetjqyqy, oldState=true
        07/01/19 12:44:51 condchange: newState=false, cond=grpetjqtuq, oldState=true
        07/01/19 12:44:51 evalchange: newState=false, cond=grpetjqtuq, oldState=true
        07/01/19 12:44:54 runscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true, group=1, notice=Starting scene group 1
        07/01/19 12:44:54 endscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true
        07/01/19 13:29:51 devicewatch: device=220, old="113", name=MastBed Mood Switch, var=urn:micasaverde-com:serviceId:SceneController1/sl_SceneActivated, new="111"
        07/01/19 13:29:51 condchange: newState=true, cond=condetjqe5e, oldState=false
        07/01/19 13:29:51 evalchange: newState=true, cond=condetjqe5e, oldState=false
        07/01/19 13:29:51 condchange: newState=true, cond=grpetjq9dm, oldState=false
        07/01/19 13:29:51 evalchange: newState=true, cond=grpetjq9dm, oldState=false
        07/01/19 13:29:51 condchange: newState=false, cond=condetjqsir, oldState=true
        07/01/19 13:29:51 evalchange: newState=false, cond=condetjqsir, oldState=true
        07/01/19 13:29:51 condchange: newState=false, cond=grpetjqlwi, oldState=true
        07/01/19 13:29:51 evalchange: newState=false, cond=grpetjqlwi, oldState=true
        07/01/19 13:29:51 startscene: scene=grpetjq9dm.true, sceneName=grpetjq9dm.true
        07/01/19 13:29:51 runscene: scene=grpetjq9dm.true, sceneName=grpetjq9dm.true, group=1, notice=Starting scene group 1
        07/01/19 13:29:51 endscene: scene=grpetjq9dm.true, sceneName=grpetjq9dm.true
        07/01/19 13:29:58 devicewatch: device=219, old="0", name=MastBed Main Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="-1"
        07/01/19 13:29:58 devicewatch: device=219, old="-1", name=MastBed Main Switch, var=urn:upnp-org:serviceId:SwitchPower1/Status, new="0"
        07/01/19 13:29:58 devicewatch: device=220, old="100", name=MastBed Mood Switch, var=urn:micasaverde-com:serviceId:SceneController1/sl_SceneDeactivated, new="100"
        07/01/19 13:29:58 condchange: newState=true, cond=condetjqyqy, oldState=false
        07/01/19 13:29:58 evalchange: newState=true, cond=condetjqyqy, oldState=false
        07/01/19 13:29:58 condchange: newState=true, cond=grpetjqtuq, oldState=false
        07/01/19 13:29:58 evalchange: newState=true, cond=grpetjqtuq, oldState=false
        07/01/19 13:29:58 startscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true
        07/01/19 13:29:58 runscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true, group=1, notice=Starting scene group 1
        07/01/19 13:29:58 endscene: scene=grpetjqtuq.true, sceneName=grpetjqtuq.true
        07/01/19 13:30:00 condchange: newState=false, cond=condetjqyqy, oldState=true
        07/01/19 13:30:00 evalchange: newState=false, cond=condetjqyqy, oldState=true
        07/01/19 13:30:00 condchange: newState=false, cond=grpetjqtuq, oldState=true
        07/01/19 13:30:00 evalchange: newState=false, cond=grpetjqtuq, oldState=true
        07/01/19 13:30:05 devicewatch: device=220, old="111", name=MastBed Mood Switch, var=urn:micasaverde-com:serviceId:SceneController1/sl_SceneActivated, new="111"

This isn’t the correct grouping. In order to detect your scene buttons, you need to test both conditions (value and updates) in an AND group per scene button. So, each button test will need to be a separate AND group. Each group should look like the image in this post.

So your logic for the buttons should look more like this:

Root group

  • Button 1 Group - AND
    • sl_SceneActivated equals 111
    • sl_SceneActivated updates
  • Button 2 Group - AND
    • sl_SceneActivated equals 112
    • sl_SceneActivated updates
  • Button 3 Group - AND
    • sl_SceneActivated equals 113
    • sl_SceneActivated updates
  • All Off
    • sl_SceneDeactivated updates

The “All Off” group doesn’t need a value test because we don’t care what the value is and it won’t be changing anyway, we just need to use updates to detect the rewrite.

Then, of course, each group should have the activity corresponding to its function.

Works perfectly - Thanks so much for your help!
For anybody interested in getting the LightWave Scene controller working with Reactor this is my working setup:

1 Like

Hi Patrick,

I have discovered an issue with the above setup…
The updates operator triggers when there is a LUUP reload.
Last night the dining room lights were turning on every 10-15 minutes by themselves. I’ve been testing today and worked out it is a LUUP reload that is causing the problem :face_with_raised_eyebrow:

Chris

Well, isn’t that a biscuit… OK. Sit tight, let me look into it…

Sure enough, Luup rewrites those variables on restart. Not sure why, but there it is. Easy enough to work around.

Download the latest stable version of L_Reactor.lua from Github by right-clicking on the link and choosing Save Link As… (or your browser’s closest equivalent). This particular method will make sure the file contents are not corrupted. Then use the uploader to Apps > Develop apps > Luup files to upload the file to your Vera, with a Luup restart when done.

That alone should do it.

I was going to look into what could cause the Vera to randomly LUUP reload but the answer seems to be “It just does…” :slightly_smiling_face:

Will I need to do anything when 3.3 is released or will all the “hotfix” changes I’ve made work themselves out?