In your last screenshot you can see that the first capability is added as measure_power and Jomey rounds in sensor view.
The last entity is measure_numeric (assumed based on the icon) and so it’s not rounded.
Can you please check the entity in your HA developer tools:
some type attribute or a unit set?
Please think about the ukit you wang to have in Homey (W or kW).
Based on these informations I can guide you…
Hi,
this app integrated devices of a HomeAssistant smart home system.
Based on your question I assume you don’t have a HomeAssistant system running, right? So this app makes no sense for you
Then you don’t need this app. It’s only used to import devices from HomeAssistant to HomeyPro.
Who has recommended this app?
Perhaps someone recommended to use HomeAssistant parallel to HomeyPro to add your devices via HomeAssistant. But I don’t think that’s what you want to do (a second smarthome system).
The Homey app searchs a capability based in the device type or unit. kW doesn’t fit to any Homey capability, so measure_numeric is used (generic number value).
Please do the following steps:
remove your capability from your device
add your entity again
change the capability into “measure_power” (insert manually or select from the autocomplete list). Use a “main” capability (measure_power) without a subcapability (added “.xxx”). This way the capability can be used in other apps like PowerByTheHour. But you can have only one capability with this name. To add another one, you have to use subcapabilities or create a second device.
Set the unit to “W”
add a converter to calculate the value: (value) => { return Math.round(parseFloat(value) * 1000); }
x1000 to get Watt and then round to 0 decimal places
Perfect; seems to work flawlessly!!
Two questions:
What would be the correct syntax to multiply AND have three decimals? (value) => { return Math.round(parseFloat(value) * 1000 . 3); } doesn’t seem to do the trick
Where can I start to learn everything there is to learn about these syntaxes? Is this Python, Yaml, Java?
If your converter is not working (syntax error etc), you can see a error message in app log (repair view).
The converter is technically a function with one parameter “value”.
The value is the content of the entity state (if an entity was added) or the attribute value (if an entity attribute was added).
The real value you can see in HA developer tools. Sometimes the HA dashboard displays a converted value (rounded…).
Since none of the above syntaxes are 100% without errors, I begin to suspect that this might be a very high mountain to climb for someone who considers this just a hobby.
I am beginnig to suspect that I will never win a beauty contest with my wonky integrations