ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
311 stars 19 forks source link

Voltage reporting improvement #71

Closed RobBuijs closed 3 years ago

RobBuijs commented 3 years ago

Hi,

You might want to update the plugin a bit (sorry no patch or PR) :

Use "Characteristic: this.Characteristics.eve.Voltage" so voltage is shown with the correct voltage icon in Eve (like it does in the P1 plugin). Also if you *1000 the voltage and then use mV as data unit instead of V, the plugin will show three decimals for a much more precise reporting of the measurement.

ebaauw commented 3 years ago

This is really an issue with the Eve app.

Use "Characteristic: this.Characteristics.eve.Voltage"

Did you actually try that? Last time I did, Eve rounded the display value to V, which is even less informative. That's why I created a separate CPU Voltage characteristic.

the plugin will show three decimals for a much more precise reporting of the measurement.

If you check the log, you'll see that Homebridge RPi already sets the voltage in 0.001 V precision.

[11/12/2020, 14:56:08] [RPi] pi1: set Voltage from 1.2V to 1.375V

It's Eve that rounds the displayed value to 0.1 V. Other HomeKit apps (e.g. Home+) show the unrounded value.

I suppose I could re-define the CPU Voltage characteristic to mV and use integer values.

I cannot re-define the unit of the Eve-defined characteristic; the Eve app ignores it and continues to display it as they defined it. I tried for Homebridge P1, getting the Gas Total Consumption to show as m³ instead of kWh.

RobBuijs commented 3 years ago

I did try in a hacky way, but I got it working. see screenshot. It’s converted back from mV to Volts by eve, but the precision is higher.

Just a restart of homebridge and the eve app was needed to get it in this state after my hacks. I’ll work to create a proper PR from it.

B3EC1271-7A1C-4458-AA50-EFFF857BBB58

ebaauw commented 3 years ago

But now it reports 1362 V instead of 1.362 V.

RobBuijs commented 3 years ago

But now it reports 1362 V instead of 1.362 V.

Shoot, that’s a dot.

RobBuijs commented 3 years ago

Doesn’t work as I thought it did. M

ebaauw commented 3 years ago

Yeah, I don't know why Eve insists on using a decimal comma, despite my language settings. I'll try and change CPU Voltage to mV.