[APP][Pro] Advanced Virtual Device (Device Capabilities App) with Unique Text Status Indicator

All TEF files I generate from one of my Homeys seem to have some kind of problem. When trying to create a new AVD using the TEF files I get the error message “Cannot read properties of undefined (reading ‘deviceName’)“ and when making an empty AVD and repair→importing, I get the error message “o is not a object, text was: [tef file contents]

Latest version of Homey (v12.9.1) and Device Capabilities app (v2.16.3). I have tried multiple browsers and also the Homey iPhone app. Also restarted Homey and the AVD app.

I have two other Homeys on other locations that generate TEF files perfectly. The one difference with the problematic Homey is that I am not there physically and also port forwarding is not enabled as the location is on 5G with CGNAT. Homey however works flawlessly.

As an example, here is a very simple TEF with one numeric field that gives the same error:

[tef:AVD:"H4sIAAAAAAACA22UWY+bWgzHv0rFa2YU9iVSHwhLQiAQ1gm5uqoOcICTsIXDklD1u1/NbaupqvGLJf/sv2VZ9ncigxNKoZG2DbEh9iw25J+myDTlC29CbxcPSQ/3QhpkcnuLpLe0R7KNZ1W2+b14oKIUsveSiZPRwrybm2MYrSNDvtXXhXR8jzqbrOTwsDzxa9umgjtuqOuw0qvTWRJxlpYcm6xb3KNkP1ksY8W7hoOUOJZ3HOt0l3dOqDFTFK0TGoNqpXPPo833j20oBXa5UvtSFazVklfSG8zoBsYmBeAtr9mJ48Vgze9dsWuQzECBgds6PvSCj8bqPp5BLl6deX29mk91tzOxz8En4Oq3+NHGV2OXJbMUVexqWY2mpI4Tyd0uaVfeO7x0CdVUJ5WUihX39HN6xe1P5HpixaEM1JxW8koIz4fYqunzruEvJGfVYGU2MSPyUj2z3Y7O6EW3BXJSK87LJfJqwqTAKNIxvDD1wIL1ALGYWOL9qLLsoYy0fcAIo9GdvUWFxum4zffByhZ5vod7WECAxyVN7cxPl2hSw4s+TdcVJgWdDw+8UzGxhDm4y2fRCXWUXWK51bMCN/GjcNqq6OS4Uc9lN4e309u1nwOR21pJ0PmlUslP0gvt2JUaTzseTVlArrkNY+SZWqFVc7HV4t6fJa9VjDdzcYvIb/EqlC2VT4LCOKAMi3VDBi6dYjkD3Naf6fjiuuHbzWaPt+CaX5J21u6ae7q3hnLKAvTIWoCswmCRW+aKIZdl68UO2zmPdopdZ46Aae7lajhalKf7insajezi+cHNbWKN9xZZYS6OxWou2fh3HYJdebg/5tZpIB3XaT5Oph8zatJlidmB3eVmSAt1UK1g77q614UkWYBqfDylx10rt4vqo8e2Gw9Wq0q+d9aY2h2yQ3XUth32kEenB1KxlJ4O5yniI5O0Ak9oveR4fu4UXQKKBrQaPRMSqsuazBykMyEfTXQzRYtArlcdc3VFNLuyLH/9SrwQ6YiHtn6/RUxsvv94IdoeFagBlZERGyIFYpIzXPqaCRL1yooc/5okAv/KAY5kRUFKUiklXggMhwE1xbsCARvYF89vE6hG+O1ddgDNQGxeiGasE9g7eQAfg45glWFiQ36E7f/9b0B9gG3bVhA0n5Rsx2FoPwMKqGEPPgEWwn/2TitMbIh2KGFP/E6ibFBDYkMEEA9f7LH+AD7sQA8GqIAOJKhCA4KY2OSgwvAjp2xn+V0Uwwa3f6gqPQQD1Kt2VkD/3n7oR/gXDUDxadxoMCrK4e+iXw/05wa/UcSPl1+f9c8J5Ej94qO6qyDxQgBi88+/P/4DgSX2nYEFAAA=":/tef]

Indeed, importing your TEF results in “Cannot read properties of undefined (reading ‘deviceName’)“
(Pro2026 v12.10.0-rc16)

Can you try this TEF? It’s very basic with two Boolean capabilities

[tef:AVD:"H4sIAAAAAAACA32VWY+bShCF/0rEqz0yZsdSHjCLFzA2q42vrqIGGmi7WUyz2I7y36PJTDTRzej2S0v1lc45VVKrv1MpHFACN0ldUQtqzZGN8nZUhZl74lFs7fwuG8FaTPxUqa+hfExapNhk1BRbWEvbeZhA7lawUdxbRHAysw/CWbhRruXlSe89d34yOXkvwOIgzGx77t9INb90EwMfTrJE0qTguXhWkxbF68HiWCtaVTycS31xI5HBNFmzD3R2CMNZzBCAJwb/2NlCe18Gsm8XE60tNNGaPDMsH2HKVDAy5wBes5IbeEHyZ8LakZoKKSwUWbgso20reqjHt/4EMumyH2eXi/nQViuTe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BgAA":/tef]

