chises / ha-oilfox

HomeAssistant Sensor for Oilfox
29 stars 4 forks source link

unknown entity "UsageCounter" #27

Closed Dieter-GitHub closed 1 year ago

Dieter-GitHub commented 1 year ago

Hi chises. I'm deeply impressed about your work. Great! Thanks! I realised that I have an entity called Usage Counter with a given value in kWh, which I can't find in the OilFoxAPI and also not in the classic download file via Oilfox App. May you explain what it is? Best, Dieter oilfox_entities

chises commented 1 year ago

Hello and thank you @Dieter-GitHub :) this entity is added to add a basic support for the energy dashboard (https://github.com/chises/ha-oilfox/issues/22) I am not happy with the current solution for the energy dashboard because this value is only updated once a day and the energy dashboard expects some "realtime values". Otherwise it will show "0" in the dashboard after a short amount of time: image But the entitiy has the required attributes for homeassisant to add it energy dashboard. image So people can add it here.

The value is updated one time a day because the oiflox measurement is only done once a day. That volume is saved in the entity as a additional attribute "current value" and the difference to the previous measurement is mulitplied by 9.8 (https://github.com/chises/ha-oilfox/blob/main/custom_components/oilfox/sensor.py#L38). 9.8kWh energy is in 1 liter oil (based on my google search ;) ) image That is the idea behind that.

so long story short: to provice a entity that can be added to the energy dashboard. The kWh is calculated based on the daily used liter and multiplied by 9.8.

I am still thinking about a bettersolutions to provice better values for the energy dashboard but for the moment: it is what it is ;) Currently I am thinking about: divide the value by 1440 (because a day got 1440 minutes) and increase the usage counter every minute with the calculated value.

I will update the readme next time so everybody is aware of this entity and what it is used for.

Thank you for your feedback! Feel free to ask something else or close this issue, if you are fine with my answer.

chises commented 1 year ago

I will close this issue, if you need some more information feel free to reopen it or create a new one.

Dieter-GitHub commented 1 year ago

Hi chises, thanks a lot for the explanation, now I got it. Just one idea to avoid questions like mine :-)Wouldn't an idea to rename the entity from usage counter to e.g. energy consumption which comes a bit closer to the real sense of it? Just an idea. Thank you for your great work hereDieter

Am Samstag, 25. Februar 2023 um 21:22:37 MEZ hat chises ***@***.***> Folgendes geschrieben:  

Hello and thank you @Dieter-GitHub :) this entity is added to add a basic support for the energy dashboard (#22) I am not happy with the current solution for the energy dashboard because this value is only updated once a day and the energy dashboard expects some "realtime values". Otherwise it will show "0" in the dashboard after a short amount of time:

But the entitiy has the required attributes for homeassisant to add it energy dashboard.

So people can add it here.

The value is updated one time a day because the oiflox measurement is only done once a day. That volume is saved in the entity as a additional attribute "current value" and the difference to the previous measurement is mulitplied by 9.8 (https://github.com/chises/ha-oilfox/blob/main/custom_components/oilfox/sensor.py#L38). 9.8kWh energy is in 1 liter oil (based on my google search ;) )

That is the idea behind that.

so long story short: to provice a entity that can be added to the energy dashboard. The kWh is calculated based on the daily used liter and multiplied by 9.8.

I am still thinking about a bettersolutions to provice better values for the energy dashboard but for the moment: it is what it is ;) Currently I am thinking about: divide the value by 1440 (because a day got 1440 minutes) and increase the usage counter every minute with the calculated value.

Thank you for your feedback! Feel free to ask something else or close this issue, if you are fine with my answer.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

chises commented 1 year ago

That is a good point and name! I will check the dependencies (if something will break for existing setups) and rename it! :)

chises commented 1 year ago

Fixed it, friendlyName will change to energyConsumption in the next version. The entity unique ID will be the same, so no old data will be lost :)

chises commented 1 year ago

renamed in PR30 and released within the new version: v0.1.9 image