WTH - Custom easy to add (assumed) energy tracking devices

So it was only a few months ago the "Untracked consumption showed up. It’s a great feature to find out what is not tracked but using energy.

However I’ve started to make custom sensors for the “untracked use”… It’s a bit cumbersome but there are plenty of devices that don’t have energy monitoring but are smart. For example a smart bulb you may know its 3W and you could easily find out if it was on or off state.

2 examples I use are that i know our Smart wifi dehumidifier is about 240W constant draw, give or take a couple of watts. Or our Bathroom extractor fan is 25W sustained.

SO i had to make custom sensors, and run time calculators, then multiply that by the energy to then get it to show on the Energy dashboard.

It would be amazing to have a custom option to add a device…

For example you would enter the enery rate, in wattage or Kw per hour. Then a behind the scenes time tracker would count.

Device = Light
Energy use = 3W/h
Device track trigger= On/off state - you would just select the entity here for the on off/trigger to increment.

Then it would be a super easy way to add devices that you know that lack monitoring.

A bit more context of the bathroom fan (it uses a shelly non PM

So i made these in my config.

  - platform: history_stats
    name: Bathroom Fan Runtime
    entity_id: switch.shellyplus1_c180bd68c_switch_0
    unique_id: bathroom_extractor_fan_runtime
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0, minute=0, second=0) }}'
    end: '{{ now() }}'

& this

  - platform: integration
    source: sensor.bathroom_fan_power_consumption
    unique_id: bathroom_extractor_fan_consumption
    name: Bathroom Fan Energy Consumption
    unit_prefix: k

& This

      bathroom_extractor_power_rate:
        friendly_name: "Bathroom Extractor Power Rate"
        unit_of_measurement: 'W'
        device_class: power
        unique_id: bathroom_extractor_power_rate
        value_template: "{{ 25 }}"
        icon_template: mdi:lightning-bolt  

Then i had to make a Integral sensor. THEN make a Utility meter, just to get this in to the Energy dashboard :smiley:

A built in system would be far easier and far less bloated and be well received! As i have a number of other devices i’d like to add but not gone through the faff again yet.

There’s a third party integration for this called powercalc. It can be as simple as a defined wattage when on or a fully characterised device like a light that draws different power based on brightness and or colour. Powercalc - Virtual power sensors

2 Likes

Oooo i will have to look at that, i’ve not heard of that one, unsure if it will allow it to offset and be added to the untracked data via the energy dashboard though?

It creates power sensors. You would still have to create integral sensors for each device and add them to the Energy dashboard’s individual devices section. They would then be subtracted from the unknown consumption. and energy sensors, see below.

1 Like

Will give it a go! Thanks for bringing that one up :slight_smile: Looking forward a lot to try this one to see if it will work well.

1 Like

In your example I personally would have skipped the history stats.

Just make a power sensor:
{{ 25 if is_state('fan.whatever', 'on') else 0 }}

And then integrate that.

1 Like

The above integration seems VERY powerful. And you don’t have to make extra meters as there is an option in setup per device. I’ll probably bin off my manual setup as this integration adds them so fast with minimal hassle.

It’s also found a few devices automatically like Hue bulbs and such. Rather impressive!

1 Like

@tom_l thanks for recommending powercalc, I’m the developer of that integration and wanted to let you know Powercalc can also create optionally integral sensors and utility meters in one go. you can just check a checkbox and it will make them in conjunction with the power meter.
It will just use the core helpers logic for that, but makes it easy to setup everything in one go, without the hassle to do 5 different configuration flows.

2 Likes