Sleeper85 / esphome-jk-bms-can

GNU General Public License v3.0
64 stars 18 forks source link

round requested bulk and float voltages #13

Open octane321 opened 5 months ago

octane321 commented 5 months ago

is there a way to get rid of the decimals on values from Float and Bulk voltage? Values should be 56.2V and 55.2V in this example

image

I could not find a filter or stock setting to fix this - any idea? (This is just a cosmetic issue)

Sleeper85 commented 5 months ago

Hi,

From what I understand, these are values that were modified by the slider? How many decimals do you see just after starting the ESP32 without changing them with the slider?

octane321 commented 5 months ago

the values are right after a restart of the ESP (untouched) - you can also see these values in the webUI if you switch from slider to box

luckylinux commented 3 months ago

the values are right after a restart of the ESP (untouched) - you can also see these values in the webUI if you switch from slider to box

I can observe the same issue ... Float/Bulk Voltage slider has like 5 decimals.

For a "Sensor Component" type you either could use round or accuracy_decimals: https://esphome.io/components/sensor/index.html

For "Number Component" it's more complicated. I'm definitively not an ESPHome expert, but what about using a lamba and round(1) ? https://esphome.io/components/number/#number-on-value

Maybe like in one of the posts here ? https://community.home-assistant.io/t/solved-use-filter-with-maximum-value/426872

shvmm commented 3 months ago

Highly likely a well known REST API issue.

Relavant issue on esphome repo. https://github.com/esphome/esphome-webserver/pull/57

This issue can be safely closed.

luckylinux commented 3 months ago

Not sure if the esphome-webserver fix solves the issues in Home Assistant as well though.

@shvmm Do you have more details ?

And when will this be "available" when building the esphome-jk-bms-can project ? I'm currently running ESPHome 2023.12.5 so it's definitively lagging behind. Is the ESPHome version (installed via pip) lagging so much behind ? Or a specific version of ESPHome is "pinned" either by esphome-jk-bms-can or syssi esphome-jk-bms ?

EDIT 1: I actually had to run pip install --upgrade esphome in order to get the newest version (ESPHome 2024.3.1).

shvmm commented 3 months ago

As far as I am aware, home assistant isn't affected by this issue.

luckylinux commented 3 months ago

As far as I am aware, home assistant isn't affected by this issue.

Oh yeah, I am seing 5-6 decimals for float / bulk voltages etc.