jcallaghan / home-assistant-config

My Home Assistant configuration & documentation.
https://www.jcallaghan.com/
MIT License
173 stars 8 forks source link

Washing machine energy usage and cost πŸ§ΊπŸ”ŒπŸ’Έ #211

Open jcallaghan opened 3 years ago

jcallaghan commented 3 years ago

I use a TP-LINK energy plug to monitor my washing machine. I use this data in my washing machine status automation (#143). The switch entity has a number of attributes that share the energy usage data.

image

To make it easier to work with attributes I created some template sensors that exposed them as entities. At the time I thought it would be easier to monitor and I also wasn't aware of the utility_meter integration.

image

With the help of a few more template sensors, I can take the energy usage for today and all the energy used and work out the cost. Rather than store the energy price (pence per kWh) in the template sensor I used an input_number to help me update the price over time more easily.

I've since removed the all of the template sensors I originally created to track the smart plug energy data attributes. Instead, now I just have one state_attr('switch.washing_machine','current_a') | float which I use to power utility_meter and in my washing machine automation.

image

jcallaghan commented 3 years ago

Related: #143 #209

jcallaghan commented 3 years ago

https://www.home-assistant.io/integrations/utility_meter/

Home Assistant
Utility Meter
Instructions on how to integrate the Utility Meter into Home Assistant.
jcallaghan commented 3 years ago

HomeAssistant utility_meter integration documentation - https://www.home-assistant.io/integrations/utility_meter/