Reactor Update Virtual Sensor Variables

Reviewing the following: How to - Everspring EH403 FloodLight. Wondering if it is a better implementation to use Reactor instead of startup lua code. What would be the best way to accomplish updating the ‘tripped’ value on a virtual motion sensor using another devices ‘tripped’ value?

  • Conditions: When the ‘tripped’ variable ‘changes’.
  • Actions: When ‘true’ do what? ‘Run lua’ to copy the variable over?
    Dont see any other intuitive way of doing this. Just figure since I use Reactor for pretty much everything else, this would make more sense than editing a startup lua script. Would there be any easier way to utilize a virtual device and copy variables from another device, whenever it changes?

@rigpapa

Patrick, can he set a devices tripped variable in a Reactor Action?

Like we can in MSR by using Set Variable etc.

OR you can run some LUA code instead.

Change the ID number 101 to whatever ID number your virtual motion sensor device is.

LUA code to trip the virtual motion sensor:

luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 1,101)

LUA code to un-trip the virtual motion sensor:

luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 0,101)

User posted a screen shot, looks like you can use “Set Variable” in that drop down menu.

Edit: You would need to set the tripped variable on the virtual motion sensor device in the rules action.

You’d setup your Reactor rules as described here.

“Edit: You would need to set the tripped variable on the virtual motion sensor device in the rules action.”
What do you mean here?

Currently, I dont have any options really under “Set Variable”:

Maybe I am missing something with Reactor, or my understanding is flawed, but thinking there are 2 ways of doing this?

  • Option 1: This is the way I am currently testing. Under Conditions checking to see if the Device State changes for the Tripped variable. Under Activities I have the luup.variable_set command to set Tripped to 1 if True and another action to set Tripped to 0 if False. Of course I am checking under Conditions to see if Tripped is True.
  • Option 2: This is maybe where I am not understanding something. You are suggesting there may be a way to do this with ‘Set Variable’?

Option 1 sounds right to me and you can use the LUA code to set the tripped variable.

Option 2 maybe an alternative to having to use the LUA code.

I do not know the Reactor plugin for Vera and I am not familiar with it as I have never used it.

I am familiar however with the new Reactor plugin replacement called Multi System Reactor.

@polskikrol

I’ve just looked and this is how you do it in MSR, so I am assuming its done in a similar way in the Reactor plugin for Vera.

In the Action part of the rule I have to select “Entity Action” I then select my virtual motion sensor device and then I select the “Set Variable” option:

I have to specify the correct Vera device service which for a motion sensor device would be:

urn:micasaverde-com:serviceId:SecuritySensor1

and the variable “Tripped” and the desired value “1”.

When I said use the “Set Variable” option in the drop down menu, that might have been a red herring, Instead in your Action try selecting the virtual motion sensor device first and then in another drop down menu do you have a “Set Variable” option ?

I think you already tried that though right? As you posted a different screen shot on another thread and it looked like you didn’t have the option to do it.

We really need @rigpapa to confirm this or someone else who knows the Reactor plugin for Vera etc.

This screen shot:

image

So maybe option 2 is not possible for you in the Reactor plugin for Vera.

But option 2 is available to me in Multi System Reactor.

So my advice would be to stick with option 1 and use the LUA code I gave you to set the virtual motion sensors tripped variable state.

1 Like

Yup, I dont have those fancy options in Reactor 3.8 on Vera. Gonna go with the debated option 1 and clean up my implementation. Then some more testing of the Param 1, and if that doesnt work, I may send a note to Homeseer to see if they can clear up the understanding of the function.

1 Like

Parameter 1 on my Everspring flood light is set to 60 seconds. I am a 99% sure that it over rides whatever the physical time dial might be set as.

Because I seem to remember I timed the light going on and off with a stop watch and it was 60 seconds and I doubt I could of been that accurate with those crappy physical dials under the PIR unit itself.

So I would expect it to work the same way on the HomeSeer PIR unit.