Great, thats something i love to hear haha
For my Irrigation app I created a script to fetch the groundwater status from 2 sources (grondwaterpeil).
This scripts gives me back the value of Todays âGrondwaterstandâ. I want to store this number -1.99 with a classification in my device⌠Is that possible?
function classify(value) {
if (value >= 2.0) return âExtreem natâ;
if (value >= 1.5) return âZeer natâ;
if (value >= 1.0) return âVrij natâ;
if (value >= -0.99 && value <= 0.99) return âNormaalâ;
if (value >= -1.49) return âVrij droogâ;
if (value >= -1.99) return âZeer droogâ;
return âExtreem droogâ;
https://houten.grondwater.info/kaart/12491 needs this classification:
| Grondwaterstand (m -mv) | Situatie / Classificatie |
|---|---|
| < 0.5 m | Nat |
| 0.5 â 1.2 m | Normaal / geschikt voor landbouw |
| 1.2 â 2.0 m | Matig droog |
| > 2.0 m | Droog |
| > 2.5 m | Ernstige droogte |
Not what you need now, but I know this works in a BLL calc field:
$value >= 2 ? "Nat" : "Droog"
(if value >= 2 return âNatâ else return âDroogâ)
Maybe youâd use the function part of Better Logic, in order to call that function as BLL expression?
Thanks @Peter_Kawa tried it, and am running into the next challenge.
My rain sensor âMM Regen +1hrâ reports mm rain expected the next hour. I think it updates every 5 minutes. I want to calculate total rain over the past 72 hours for irrigation decisions.
Is there a way to sum the last 72 values of measure_rain ?
Maybe with Insight Trends Reloaded, Better Logic, or another trick? Searched the forum, tried homey script, ChatGPT but not effective upon till nowâŚ
Hi Arie,
I see cumulative is available for âPower (Sensor)â (values in Watt), but shouldnât it be available for âEnergy (Sensor)â (values in Watt-hours) instead?
At least thatâs what is says SDK-Reference Energy:
Hi @DirkG ,
Have you been using an AVD for your solar panels? If so, what settings have you used? Iâve setup an AVD for my panels, specified Solar Panels for Device Class, and have exactly one Power (Sensor) and one Energy (Sensor). Both of them have correct values - one in Watt, one in kWh - and I see the power in Homey Energy, but the energy in Homey Energy stays at 0 Wh.
Any tips?
It should work as you described it.
Settings of the AVD
â Device Class: Solar Panel
â Solar Power (W): sensor, measure_power
â Solar Yield (kW/h): sensor, meter_power
Advanced Settings of the AVD
â Excluding from energy: No
When you add an energy device, like solar panels, for the first time, it may take a few hours for the values to be displayed in the energy dashboard. Tomorrow, however, the values of the solar panels should be displayed in the dashboard.
Thanks @DirkG for your help, itâs very much appreciated.
It seems that the switch of the device class or capacity type screwed up some flows, but after I fixed them, it works now in Homey Energy.
But now thereâs another problem. I have one capability named âAktuelle Leistungâ and this is my âPower (Sensor)â/measure_power. It shows in the device itself:
This capability is specified as real field with insights:
Until I switched from âSensor (default)â to âPower (Sensor)â the Insights worked. But now I donât have any insights for âAktuelle Leistungâ anymore, but instead for âEnergieverbrauchâ:
This Energieverbrauch contains all the data for Aktuelle Leistung, but this naming is nowhere specified by me nor does it make any sense (it isnât a consumption/Verbrauch).
Any idea how to fix this?
On another topic: is your Stromzähler also an AVD or is it a real device? I have a meter included in one of my inverter which gives me all values, but I have no clue how to make it show that in Homey Energy. According to Energy | Homey Apps SDK I need to specify a device as cumulative and define the import/export capability, but I couldnât find that device setting.
Depending on what you change in an AVD afterwards, this can actually lead to problems, thatâs right.
Thatâs also the case for me. I named my PV power as âGesamtleistungâ, but in the Insights the power is also labeled as âEnergieverbrauchâ, but I donât know why.
@Arie_J_Godschalk, can you please explain why the name in Insights doesnât reflect the name given in the AVD? And can we change it?
Iâm pretty sure that this is a Homey bug. I have multiple plugs from different brands, they all measure the power and usually name it âLeistungâ, but if I look into the insights I always - without exception - see âEnergieverbrauchâ.
The insight name should be the field-name. Perhaps Athom has changed something with all power updates? Iâll check it out later, but afaik, for other fields/capability-types, it still works, just not power/energy?
Itâs an Athom thing:
Update for the community:
Power-by-the-hour could solve my issue with the power metering of Zigbee Smart Sockets once I turned on âWatt als Quelle nutzenâ (Watts as source) in the advanced settings.
Since about a week Iâm having problems with two devices that stop updating. Restarting the Device Capabilities app solves the issue for a day or two. Both devices reflect values from a Homewizard P1 dongle, but that app seem to work as it should.
Diagnostic report d74fe4f7-5868-4958-9a98-0f15f6dfb9c1
I canât find an answer for the following question in this thread:
Is it possible to (re)order the fields that are shown when you click on a virtual device?
I notice that the order changes when I make changes in existing fields within the ârepairâ function. But I do not understand on which basis the ordering is done. So a second question may be: what is the logic that orders the fields that are shown when you click on a virtual device?
I think Arie wrote somewhere that they are shown in strict creation order.
At least for a text-/number-/yes-no-field, saving with a different icon puts it last. So double editing each fields icon with saving each change, editing the fields in wanted order did it for me.
Does not seem to work for buttons.
This works, thanks Jan-Erik_Hallkvist.
Not very handy, but doable ![]()
Does the DC app respectively an AVD support home battery devices?
For several days, Iâve been trying to help a user to create an AVD for a home battery, but the data, power (W), and energy import and export (kWh) are not displayed in the Homey Energy Dashboard.
The following capabilities and settings are used:
- Device Class
â Battery - Power (W)
â Show as:measure_power - Energy Import (kWh)
â Show as:meter_power
â Cumulative import:
- Energy Export (kWh)
â Show as:meter_power
â Cumulative export:
- Advanced Device Settings
â Exclude from energy: No
Have we perhaps configured something wrong or overlooked something? ![]()
Can you show printscreens of the energy import and export field settings?
Import:
Export:
Edit
@Arie_J_Godschalk, before you start trying to find a bug in the app, letâs wait until tomorrow, as weâve started another attempt.
I mainly wanted to know whether the app supports home batteries for the Homey Energy Dashboard or not.






