Thank you for this
Thanks very much for this information and test, this is very helpful for me
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).
Hereâs the solution without Homeyscript for the rounding of the temperature values:
2020-12-01 flow updated/optimized:
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?
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âŚ
What am I doing wrong?
Maybe it also needs the on/off capability?
Tried that, but no luck unfortunately
Set value=measure_power.
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.
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â?
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
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â.
That aligns with the documentation:
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.
That is actually a shame.
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.
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).
All clear, thanks a lot!
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.
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).