Reactor + (null) value of Virtual Sensor

Hello all,

I am using a Reactor plugin to read temperature values via http-get command from Tasmota devices and write them to VirtualSensors in Vera. All works great thanks to the genius plugins from Patrick H. Rigney.

Just have one exception that I would like to catch. If anything wrong happens and Tasmota does not supply the current temperature - the Expression holding the value in Reactor is set to (null) - as desired.
But when the Device Action SetValue is executed by Reactor against a VirtualSensor with that (null) value - nothing happens.
The VirtualSensor still retains the previous value, instead of getting a value of (null).
This is misleading, because in my dashboard I see the old value, and I would like to see that the Tasmota sensor failed and that I should fix it.

Is it possible to change that behaviour?
Can I set the value of my VirtualSensor to (null) with the Reactor plugin?


1 Like

You can’t use SetValue because it only accepts numeric values. You’ll need to set the state variable directly on the virtual device.

You also cannot set null on any Luup device because all state variables are string values only (and if you attempt to set Lua nil as an equivalent, you’ll actually delete the state variable from the device).

A RunLua action can be used to set the variable, as shown below. Supply your value and the device number of the virtual sensor:

Copy-paste the serviceID: urn:upnp-org:serviceId:TemperatureSensor1

1 Like

Thanks for the pointers.
I was able to make it work with variable_set() function and now the interface shows me the values and nulls as desired.
Great work with these plugins, they really make life much easier with Vera.