Reactor - change variables values

One of the things I use Reactor for, is to switch lights when the door opens and lighting is low.However the sensor is sometime slow going back to “NOT” Tripped = “0”.
I will like to have the option, under “Activities” to set a value to the sensor 1 or 0.

Most of my sensor is PHILIO and FIBARO

Thanks

I canceled most of the Scenes and now use Reactor

I consider that kind of activity to be a violation of the protocol for handling devices. When needed, the device definition usually declares an action for that purpose, as a device really should only modify its own state variables. The example I often use is that you do not turn a light on and off by setting the Target value on the light directly. Rather, the SwitchPower1 service provides a SetTarget action, and this action not only sets the state variable to the intended state, but also initiates communication with the device to make that state a reality. Status updates from the device after then update the Status state variable, which is how the two variables keep parity (hopefully). If you were to set the value of the Target variable directly, however, no amount of changing and chugging would make that light turn on or off, because you are only changing the variable, you are not causing any communication with the device (the device expects you to use the action).

So Reactor doesn’t do this natively, and I don’t think ever will. But, there are workarounds. You can use a “Run Lua” action in your ReactorSensor to call luup.variable_set() on your device, for example. For security sensors (i.e. those supporting the SecuritySensor1 service), you can also set the AutoUntrip variable to a non-zero number of seconds, which will cause Luup itself to mark the sensor untripped after the specified period. Either way you do it, the sensor itself may still be tripped (door still open), so this can cause unexpected behaviors given that the sensor thinks the door is open, but Luup is now reporting it is not (another reason to avoid “artificial” changes to these variables). That would be for you to know… and remember… and manage.

1 Like

Thanks,
now i will look for the “AutoUntrip” option