macxq / foxess-ha

Home Assistant & FoxESS integration. Monitor you photovoltaic installation directly from HA ☀️ ⚡️
120 stars 37 forks source link

sensor.foxess_solar shows to 15 decimal places #71

Open HypeLaser opened 2 years ago

HypeLaser commented 2 years ago

Can the value of "sensor.foxess_solar" be rounded to 2 decimal places? Most of the other figures come in to 1 or 2 decimal places.

Other sensors that also show long decimal places are:

sensor.foxess_feedin sensor.foxess_bat_discharg Screenshot 2022-08-15 at 23 37 25 e

sabbie-github commented 2 years ago

Great integration, very happy with it. But bump the 2 decimal request, it would be helpful to have on all the fox sensors.

image I am just a newbie, playing around with it. In trying to change the above, I have used 2 decimal rounding "|round(2)" in the config yaml - this only changes the sensors that are displayed as a result of a calculation. template:

sabbie-github commented 2 years ago

I now added rounded templates in the config yaml and used these as new sensors to be displayed on the cards. Probably not the most elegant way, but gets the job done

template:

image image

Thebig24fan commented 2 years ago

Nice looking displays how’s do I add this to my home assistant tried to sort it out but can’t see how only been using ha a few days thanks for any help anyone can give a newbie thanks

Davvy80 commented 1 year ago

Hi same problem. How can I fix?

sabbie-github commented 1 year ago

@Davvy80 shortening the decimals to 2 can be done by adding sensor templates to the config yaml, which round the sensor values. See post above.

Davvy80 commented 1 year ago

@Davvy80 shortening the decimals to 2 can be done by adding sensor templates to the config yaml, which round the sensor values. See post above.

and then I have to select these new sensors? is your post where there is also the photo?

sabbie-github commented 1 year ago

yes, you put the new sensor templates in your config yaml and then use the new sensors in our dashboards

` template:

`

the above in the config yaml will create new 2 digit rounded entities to use in your dashboards: entity: sensor.foxess_pv1_power2 entity: sensor.foxess_pv2_power2 etc