Plugin: Virtual Sensor

Good afternoon. Can I create a temperature sensor with this plugin and add or subtract a value?

You can create a virtual temperature sensor and have VirtualSensor pull a value from any other state variable on any other device, but it will copy the value only, thereā€™s no translation or arithmetic supported.

An alternative would be to use Reactor expressions, Lua, etc. to compute the value, and then write that value to the virtual sensor.

Thank you very much for your prompt response.

My problem is that I have a philio temperature and humidity device that is giving me the wrong values. the device has no parameter to perform the calibration. Do you know what would be the best solution to solve this?

Hello, Iā€™m a beginner in home automation, and I want to upgrade my basic Vera system with new Tasmota based devices.
I have discovered your Virtual sensors plugin, that I think it match very well what I need to receive information from my binary sensors made with Tasmota an ESP8266. I have installed the plugin from the Vera store, and I can see it at the Devices section of the Vera UI. However, when I try to define a virtual sensor clicking on ā€˜Create new virtual sensorā€™ after choosing its type, I obtain the message ā€˜This site says: There was an error loading configuration data. Vera may be busy; try again in a momentā€™. I have tried it several times, and I obtain always the same response.
The virtual sensor seems to be created anyway, but I cannot make it workā€¦
Am I doing something wrong?
Thank you very much.

Have you tried hard refreshing your browser?

Iā€™ve tried with different browsers and instances. No differenciesā€¦
Trying different things I have discovered that the virtual sensor works fine if I link it with an existing (physical) device, even if I received the ā€˜loading configuration dataā€™ error.
But, if I leave it in the (no device/no copy) state, then I cannot trip it via HTTP command, which is the option Iā€™m interested in.
I have created an alias (AAV) in the ā€˜variablesā€™ section of the child device, and when I try to trip it with a HTTP order, I receive from Vera the answer ā€˜Done with ā€œtripā€ for 0 devices matching alias ā€œAAVā€ā€™.
This it the HTTP command Iā€™m sending: http://192.168.1.133/port_3480/data_request?id=lr_VirtualSensor&action=trip&alias=AAV
I donā€™t know what more can I doā€¦

http://[add_ip_address]:3480/data_request?id=variableset&DeviceNum=[add_correct_device_id]&serviceId=[add_correct_servceId]&Variable=AAVs&Value=1

Edit areas [ ]

http://wiki.micasaverde.com/index.php/Luup_Requests

What type of sensor did you create?

Thanks for your quick reply. Where can I find the serviceId?

Thanks for your quick reply. I used the ā€˜Motion/security binaryā€™ type of sensor.

The Alias mechanism does not work on child devices. It is an old facility that predates child devices as a feature. I should have removed it from the documentation. Use the following instead. Youā€™ll need to know the device number of the child virtual device:

To trip:

http://local-ip-address/port_3480/data_request?id=variableset&DeviceNum=nnn&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&Value=1

To reset:

http://local-ip-address/port_3480/data_request?id=variableset&DeviceNum=nnn&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&Variable=Tripped&Value=0

Yes! It works now!
Iā€™ll try now to put the HTTP command in Tasmota.
Thanks a lot!!

1 Like

To find the serviceId go to the device-advanced-variables
and hover over variable or click edit.

@carloslop this is just a follow-up. There is a new version of VirtualSensor (1.12) now available in the app store that should fix the problem with the ā€œerror loading configurationā€ message after creating a new sensor.

1 Like

Iā€™m eager to give this a try, but am coming up empty on a worthy use-case (Reactor being my Swiss Army knife ironically renders my needs all but satisfied)!

Sounds amazeballs, and we are blessed to have devs of Patrickā€™s caliber in our midst.

  • Libra
2 Likes

I have it. Thanks!

Updated to the new version. The error has disappeared. Thanks!

1 Like

hello, is that possible to make power consumption counter by time of relay turned on?

i have vera lite and fibaro double relay FGS-212, one of which channel connected to 5kW/h heater boiler to indicated current state (boil or not). Is that possible to count working time state every 30 sec to virtual sensor and save values for 1 day, 1 month, 1 year?

thanks in advance!

No, Virtual Sensor does not do this. This would be something to accomplish with Reactor.

Hi,
I would also like to use the Virtual Sensor to show a date. Unfortunately dates are expressed in epoch time. Is there (or could there be) a way that Virtual Sensor converts parameters of type date to human-readable time?