Thanka for your quick reply Peter!

I was able to import your TEF just fine, but when I export that imported device, it generates this TEF - with the same problem:

[tef:AVD:"H4sIAAAAAAACA32VW4+iShSF/8qEV+2I3DGZB+SiCKJcFU9OJgUUUMpNiosymf8+6eme9ORM59RLJfvbWWvtnVTqO5HAAcVQj+uKWBFbBuvS25ElaunyJ761soeo+Vs+9hKpvgXiKW6RZOFRkSxuK+yWQQyZe06HUW9izk6N3g8WgS7dyutEHlxneTYY8cDB/MgtLGvp3XG1vHYzrTieRQEncc4y0aLGLYq2g8nQZripWLgU+vyOQ41q0ubgq/QQBIuIwqCYaexzb3HtY+2LnpXPlDZXeHM2pYV4gglVwdBYAnhLS2ZgOcFbcFtbaCok0ZCn4boMdy3vor6492eQCtfDuLhejaey2RjYZeETsOUpfNThVd8k0SgGBTObZr0hKv1AsrdL3OT3Bk9NtKyKo0KK2Yx9uik1Y7dHcjEwQpd7SkrJacH7511oltR5U3EXkjVLMDOqkBY4sRyZZkMl1KRZPDkoBeukInk1YJRhFGgYXuiyY8Cig1iITOG+Vxhmlwfq1qP5Xm/OzqRA/bhfp1tvZgkc18ItzCDA/RTHVuLGUzAo/kUbhusMk7zG+TvuUNChiFm4SUfh4GsouYRSrSUZrsJHdqiLrJHCSjnnzejfjqdrO3oCuzYjr3FzuZCepONboS1WjrrfGxKPbGPth8gx1Ewtxmythq07ik4t6ydjsrPArfHMl0yFi7xM36EEC2VFejYVYykB7NodqfBi2/7pZjH7m3dNL1E9qnfVPt5rXT4mHnokNUBmpjPIzlNZl/K8dsID0xwe9RDahzEAhrGVim5vLh3Nle1jrycXx/VudhWqnDNJMn05mIxqk5V71yDY5Lv7Y6wPFaTCMk77wXBDWomaJDIasLncdHFa7hTT29q25jQ+SWag6B9P8XFX8/WkuOixbvqdWSui65xVurS7ZFfs1XWDHeRQ8Y6UTbml/HEIuMAgTc/hayfan58bWROBrAK1RM+IhMq0IJMD0mifCwaqGoKJJxezhr7aAhptSZK+fiXmRNzjri5f3yImVt9/zIm6RRmqQKEnxIrgmIiEDEe+LEmReWH4aPkicKn4wnM0zaZkzEMREnMCw65DVfaqQMAKttnz2wCKHn57le1A1RGrOVH1ZQTbQ+rBR6chWCSYWJEfZevX/QlY13UBQfWbLP8gfdfVnwEZlLAFn2iZCP/pHReYWBEYVrhuiTkRvTktLVBCYkU0LcSwiuEfRG4h6KBW1KMM2leRFBQYfnAXNqAFHZRBAyJUoA7BT5ryepQ+NXZgWsC4I1bEa/HXdP8N8wWPqIvzD/5XpK7t4QfNYXyDyUeGt/L/53zv+R2zruo0/TBUEAZR8bfmZ+Hfwnkg+2sJ793qIy76BLowrqvX8DRJ/pi/fxDvkweo7XpQfDn+3oD7a21fOog7Yk4AYvXPvz9+AkTa62hVBgAA":/tef]

Is there an easy way to see the “unencoded” version of the TEF file? It could be useful to see a diff between the two files.

No problem, Axel.

I thought TEF files are base64 encoded, but decoding it throws only rubbish.
I’m afraid you’ll need dev Arie here.

Thanks! Hopefully you can make sense of this @Arie_J_Godschalk :blush:

I got the battery to show up in the energy dashboard by selecting the device class as “power strip” (hope this translation is correct, its “stekkerdoos” in Dutch). Then go to properties and you can select where it power strip is plugged in to; select battery. The battery now shows up in the energy dashboard. However, it does not track the discharge energy for me.

I tried the following: have two separate field for import and export with the corresponding options tagged in the virtual device and the option “create real field” tagged (so same as you). The import is tracked, export not. Both the import and export values are positive.

I did some digging and found the problem in the TEF files (but not the cause of the problem).

TEF files are base64 encoded and gzipped, so it is possible to decode and encode using an an online tool like this (omitting [tef:AVD:" from the beginning and ":/tef] from the end).

This is what I found out: A valid (decoded) TEF contains “energy_value_constant”:null, in the settings object whereas the TEF files generated on my Homey contains “energy_value_constant”:, . Notice the missing null, which is a json syntax error. I manually added null the correct place, and was able to import the TEF!

Setting a value in the Constant power usage setting field on the device has no effect on the TEF file (still nothing after the colon), but this is the case also for Homeys where TEF export works (still null after the colon).

I quickly tested flows export, and noticed that the TEF had a similar syntax error with nonexisting values for the width and height properties for notes.

I have ny idea why his problem occurs in all generated TEF files on one of my Homeys and not the others, hopefully this is helpful information @Arie_J_Godschalk :slight_smile:

1 Like

I guess because of the device class “power strip”. In a power strip the energy “flows” just in one direction, not in both directions, as is the case with a home storage unit (battery).
Therefore, I still believe that the DC app isn’t currently working for home storage.

I guess you are right. I am not an expert but what I found on the SDK page:

{
  "name": { "en": "My Driver" },
  "images": {
    "small": "/drivers/my_driver/assets/images/small.png",
    "large": "/drivers/my_driver/assets/images/large.png"
  },
  "class": "battery",
  "capabilities": ["measure_power", "measure_battery", "meter_power.charged", "meter_power.discharged"],
  "capabilitiesOptions": {
    "meter_power.charged": {
      "title": { "en": "Charged Energy" }
    },
    "meter_power.discharged": {
      "title": { "en": "Discharged Energy" }
    }
  },
  "energy": {
    "homeBattery": true,
    "meterPowerImportedCapability": "meter_power.charged",
    "meterPowerExportedCapability": "meter_power.discharged"
  }
}

You can set the meter_power to .import or .export for the power plug but it seems it has to be .charged and .discharged?

According to the SDK page you can use battery_charging_state if the battery does not support the charging and discharging as separate values. But this also doesnt not work for me.

Hello, I’d like to create an ON/OFF button. I have some in my devices, but I can no longer create more…

I used the following method:

New Device
Device Capabilities
Select Advanced Virtual Device
Connect
Select Create An Empty AVD => Select an icon or an external SVG file
OK

Select the Advanced Virtual Device Button
Select Mouse
Repair
Device Class ??? I don’t know what to select.

Yes/No field selection
Name => Button 1
Show As => It displays a whole bunch of status (Sensor Alarm CO2 Alarm… ??? )
Icon => Select an icon for the button
Finally, Create Yes/No field…

And during the test, it’s not an ON/OFF button.

When testing, there’s a circle that corresponds to the button type, but it doesn’t act as an ON/OFF button.

And I can’t find the property in the flows that allows me to set a Set To ON and execute flow or a Set To OFF and execute flow.

I was able to create them before, but now I can’t anymore…

Thank you for your help…

@Serge62 I just created a ON/OFF button.

Choose “button” for the devices class.
Choose “On/Off” for the Show as

This should create a on/off button you can press.

If you want to use it in a flow, do not forget to check the “Create real device and flow-cards”

(Note: the texts between '“quotes“, are my translations from Dutch to English, so choose one that is close :wink: )

Can anyone tell me how I can create my own “Show as” list or its this only something that the developer can add?

If the latter, can we request a list somewhwere?

Thanks,

Frank

Oh I misunderstood.
You’ll need the “List” function, to use states, that “show as” list is a fixed list.
You’d use the “List” field


https://community.homey.app/t/request-custom-picker-for-advanced-virtual-devices-from-the-device-capabilities-app/79440

What type of device it should be handled as, like, light, plug, solar panel, kettle;
but, the default, being “other”, is fine to start with (you can change it after creating as well).

You misunderstood
Button = button/switch
Yes/No field = used for (sensor) states.

So, add “button” and select “on/off”. This will create a switchable tile (like a light or plug).

This works solely with button1. Following buttons can switch anything but the device tile.

Thanks!! Added my request :heart_eyes:

1 Like

Hello, Thanks a lot … It work perfectly …:grinning_face:

1 Like

hello,

i have 2 variables which i want to place in a virtual device

the variables come from a json code from another device what wil be the best way to show them?

i tried the explanation in te start post but i can’t get it working unfortely.

What kind of variables are these? Numeric, text, etc.? Perhaps you can show an example.

Do you want to show the values as sensors on the sensor tab of the virtual device? Or perhaps (also) on the tile itself (as indicator)?

hello @SunBeech

i just read the documentation of the data vista app and i look like i can use a varible straigt away, so forget my question over here.

There are two ways in which you can feed variables into an Advanced Virtual Device (ADV):

  • I personally don’t use the standard variables of Homey, but the ones you can create in the Better Logic Library app. The advantage is that the ADV can directly be linked to such a variable, so that is shows (‘reflects’) its value. Like this example that shows a humidity value stored in a BLL variable:

  • The alternative method is that you use a flowcard to update the field in the AVD. In this case you would use the following card that sets a numeric field in the AVD to you variable’s value

Via both methods the AVD displays the value on the sensors tab:

EDIT - Didn’t see your additional post. Maybe the above might be useful for a future use case.

2 Likes