[Howto] set a value to a virtual device

question to @Martijn_Hoogenbosch - how do you get the temp value shown in the icon/device? I get it working but not shown in the icon (only shows the value/temp when I long press the icon in my homey app).

my flow looks like:

If: Temp changed
And: empty
Then: see screenshot

And I do have the 0.5 rounding. I don’t believe 0.1 works. At least I can’t get it working during the adding of the virtual device.

target_temperature

target_temperature

2 Likes

Unfortunately something still is not working properly. I am using a Aqara temp sensor outside (not a thermostat). My flow below:
first issue is an execution error on target_temperature. I saw in the capabilities that UI component is Thermostat and not sensor (will this work on a Aqara sensor?)
second issue: no value still shown on the device (like in the screenshot of Martijn H), only after long pressing the device. This is my goal - get the value/temp shown in the device without having to long press it.

Don’t think u can set a temperature on a sensor.

Please check if there are no spaces around the calculation. Should do the check with the webapp

Well, that depends on the way he has created the virtual sensor. It should at least have the following capabilities as you have mentioned:

  • Targettemperature
  • Measured temperature

And on top of that the minimum and maximum should be altered. Hes measuring an outside temp, you will probably want to change the minimum temp to -15 and max to 50 or so.

there was a space, removed it. Error stays the same


If I look at the capabilities below it seems like target_temperature is not applicable to a sensor, only thermostat!?

Right, then that’s what @Rocodamelshekima means! I’m using thermostats indeed! My apologies to both, didn’t notice that. But the virtual device should be a thermostat for the view I’ve created.

thnx! made a new Virt Device with thermosat instead of Sensor, now see another device with temp indication. Will recreate the flows…
update: got it working, thnx @Martijn_Hoogenbosch :ok_hand:

1 Like

Geniaal dank je wel!!

1 Like

image
You missed a ( after round, these things always come in pairs :wink:

1 Like

Hi, I want to add a virtual device based on a cost calculation. Is this possible within the virtual device app?

Thanks, John

I think you should take a look at it’s ‘big brother’ Device Capabilities.
U can add any value unit you like, f.i. $ or €

Flow:

1 Like

What App shows the energy prices?

That is the awesome Power by the Hour app :wink:

3 Likes

Following this guide I am trying to get the temperature from a philips hue motion sensor, but I am getting the following error:

measure_temperature InvalidTypeError: [null] is of type string but expected number (invalid_type)

Any ideas?

Can you share a screenshot of you flow?

It looks as if the value of the hue capability is null, which is not allowed as number-argument-value.

I tried a few different things, and I think I got it working, the flow looks like this now:

However, the idea with this is to be able to ask GH about the temperature, and when I tried first time after making this flow, it told me that the sensor is turned off.
I then clicked on the virtual sensor and set a temperature “20C” and it now tells me that the temp is set to 20C and that the actual temperature is 21.5.

However, the actual temperature when I click on the Hue motion sensor shows 22.1C not 21.5, so not really sure what is going on there?

Also do I have to set a temperature manually like in this example, for GH to understand that the sensor is on?

That trigger will only trigger when it goes from under -10 degrees to above, not every time the temperature changes, you’ll need to use the “temperature changed” trigger for that.