How to set a value to a virtual device.
There is a lot of questions about the virtual sensors and a lot of peeps don’t get it to work so here’s a little tutorial on how to set a value on a virtual sensor.
Add the device.
When making the virtual device be sure to pick the correct capabilities. In this example i took a virtual thermostat and used the "Virtual devices" app from Arjan.
So we add a new device, pick “Virtual devices” and then click “Device”. Hit “connect” in the next screen. In the next screen u give the new device a name of ur choise and hit next.
In the next screen u can pick an icon or upload ur own. I picked one from the list.
Then we hit “Thermostat” because that’s the device i choose to make in this example.
In the next screen u can select the capabilities u need. I chose “Target Temperature” and “Measure temperature”. This is important for every other device so make the correct choises! Then we hit next and the device is added.
Then we go set a value for the Virtual thermostat we just created. In this example i wanna show the temperature of the bed from my 3D printer.
Make the flow.
We make a flow. The trigger part and the AND part is free to pick, the THEN part is important in this case so am gonna show u just the AND part.
For the AND part we pick the Virtual Devices app and pick the Virtual thermostat u just created, then hit “Set a virtual sensor value”.
And here is the most important part where it goes wrong every time…
In the first field (sensor) we wright down “measure_temperature”. We don’t use tags here or anything other then the capabilitie we need. And we need to type them!
All capabilities are found here.
In this example i wanna show the temperature so i picked “measure_temperature”. When u wanna show other things like power or gas or something else then look at the link and pick the correct capability.
Do not fill in anything else then a capability here!!
In the next field u can pick a tag from a device which u wanna show the temperature of. In this case my 3D printer. Hit the little tag on the right side of that field and search for the tag u need.
Ur AND part of ur flow should look like this now:
When u run ur flow the temp will be shown on ur virtual device now.
U can add the device to ur favorites and show them on Homeydash.com for example.
Disclaimer.
Please don’t react with “better pick the virtual devices native in Homey” or something like that, this tutorial is just to help peeps getting their virtual devices up and running.