Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Request for all negativ values into positives. #314

Open
Sectorchan opened this issue Jun 6, 2023 · 2 comments
Open

Change Request for all negativ values into positives. #314

Sectorchan opened this issue Jun 6, 2023 · 2 comments

Comments

@Sectorchan
Copy link

For what reasons are the values on the entities are negativ?
From my point of view, the values of the entitiy should always are positiv, even if they are consumed.
Later on, during calculation in any other application, home assistant or Grafana the values of the entities should be subsctracted from another value, but in the case the value are already negative and you can not subsctract them.

My request would be to change all negative values into positiv.

@brlnr23
Copy link

brlnr23 commented Sep 8, 2024

imho, positive/negative values are pretty fine. One could use one entity for automations etc. Changing all to positive would either cause two entities to be needed for everything (such as battery_power_charge and battery_power_discharge) or even more complicated: one entity for the value (battery_power) and a "type" entity (battery_charging or battery_discharging).

I am using Grafana also quite extensively. May I ask what your use case is exactly and what database you use behind the scenes (influx, timescaledb, ...)? Maybe there's a better solution for that?

@Sectorchan
Copy link
Author

I use grafana, or better want to use...

Lets use sensor.rct_power_consumer_energy_consumption_total It has a value of -61.848,6 Wh
Per definition a consumption is always that I take away and a negativ value, would mean imo that it is again +
Also its my opinion that this negativ value should be done through the calculation with the proper "-" operator.
Same as sensor.rct_power_grid_energy_production_total

Your sample with the battery_power seems for me also reasonable and would take much programming to check if battery_charging is true or false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants