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:
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
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.
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…
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).
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