# \[Howto\] set a value to a virtual device

**URL:** <https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883>\
**Category:** Tutorials\
**Tags:** virtual-device\
**Created:** [April 7, 2021, 4:09pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883 "2021-04-07T16:09:20Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [December 2, 2022, 4:11pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/23 "2022-12-02T16:11:22Z")

</div>

What App shows the energy prices?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [December 2, 2022, 4:14pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/24 "2022-12-02T16:14:05Z")

</div>

That is the awesome [Power by the Hour](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535) app 😉

---

<div class="post-metadata">

**Author:** ![Branko\_Savic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/branko_savic/32/34710_2.png) [@Branko\_Savic](https://community.homey.app/u/Branko_Savic)\
**Post date:** [January 12, 2023, 11:11pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/25 "2023-01-12T23:11:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [January 13, 2023, 7:21am UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/26 "2023-01-13T07:21:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Branko\_Savic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/branko_savic/32/34710_2.png) [@Branko\_Savic](https://community.homey.app/u/Branko_Savic)\
**Post date:** [January 14, 2023, 11:28pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/27 "2023-01-14T23:28:50Z")

</div>

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

 ![Skärmbild_20230115_002249](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/d/cd31c146b04477441499c299227f82765f960c95.png)

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?

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [January 15, 2023, 10:10am UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/28 "2023-01-15T10:10:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Branko\_Savic](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/branko_savic/32/34710_2.png) [@Branko\_Savic](https://community.homey.app/u/Branko_Savic)\
**Post date:** [May 25, 2023, 6:21pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/29 "2023-05-25T18:21:02Z")

</div>

Trying to configure a sensor for the living room, but I am unable to get any readings at all.  
What am I doing wrong?

 ![Enhet](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/2/42a32ef29b8b0c72fceab439ffe1bb79f5acf776.png)  
 ![flow](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/1/8159a11d7a66081104ee2ee4ccdf17c929de9bd1.png)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [May 25, 2023, 9:50pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/30 "2023-05-25T21:50:09Z")

</div>

What do you mean with:

> [@Branko\_Savic](#):
>
> but I am unable to get any readings at all.

?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 25, 2023, 11:26pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/31 "2023-05-25T23:26:48Z")

</div>

First of all, please add notification / log cards to flows which won’t do what you expect. Then you can trace what worked or not.  
Second, make sure your virtual device _ **has a “measure\_temperature” capability** _, **otherwise it won’t work**  
Because in case you selected an other type of capability, it is like you want to set the, say, humidity of a light. That won’t work either.

![Screenshot from 2023-05-26 01-12-04](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/28f4d7725c39bcaa992da731dcecedc354dfe901.png)

In case you’ve added a _ **virtual thermostat** _ instead, you also have to tick the “measure temperature” box to get it to work  
(Note you can’t edit a VD, so you’ll have to create a new one)

 ![Screenshot from 2023-05-26 01-37-29](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fca4ed78225b717ff6d87f1ca08b1f091752d1b9.png)

I made a test VD and a test flow;  
As you can see, the top flow is like yours,  
but the bottom flow is to send a manually entered number, just purely to check if this `measure_temperature` I entered will accept a value or not.

 ![Screenshot from 2023-05-26 01-17-55](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/0/400165f51e89fb6aa1a7a28890d17764d6279b12.png)

![Screenshot from 2023-05-26 01-18-29](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/1/c17ee3679eede3cb2de42b23ee68a43d47cd80b2.png)

I’m pretty sure the issue here is, you didn’t select the “measure\_temperature” capability when you created that VD.

I hope this helps you further with the VD’s

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 25, 2023, 11:55pm UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/32 "2023-05-25T23:55:02Z")

</div>

The issue above made me think of a feature request:  
The ‘Measure temperature’ box isn’t ticked when a virtual thermostat is created, only ‘Target temperature’; Shouldn’t that box be ticked by default?  
While most thermostats have a settable temperature _ánd_ a temperature sensor?

 ![Screenshot from 2023-05-26 01-37-29](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fca4ed78225b717ff6d87f1ca08b1f091752d1b9.png)

(made a ticket for it)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [May 26, 2023, 4:42am UTC](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883/33 "2023-05-26T04:42:45Z")

</div>

> [@Peter\_Kawa](#):
>
> I’m pretty sure the issue here is, you didn’t select the “measure\_temperature” capability when you created that VD

Before i posted, i looked at how a VD would look of not selected the measure\_target during creation.  
Since his image has a Actual Temperatur with a dash above it, i actually think he did select measure temperature.

Lets see his response 😉

[Previous page](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883.md?page=1)
