Remotic ZRC90 Button use-case like a pulse-switch

I just integrated this Scene Controller on my VeraPlus (all good) I find it abstract to make it work a bit “like a switch”. I found 1 topic on the ZRC90 but it was missing a bit of logic to me.
So I created a sensor and “mapped” all buttons with their “single” and “double” click action, totalling to 16 combinations.

Eg. use-case

1 click on button-1 should make a light go ON
1 click again on THAT SAME button should turn the light off.

That is where the problem lies, I have a solution where I can turn the lamp OFF when I press eg. button 8 twice. Consider that a bit like an “OFF” switch. I wonder how to build my logic so it would be able to act a bit like a “pulse” ON-OFF-ON-OFF switch.

I’m not seeing it ;-(
Any golden tip ?

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.8-20262 config 20190 cdata 20045 ui 20190 pluginDevice 6374 LuaXP not loaded
    System: Vera version 1.7.4453 (pre-7.30) on Sercomm G450 ID nil (unknown); loadtime 1605548126/1605548137; systemReady 1605548167
       Env: Lua 5.1; JSON dkjson 1.2; UnsafeLua=nil/true
Local time: 2020-11-16T18:36:21+0100; DST=0; Rumst, Flanders Belgium; formats %m/%d/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": 1605507867, "nautdawn": 1605505441, "sunset": 1605542004, "nautdusk": 1605546635, "stamp": 2020321, "latitude": 51.1, "astrodusk": 1605548977, "longitude": 4.417, "civdusk": 1605544208, "astrodawn": 1605503098, "sunrise": 1605510071 }
  Geofence: not running
        RS: 1603605927,1604038587,1604185243,1605156827,1605535824,1605536067,1605536713,1605536904,1605539533,1605548137
        NS: 0:X,1589321640:U,1598767740:D,1598767800:U
************************************************************************************************************************************
ZRC90-1 Scenes (#6514)
    Version 20045.32 11/16/20 18:04:25
    Message/status: Not tripped
    Condition group "ZRC90-1 Control" (AND)  false as of 15:51:31 <root>
      &-T-group "Button-1-Single" (AND)  TRUE as of 18:04:48 <grpz0vo0fa>
      |     &-T-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,1 [15 => 1 at 18:04:48; T/T as of 18:04:48/18:04:48] <condz0vscp2>
      |     &-T-group "grpz0zlh6y" (OR)  TRUE as of 18:04:48 <grpz0zlh6y>
      |     |     |-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vt3cm>
      |     |     |-T-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,1 [15 => 1 at 18:04:48; T/T as of 18:04:48/18:04:48] <condz0zlv9x>
      &-F-group "Button-1-Double" (AND)  false as of 16:02:42 <grpz0vo1yw>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,2 [15 => 1 at 18:04:48; F/F as of 16:02:42/16:02:42] <condz0vubht>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vuuxe>
      &-F-group "Button-2-Single" (AND)  false as of 17:54:16 <grpz0vo31l>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,3 [15 => 1 at 18:04:48; F/F as of 17:54:25/17:54:25] <condz0vvlh1>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vvmht>
      &-F-group "Button-2-Double" (AND)  false as of 16:07:53 <grpz0vovcf>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,4 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vwuaw>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwuoy>
      &-F-group "Button-3-Single" (AND)  false as of 16:11:18 <grpz0vpldk>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,5 [15 => 1 at 18:04:48; F/F as of 17:52:18/17:52:18] <condz0vwvll>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwvrh>
      &-F-group "Button-3-Double" (AND)  false as of 16:07:53 <grpz0vpmau>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,6 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vwwfl>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwwjy>
      &-F-group "Button-4-Single" (AND)  false as of 16:11:08 <grpz0vpnrw>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,7 [15 => 1 at 18:04:48; F/F as of 16:11:18/16:11:18] <condz0vwxc3>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwxgg>
      &-F-group "Button-4-Double" (AND)  false as of 16:07:53 <grpz0vpopk>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,8 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vwy49>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwy8e>
      &-F-group "Button-5-Single" (AND)  false as of 16:07:53 <grpz0vpprd>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,9 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vwz1o>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vwz5e>
      &-F-group "Button-5-Double" (AND)  false as of 16:07:53 <grpz0vpr2d>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,10 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vx01n>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vx05q>
      &-F-group "Button-6-Single" (AND)  false as of 16:07:53 <grpz0vprh5>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,11 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vx1e6>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vx1hg>
      &-F-group "Button-6-Double" (AND)  false as of 16:07:53 <grpz0vr7xi>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,12 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vx24b>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vx28f>
      &-F-group "Button-7-Single" (AND)  false as of 16:07:53 <grpz0vreq1>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,13 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vxbps>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vxcbb>
      &-F-group "Button-7-Double" (AND)  false as of 16:07:53 <grpz0vrf45>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,14 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vxctj>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vxd1z>
      &-F-group "Button-8-Single" (AND)  false as of 18:04:39 <grpz0vrffv>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,15 [15 => 1 at 18:04:48; F/F as of 18:04:48/18:04:48] <condz0vxdqr>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vxdvr>
      &-F-group "Button-8-Double" (AND)  false as of 16:07:53 <grpz0vrfqi>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,16 [15 => 1 at 18:04:48; F/F as of 16:07:53/16:07:53] <condz0vxemr>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605546288 => 1605548127 at 18:35:38; F/F as of 18:04:49/18:04:49] <condz0vxer1>
    Activity grpz0vo0fa.false
        Device X-Lamp (6) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Activity grpz0vo0fa.true
        Device X-Lamp (6) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Events
        2020-11-16 18:35:37: Reactor startup (Luup reload)
        2020-11-16 18:35:37: Starting (Luup Startup/Reload)
        2020-11-16 18:35:38: Sensor update starting
        2020-11-16 18:35:38: Sensor update completed; 0.075s
    Devices
        ZWave (1) urn:schemas-micasaverde-com:device:ZWaveNetwork:1 (19/0); parent 0; plugin -; mfg  model ; dev D_ZWaveNetwork.xml impl 
        ZRC90-1 (6513) urn:schemas-micasaverde-com:device:SceneController:1 (14/0); parent 1; plugin -; mfg Remotec model ZRC-90; dev D_SceneController1.xml impl 
        X-Lamp (6) urn:schemas-upnp-org:device:BinaryLight:1 (3/1); parent 1; plugin -; mfg Fibaro model FGWPE/F-101; dev D_BinaryLight1.xml impl 
    Watches
        Device #6514 ZRC90-1 Scenes service urn:toggledbits-com:serviceId:ReactorSensor variable TestHouseMode
        Device #6513 ZRC90-1 service urn:micasaverde-com:serviceId:SceneController1 variable sl_CentralScene
        Device #6514 ZRC90-1 Scenes service urn:toggledbits-com:serviceId:ReactorSensor variable cdata
        Device #6514 ZRC90-1 Scenes service urn:toggledbits-com:serviceId:ReactorSensor variable TestTime

How about two separate conditions:
Condition: If light is on and button is pressed. Action: Turn light off.
Condition: If light is off and button is pressed. Action: Turn light on.

2 Likes

Don’t know about in Reactor, but in a Vera scene you would use a ToggleState action for the light.

When the scene is run whilst the light is off, it will turn it on. If you run the same scene again whilst the light is on it will turn it off etc.

Maybe you can use a ToggleState in Reactor for the light ?

1 Like

The ToggleState does not seems to actually switch the lamp.

First, good on ya for a great explanation of what you’re doing, the problem, and including the Logic Summary! Thank you!

Both @cw-kid and @TomD are on the right track. If the ToggleState action is not working for your device as @cw-kid suggests, then the condition structure suggested by @TomD is the next way to go. Put your button 1 condition back to look like all the others… looks like some experimentation going on, but “Button-1-Double” and “Button-2-Single” and so on are correct.

Then, add new condition groups using this approach:

Group “Button 1 Toggle” – NUL

  • Group “Button 1 On” – AND
    • Condition: Group State “Button-1-Single” is TRUE
    • Condition: Device State “X-Lamp” Status is FALSE
  • Group “Button 1 Off” – AND
    • Condition: Group State “Button-1-Single” is TRUE
    • Condition: Device State “X-Lamp” Status is TRUE

Then add activities to turn the light on when “Button 1 On” is true, and turn it off when “Button 1 Off” is true.

The downside of this approach, of course, is that it adds a bunch more groups.


Here’s another approach, much more compact, but a little less obvious until you see/try it:

Create an expression:
x_lamp_status = getstate( "X-Lamp", "urn:upnp-org:serviceId:BinaryLight1", "Status" )

Then, without adding any other condition groups, change the Activity for “Button-1-Single is TRUE” to:

  • Device State X-Lamp action “turn on/off” value { 1 - x_lamp_status }

The idea is that the state variable will always have the current state value of the lamp, either 0 or 1. When the activity runs, it will set the lamp’s state to the opposite of the status (1-0 = 1, 1-1 = 0, so the math toggles between 0 and 1).

NOTA BENE: Keep in mind that the updates condition operates so quickly that the UI can’t display it, so if you’re using the Status tab as confirmation that things are working, you’re going to have a bad time. For debugging, you can add a “delay reset” option to the group you are working on to slow things down and let the UI catch up. Be sure to remove it when done, as that will dampen the button response.

1 Like

Thanks all of you for providing some inputs. :vulcan_salute: :pray:
I’ve been testing with the “ToggleState” again now it seems to actually work. I did stop/start the reactor-sensor again to start clean.
So I’ve got some basic on-off-on-off etc working to test further and adding some refinements where needed.

@rigpapa indeed change happens so fast the UI is not a trustworthy debugger…

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.8-20262 config 20190 cdata 20045 ui 20190 pluginDevice 6374 LuaXP 1.0.2enh
    System: Vera version 1.7.4453 (pre-7.30) on Sercomm G450 ID nil (unknown); loadtime 1605553791/1605553804; systemReady 1605553834
       Env: Lua 5.1; JSON dkjson 1.2; UnsafeLua=nil/true
Local time: 2020-11-16T22:04:19+0100; DST=0; Rumst, Flanders Belgium; formats %m/%d/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": 1605507867, "nautdawn": 1605505441, "sunset": 1605542004, "nautdusk": 1605546635, "stamp": 2020321, "latitude": 51.1, "astrodusk": 1605548977, "longitude": 4.417, "civdusk": 1605544208, "astrodawn": 1605503098, "sunrise": 1605510071 }
  Geofence: not running
        RS: 1604038587,1604185243,1605156827,1605535824,1605536067,1605536713,1605536904,1605539533,1605548137,1605553804
        NS: 0:X,1589321640:U,1598767740:D,1598767800:U
************************************************************************************************************************************
ZRC90-1 Scenes (#6514)
    Version 20045.95 11/16/20 22:00:42
    Message/status: Not tripped
    Condition group "ZRC90-1 Control" (NUL)  false as of n/a <root>
      Z-F-group "Button-1-Single" (AND)  false as of 22:01:16 <grpz0vo0fa>
      |     &-T-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,1 [1 at 21:59:45; T/T as of 21:59:45/21:59:45] <condz185dh8>
      |     &-F-group "grpz189hpe" (AND)  false as of 22:01:16 <grpz189hpe>
      |     |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605560466 => 1605560476 at 22:01:16; F/F as of 22:01:16/22:01:16] <condz189k6a>
      |     |     &-T-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,1 [1 at 21:59:45; T/T as of 21:59:45/21:59:45] <condz189kxt>

    Activity grpz0vo0fa.true
        Device X-Lamp (6) action urn:micasaverde-com:serviceId:HaDevice1/ToggleState(  )

What’s up with the structure of that first group, though? You don’t need a nested group there… it should just look like the others you created…?

Hi,
Yep I was thinking about that construction and its purpose…
I’ve cleaned it up and now only have 2 conditions to be flagged true in order to trigger.

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.8-20262 config 20190 cdata 20045 ui 20190 pluginDevice 6374 LuaXP 1.0.2enh
    System: Vera version 1.7.4453 (pre-7.30) on Sercomm G450 ID nil (unknown); loadtime 1605553791/1605553804; systemReady 1605553834
       Env: Lua 5.1; JSON dkjson 1.2; UnsafeLua=nil/true
Local time: 2020-11-17T06:58:54+0100; DST=0; Rumst, Flanders Belgium; formats %m/%d/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": 1605594360, "nautdawn": 1605591928, "sunset": 1605628328, "nautdusk": 1605632973, "stamp": 2020322, "latitude": 51.1, "astrodusk": 1605635318, "longitude": 4.417, "civdusk": 1605630540, "astrodawn": 1605589582, "sunrise": 1605596572 }
  Geofence: not running
        RS: 1604038587,1604185243,1605156827,1605535824,1605536067,1605536713,1605536904,1605539533,1605548137,1605553804
        NS: 0:X,1589321640:U,1598767740:D,1598767800:U
************************************************************************************************************************************
ZRC90-1 Scenes (#6514)
    Version 20045.101 11/17/20 06:55:38
    Message/status: Not tripped
    Condition group "ZRC90-1 Control" (NUL)  false as of n/a <root>
      Z-F-group "Button-1-Single" (AND)  false as of 06:58:19 <grpz0vo0fa>
      |     &-T-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene change ,1 [15 => 1 at 06:56:46; T/T as of 06:56:46/06:56:46] <condz185dh8>
      |     &-F-service ZRC90-1 (6513) urn:micasaverde-com:serviceId:SceneController1/sl_CentralScene update  [1605592687 => 1605592699 at 06:58:19; F/F as of 06:58:19/06:58:19] <condz189k6a>
1 Like

What did you decide for implementation, extra groups or expression?

Since it turned out that the ToggleState function did work for the binary-switches I have plugged in around the house, I used that as an action and nothing more.
The basic use-case did not even required extra groups : basically I capture the sl_CentralScene value if a certain key is pressed AND combine it with a “changes” trigger.

So no separate “off” or “on” subgroups needed or something. In the “actions” section there is only 1 action (=ToggleState) when the Button-1-Single hits “True”

If I make my scenario’s more complex I guess I need to adapt this.
For example, currently this X-lamp on my desk is “ON” because it is getting darker outside, when I now press the “Button-1” the ToggleState will cause it to go out, but I need to add logic to prevent this under certain conditions, so subgroups will pop-up I guess.

Thx again for all the input. This ZRC90 module is not too bad : 16 combinations for a affordable price.

This ZRC90 module is not too bad : 16 combinations for a affordable price

Actually it has 32 combination which is way too complicated. But I like them and have one in almost every room where I don’t have a tablet.

32 ? You combine buttons ? Sure you can start having complex matrix :wink:
I find single-click + double-click for each of the 8 buttons already enough.
You have them labelled ? :wink:

I don´t use all combinations. As I said, it will too complicated, for me to remember and the family to accept … :crazy_face:
Each button has four combinations: single press, double press, long press, release button

How do you intercept “long press” of “release button” ?
If I run a “device spy” on this reactor sensor and I press a key for a long time…
So how do you use this in a scene?

Watching #6513 ZRC90-1; waiting for changes in device states…
urn:micasaverde-com:serviceId:SceneController1 / sl_CentralScene = “5”
urn:micasaverde-com:serviceId:SceneController1 / sl_CentralScene = “5”
urn:micasaverde-com:serviceId:SceneController1 / sl_CentralScene = “5”
urn:micasaverde-com:serviceId:SceneController1 / sl_CentralScene = “5”
urn:micasaverde-com:serviceId:HaDevice1 / BatteryDate = “1605639755”
urn:micasaverde-com:serviceId:HaDevice1 / BatteryLevel = “75”

If you go in to the device in the Vera you have “Select scenes for device buttons” where you can assign all the combination, OR under Reactor in Conditions you choose your Scene Contoller and apply sl_CentralScene - equals - 1-4 for Button 1, 5-8 for Button 2 etc …:
Like this:
“KNAPP”=“Button” :slightly_smiling_face:
I guess “Long press” and “Release Button” is 3 and 4 for Button 1, but I haven’t tested it

1 Like

Very strange, in the beginning I performed a “spy” on this device to learn all the sl_CentralScene values.

1=Button-1-Single Click
2=Button-1-Double Click
3=Button-2-Single Click
4=Button-2-Double Click

Basically :
1-3-5-7-9-11-13-15 are single clicks for each of the 8 button
2-4-6-8-10-12-14-16 are double-clicks for each of the 8 buttons

There are no other values for “long” presses or something as far as I found.

I have never seen this, and I usually don’t have to spy on them. All of my five-six units have been included easily and successfully in Vera and are shown in Reactor as described above. Mine are EU-units (BW8510EU) (ZRC-90EU) … :thinking: Do you have them as generic devices?

Nope, I’ve added them and selected in the Vera list this exact device. So “Add Device” → “Handheld” → “Remotec Scene Controller ZRC90” and followed the steps. Pairing went without issues etc.
I have exactly the same unit as you.

and firmware on the Vera? :thinking:

Not the latest one …
Running Version 1.7.4453 while the latest Version = 1.7.5186

I know it will break things if I upgrade. I’m happy and everything works for what I need it. Don’t think I will ever upgrade this VeraPlus.
It will probably break my Visonic plugin etc and nobody maintains this anymore etc.