Noob question for Reactor with FGS213 S1 multiple input

Ok, this is my first approach to Reactor, and I’m not even sure if this is the right path.
I have a Fibaro FGS 213 that is now officially supported and from the main SceneController device support adding “Select scenes for device buttons” where you can configure running a scene on double tag the S1 button (or eventually S2).

What I was thinking to achieve is to have a Scene where, using double tap, I can move around different light on/off in the room where I have 3 lights.
So, the first time I double tap, it switches on ligh1; next time it turns on light2 and off light1; next time turn on light 1 and light2; and so on as if it were using 3 bits and adding +1 every time (000, 001, 010, 011, 100, 101, 110, 111).

I was trying to start reading the wiki, but as you can imagine it is not exactly stright forward for a first time user…

Thanx in advance for any suggestion

OK. Detecting the double-tap is (probably) easy. Your second goal is harder and will launch you directly into fairly advanced configuration. We’ll do this one step at a time.

The first step is to figure out what the Fibaro device does when it receives the double-tap. Do you know? If not, make two conditions like this:

  • Device State (the condition type), choose the FGS213, choose sl_SceneActivated if it’s present from the drop-down list of variables. If it’s not present, skip this–delete this incomplete condition and go on to the next one. But if it’s on the list, next choose the “updates” operator, then click the downward-pointing chevron in the right button cluster to open the condition options, find the “delay reset” option, and enter 5.
  • Device State, choose the FGS213 as the device, choose sl_CentralScene if it’s present–stop here and delete the incomplete condition if it is not. But if it is, choose “updates” operator and open the condition options as above, set the “delay reset” to 5.

Save, then go to the Status tab. Then double-tap the Fibaro, and observe which variable changes–you’ll see the condition go true for a couple of seconds when you double-tap. Report back here.

What you are doing is setting up a test of two different variables commonly used on Vera for this purpose. We need to figure out which one the Fibaro implementation uses. In 3.5, the Tools tab will have a “Device Spy” feature to make this easier, but for the current version, we can just use a couple of conditions to do it.

Thank you very much for your quick response. Meantime I’m trying a little bit by myself.
I found that using native scene of the VP I can usa the double tap as a trigger, so this could make it easy.

Otherwise, following you suggestion, I do not find sl_SceneActivated. I only see sl_CentralScene and sl_CentralSceneAttr.
I’ll check with the status as soon as I get home :open_mouth:

For the “second goal” i was thinking something like this:
One variable for each light:
A = tonumber(getstate( 32, “urn:upnp-org:serviceId:SwitchPower1”, “Status” ))
L = tonumber(getstate( 26, “urn:upnp-org:serviceId:SwitchPower1”, “Status” ))

bit = 1A+2L+1

In this way, the variable “bit” contains the status of bit 0 for A and bit 1 for L. Adding 1 moves to the desired state.
Then in Activities something like:
Device Action → Turn on or off → Value = { bit & 1 }

where I do a logical AND with 1 to read the status of bit 0.

That’s good enough. sl_CentralScene it is!

A little more homework to do, but for starters, detecting a double-tap (or any tap, hold, etc. that the device is capable of and Vera reports):

Root group - NUL

  • Group “Double-Tap” – AND + “delay reset” 5
    • Device State, FGS223, sl_CentralScene “equals” operator, value for double-tap
    • Device State, FGS223, sl_CentralScene “updates” operator (no operands)

The “Double-Tap” group will go true briefly when the button is 2-tapped (assuming you put the correct value in the first condition–you may need to play with it to figure that out). The first condition matches the type of tap, and the second ensures that the tap is seen (it’s necessary in case you double-tap twice–you want to register the second tap, and the “updates” condition ensures that). The delay reset is only a convenience so that we can see the generated pulse output on the UI–it is otherwise too short for the UI to display. It occurs in any case and will drive logic regardless of its length.

You would put your on/off actions in the “Double-Tap is TRUE” group.

Logic for the lights is clever. See how it works out! I think you might need to do something along the lines of (assuming A, B and C are the statuses for your three lights) bits = A + 2*B + 4*C + 1 to get the bits in the right positions, so that your on/off for A is bit & 1 and for B is bit & 2 and for C is bit & 4.

Great, thank you for the Double-Tap. I’ll test it when I go home.

I realized that bit left shift ( >> ) does not work properly, so I did it using division.

I have a problem with Activities. I set up a test, but the /SetTarget(newTargetValue=0) on the image let me think it does not pass the right value.

Am I doing something wrong?

here I am again.
it seems that sl_centralScene does not report different value for tap and double-tap, so it might not be the right way.
I was able to trigger a scene using double-tap, but I do not know how to activate RS from there.

If you can start a scene, it’s changing something. First, show me a Logic Summary (Tools tab) for your ReactorSensor as you currently have it.

I suppose you want " Submit Device Data" → This device
I sent them…

Down in the “Troubleshooting” section is a “Logic Summary” link. Click that. Instructions are at the top. Post (or PM to me) that report per the instructions.

Sounds super useful!