-
Notifications
You must be signed in to change notification settings - Fork 240
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
Create kwh integration sensor for direct use in energy dashboard #83
Conversation
🎉 HACS repository validator action summary 🎉 |
Todo
|
@NachtaktiverHalbaffe this feature is almost complete. |
So many votes in 2 days only! |
Also added the links to the forum post on the HA forum. |
BTW Shelly as energy icon uses |
Already implemented which had the most votes. The naming for the energy sensors is configurable, because I saw there were multiple opinions for energy and kwh |
I have used mdi:flash, which is the same. This is what all my energy sensors have in my real HA installation |
Yeah I see thanks, they have a minor difference. Will change it before merging this pr |
@bramstroker Sorry had some days off. I think with this new feature you can cut out the part with the Riemann integration and add some explanations about the option to let automatically create energy sensors (or how to disable when you want to do it for yourself). I added a suggestion below (an below a codeblock so you can copy paste if you like) If you want to use the virtual power sensors with the new energy integration, you have to create an energy sensor which utilizes the power of the powercalc sensor. Starting from v0.4 of powercalc it will automatically create energy sensors for you by default. No need for any custom configuration. These energy sensors then can be selected in the energy dashboard. If you want to create your energy sensors by your own with e.g. Riemann integration integration, then you can disable the automatic creation of energy sensors with the option
The part with the energy groups is generally fine imo. If you wish you can change the example with the servers with a more common usecase like lights. I originally added this example because I copy pasted my servers out of my configuration because it was the cleanest and I wanted to keep the examples konsistent with the section with creating a Riemann integration sensor. template:
- sensor:
- unique_id: "energy_server"
name: "All Server Energy Consumption"
unit_of_measurement: kWh
state_class: measurement
device_class: energy
attributes:
last_reset: "1970-01-01T00:00:00+00:00"
icon: mdi:counter
state: >-
{{states('sensor.kingkong_energy') | float + states('sensor.kinglouie_energy')|float}} One question to the feature: Is it possible to add the function to enable/disable the creation of energy sensors on the level of each powercalc sensor for backwards compatibility? It's not a nightmare if I lose the data gathered from my old energy sensors, but using the new feature on new powercalc sensors and keeping my own old ones would be the last 5% to make it perfect. If its merged into master, then I can hop again onto this branch and do some testing. In general I like the direction this custom integration is going, good work 👍 |
Ability to disable energy creation per entity has also been implemented. sensor:
- platform: powercalc
create_energy_sensor: false Also added your suggestion to the readme. Will do some final testing this weekend and than merge this feature. |
This feature is complete as far as I'm concerned. |
@bramstroker Don't know where to post the results of my testing, so I'm doing it here. Hopped onto master branch some minutes ago. Disabling the creation on the level of powercalc sensor works and also disabling it for all powercalc sensors. The created sensors are also picked up by the energy dashboard. Now I only have to look if the energy sensors itself delivers the right values, but I think there cannot go something wrong. Looks like everything is working right now, good work 👍 |
@NachtaktiverHalbaffe is everything working correctly for you now you have it running for 1 day? |
@bramstroker Yep values are right and nothing else broke. This feature seems ready for release from my perspective |
Great thanks for the feedback |
Two choices for the implementation.
https://www.strawpoll.me/45587615
https://www.strawpoll.me/45587624