How I made sensors that report in W (Watts) work in Energy Dashboard
Now I just need my Aeotec zigbee power monitoring smartplug (that come into HA via MQTT) to be listed as an individual device…
They show like this in Dev:
unit_of_measurement: W
friendly_name: Smart Plug - Back Lounge power
device_class: power
I might try making a template sensor and see if I can get that to work.
OK… I now have this in my configuration.yaml… let’s see if it works (I know a little but not enough so probably wrong somewhere). I can and have added them to individual devices…
UPDATE: Overly complicated. Integration Sensors can be added straight to the dashboard if setup correctly. Instructions updated.
sensor:
#Integration Sensors
- platform: integration
source: sensor.smart_plug_back_lounge_power
name: Smart Plug Back Lounge Energy Spent
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.smart_plug_front_lounge_power
name: Smart Plug Front Lounge Energy Spent
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.smart_plug_front_door_power
name: Smart Plug Front Door Energy Spent
unit_prefix: k
round: 2
method: left
- platform: integration
source: sensor.smart_plug_pool_filter_power
name: Smart Plug Pool Filter Energy Spent
unit_prefix: k
round: 2
method: left
then add this to customize.yaml :
sensor.smart_plug_back_lounge_energy_monitor:
last_reset: '1970-01-01T00:00:00+00:00'
state_class: 'total_increasing'
device_class: energy
unit_of_measurement: kWh
sensor.smart_plug_front_lounge_energy_monitor:
last_reset: '1970-01-01T00:00:00+00:00'
state_class: 'total_increasing'
device_class: energy
unit_of_measurement: kWh
sensor.smart_plug_front_door_energy_monitor:
last_reset: '1970-01-01T00:00:00+00:00'
state_class: 'total_increasing'
device_class: energy
unit_of_measurement: kWh
sensor.smart_plug_pool_filter_energy_monitor:
last_reset: '1970-01-01T00:00:00+00:00'
state_class: 'total_increasing'
device_class: energy
unit_of_measurement: kWh
Why would I rather want to manually install a script, MQTT broker and configure sensors, instead of just using the built-in integration?
If you believe that more and useful information could be retrieved from the Envoy device, why don’t you just contribute to the built-in integration?
This is a great feature, unfortunately, unless I am missing something it is useful only for those with Net Metering solar production. A few utility companies in the US (such as Austin Energy in my case) take the Value-of-Solar Tariffs approach. Basically, your solar system sells all the production back to the utility company and you continue to “consume” all your energy from the grid. I believe offering that option within the HA energy management implementation should be pretty simple.
Here is some VOS info: Value-of-Solar Tariffs | State, Local, and Tribal Governments | NREL
Never expected to like this feature like I do…
The data gives me great in sights about the energy consumption of the home.
If only it would be possible to import historical data from my energy supplier and my solar panel monitoring webpage…
But adding the state_class: total_increasing is not allowed
For what it’s worth, when energy management first became available in the stable release, setting the state_class to total_increasing didn’t work for any sensor. This has now been fixed with some, but not all, of my sensors. I haven’t tracked down what the difference between them all is, but the hack that got me going in the first place was to add in my configuration.yaml:
This sets the total_increasing class to all sensors that start with “currents”. Just change this to flag the sensors you need this attribute set. I’ve put the class statement in as a comment on the sensors that need it so later when this is resolved I can enable it and remove the global filter.
If anyone has an Actron Que air conditioner - Mike (the awesome developer of the addon) added the entity for compressor power - and now I have it as an Individual Device on my dashboard!
Anyone managed to get Sonoff POW readings into energy tab? Trying to solve it since few days now and can’t get it working anyhow.
This is how sonoff data is registered in my HA.
sensor:
- platform: template
sensors:
power_ups:
friendly_name: UPS
unit_of_measurement: W
device_class: power
value_template: "{{ state_attr('switch.sonoff_1000bda5e7', 'power') }}"
history1_ups:
friendly_name: UPS today
unit_of_measurement: kWh
device_class: power
value_template: "{{ state_attr('switch.sonoff_1000bda5e7', 'consumption').0 }}"
For energy tab purposes I understand we need to use power input so we leave consumption as it is and take power into Integration - Riemann sum integral:
What am I missing?
This HA instance work nearly year now, I am updating it OTA constantly. Maybe Energy function needs to be enabled somehow in configuration or registered in recorder?
The answer I think is How could HA know about your individual contract? From what I can tell CO2 signal is showing you what is generally happening on your grid. So for someone that is on a standard contract it should be accurate.
As an aside even with your green power contract you get the same power as your neighbour who may not have the same contract. I understand your electricity supplier just undertakes to buy the equivalent amount of green energy as you use - you may not actually get it though depending on when they are buying and when you are using. More info here Why green electricity contracts fail to deliver green electricity