# \[APP\]\[Pro\] Virtual Devices - Virtual Devices to simulate 1 or more real devices

**URL:** <https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723>\
**Category:** Apps\
**Tags:** app, virtual-device, homey-pro\
**Created:** [September 15, 2018, 3:49pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723 "2018-09-15T15:49:09Z")\
**Posts on this page:** 20\
**Page:** 12

<div class="post-metadata">

**Author:** ![CB83](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cb83/32/30125_2.png) [@CB83](https://community.homey.app/u/CB83)\
**Post date:** [November 30, 2020, 9:24pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/250 "2020-11-30T21:24:07Z")

</div>

Thank you for this 😃

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [November 30, 2020, 10:00pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/251 "2020-11-30T22:00:26Z")

</div>

Thanks very much for this information and test, this is very helpful for me 👍

---

<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:** [November 30, 2020, 10:01pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/252 "2020-11-30T22:01:28Z")

</div>

Definitely not the case, just checked one of my virtual sensors, that definitely has the class “sensor”, not other, a lot can be done during pairing of a device:

> | Property | Value |
> | --- | --- |
> | ID | 9a934819-caad-4666-889d-5932f05f3bc0 |
> | Class | sensor |
> | Driver | homey:app:com.arjankranenburg.virtual — virtual\_switch |

But you can also lower the step by defining the “step” in the capabilitiesOptions (like the min/max).

---

<div class="post-metadata">

**Author:** ![Max\_Menther](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/max_menther/32/31562_2.png) [@Max\_Menther](https://community.homey.app/u/Max_Menther)\
**Post date:** [November 30, 2020, 10:57pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/254 "2020-11-30T22:57:27Z")

</div>

Here‘s the solution without Homeyscript for the rounding of the temperature values:

2020-12-01 flow updated/optimized:

[https://homey.app/f/Dq7jto](https://homey.app/f/Dq7jto)

---

<div class="post-metadata">

**Author:** ![hagert](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hagert/32/18225_2.png) [@hagert](https://community.homey.app/u/hagert)\
**Post date:** [December 27, 2020, 10:33pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/256 "2020-12-27T22:33:25Z")

</div>

Let’s start off by saying this app is very helpful!

Still there is a thing I run in to:

I added a virtual sensor, which functions as a power meter. I would like to be able to stop the power consumption from showing up in the total power consumption which is showed in the app.

For instance the HomeWizard Energy app made by Jeroen Tebbens has an option to not show the consumption in the totals. Could this option maybe be added to the VD app?

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [January 1, 2021, 12:28pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/259 "2021-01-01T12:28:15Z")

</div>

I have a power measure related question too:

My ventilation is switched by a Shelly relay. Since Shelly can not measure power used by the ventilation (power is drawn from a third powerline), I would like to use a virtual device for hving it shown up in Homey Energy.  
(Since the Shelly has power metering capabilities, I cannot “overrule” this by manually entering values for on/off)  
If I am correct, this should be possible from VD app v.0.9.0 onwards.

So what I did was:  
Create a Virtual Device with (only) power measure capabilities.  
Then I made the following flow to write the power value (I read that off my smart meter) to the virtual device when the ventilation was turned on.

Unfortunately, nothing is being written to the VD and the VD is not showing up in Homey Energy too…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/0/c0db48c9b1e0a3f24246c2f0470a48020951e63a.jpeg)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 1, 2021, 1:45pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/260 "2021-01-01T13:45:25Z")

</div>

Maybe it also needs the on/off capability?

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [January 1, 2021, 1:49pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/261 "2021-01-01T13:49:02Z")

</div>

Tried that, but no luck unfortunately

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [January 1, 2021, 1:53pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/262 "2021-01-01T13:53:05Z")

</div>

Set value=measure\_power.

![chrome_2021-01-01_14-56-20](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a4c3f3f6f45cf766f1d6ffd150052fda6cc32762.png)

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [January 1, 2021, 4:20pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/263 "2021-01-01T16:20:01Z")

</div>

Thx @Rocodamelshekima!  
So, had to manually type in “measure\_power” in the first field and a numeric value in the second.  
(this might clearify it a bit more to other users)

I selected the power tag of the VD there.

---

<div class="post-metadata">

**Author:** ![nvkarsen](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nvkarsen](https://community.homey.app/u/nvkarsen)\
**Post date:** [January 4, 2021, 9:34pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/264 "2021-01-04T21:34:09Z")

</div>

Hi,

It has been asked before, but unfortunately I couldn’t find an explanation. My apologies if I overlooked the answer.

Could somebody please explain the difference between “turn mode off” and “turn off”?

[![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/ac2ee8b0d45f427b94ffb3f852d2a54481e1f867.png) ](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/ac2ee8b0d45f427b94ffb3f852d2a54481e1f867.png)

---

<div class="post-metadata">

**Author:** ![tommyberger](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tommyberger/32/28799_2.png) [@tommyberger](https://community.homey.app/u/tommyberger)\
**Post date:** [January 19, 2021, 9:01am UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/265 "2021-01-19T09:01:47Z")

</div>

Hi @Arie_Laxed  
could you please make a divice for garage door with option to use signal from a contact to show if the door is open or closed?

Tommy

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [January 28, 2021, 1:27pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/266 "2021-01-28T13:27:50Z")

</div>

Has anyone been able to set Capability values on Virtual Devices with homeyscript?

```
// Get all devices
const devices = await Homey.devices.getDevices();

// Loop over all devices and find the device the data belongs to based on mqttTopic
for (const device of Object.values(devices)) {
  if (device.class === 'sensor' ) {
  //console.log('Found a sensor ' + device.name );

if (device.name.includes(mqttTopic) ) {
    console.log(`Found device match '${device.name}', updating data.`);
    // update measurements
    await device.setCapabilityValue('measure_temperature', sensorData.t)
        .then(() => log('OK')) .catch(error => log(`Error:`, error));
    await device.setCapabilityValue('measure_humidity', sensorData.rh)
        .then(() => log('OK')) .catch(error => log(`Error:`, error));
    await device.setCapabilityValue('measure_pressure', sensorData.ap)
        .then(() => log('OK')) .catch(error => log(`Error:`, error));
    await device.setCapabilityValue('measure_battery', sensorData.bu)
        .then(() => log('OK')) .catch(error => log(`Error:`, error));
}

```

Those however result in an error with “not\_setable”.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 28, 2021, 1:41pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/267 "2021-01-28T13:41:42Z")

</div>

That aligns with [the documentation](https://developer.athom.com/docs/apps-reference):

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/a/aaa7659e4a7f180100f375a9e9f398931d738c1e.png)

They are only setable from within the app itself (in other words, through the SDK, not through the Web API which Homeyscript uses).

Perhaps the Virtual Devices app offers an API to set capability values.

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [January 29, 2021, 9:17am UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/268 "2021-01-29T09:17:05Z")

</div>

That is actually a shame.

---

<div class="post-metadata">

**Author:** ![Arie\_Laxed](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_laxed/32/913_2.png) [@Arie\_Laxed](https://community.homey.app/u/Arie_Laxed)\
**Post date:** [February 1, 2021, 7:37pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/269 "2021-02-01T19:37:38Z")

</div>

> Could somebody please explain the difference between “turn mode off” and “turn off”?

I can try:  
‘Turn mode on/off’ is defined in the VD app.  
‘Turn on/off’ is defined by Athom and is available because the capability is ‘onoff’.

I vaguely remember that Athom at first did not provide this default flow-card, probably because the class is ‘other’. Otherwise I wouldn’t have created specific flow-cards. I advise to use the default (‘Turn on/off’).

There is a bug report on 1 of those cards, but as soon as I’ve checked that ‘Turn on/off’ is working correctly, I will deprecate the other.

BTW: There are similar duplications in the trigger- and condition-flowcards.

---

<div class="post-metadata">

**Author:** ![Juan\_Garcia](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/juan_garcia/32/29903_2.png) [@Juan\_Garcia](https://community.homey.app/u/Juan_Garcia)\
**Post date:** [February 3, 2021, 10:43am UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/270 "2021-02-03T10:43:12Z")

</div>

I have a problem setting up virtual sensor values. I know the issue has been raised in the forum but I don’t see clear answers to the problem. ¿Could someone help me?

Use case: I want to get alerted when I receive new letters, just having 2 sensors controlling when a letter is coming and when I take the letters off the mail box (a combination of the 2). Then I want to create a virtual sensor raising an alert (triggered through a flow) when I get letters and switching it off automatically when I take the letters off the box.

When I create a sensor and I use it in a flow, I see the possibility to select “Set a virtual sensor value” with 2 fields, Sensor (-\> I select the sensor tag) and the value (I have tried unsuccessfully setting up Yes/Si/On/1 but the sensor state doesn’t change).

---

<div class="post-metadata">

**Author:** ![nvkarsen](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nvkarsen](https://community.homey.app/u/nvkarsen)\
**Post date:** [February 3, 2021, 10:00pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/271 "2021-02-03T22:00:07Z")

</div>

All clear, thanks a lot!

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [February 5, 2021, 2:37pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/272 "2021-02-05T14:37:34Z")

</div>

> [@Juan\_Garcia](#):
>
> When I create a sensor

If I understand you right, you want to use the Virtual-Device, to display if there is a new letter in your letter-box. In this case it’s better you don’t use a virtual-sensor but a virtual-device that has two states (on/off) like a lamp. You can switch it on when the “letter-in” is detected and switch it off when “letter-out” is detected.

---

<div class="post-metadata">

**Author:** ![Juan\_Garcia](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/juan_garcia/32/29903_2.png) [@Juan\_Garcia](https://community.homey.app/u/Juan_Garcia)\
**Post date:** [February 5, 2021, 2:59pm UTC](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723/273 "2021-02-05T14:59:04Z")

</div>

Thank you for your reply.

The challenge I see if I use it as a virtual device is that I can manually change the state of the device, something I would like to avoid if possible (due to the design of Homey APP it seems to me that it is very easy to switch on/off a device unintentionally).

Is it possible to set it up the virtual device in a way where the state cannot be changed manually? (So far I am using a flow that changes back the state of the device if pushed but I would prefer to avoid workarounds and creating additional complexity in the system unless strictly necessary).

[Previous page](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723.md?page=11)

[Next page](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723.md?page=13)
