I have a challenge, I’m trying to capture an incremental power usage value every 24hrs (eg at midnight) and display this value as a daily sensor value which is only updated once a day (so the value shows the previous days 24 hr usage).
I have a the configuration setup to display the cumulative power usage throughout the day as a dynamic value, but I want to capture a static value every 24hrs. Below is the configuration to grab the dynamic HS110 cumulative power consumption (reset every 24hrs)
- platform: template
sensors:
todayenergy:
value_template: ‘{{states.switch.pc_powerpoint.attributes[“today_energy_kwh”]}}’
friendly_name: “Today’s Energy Use”
unit_of_measurement: ‘kWh’
I’m thinking i need to use an automation job to fire off at a designated time which is fine. But i want the action to update a variable or a template sensor value with the switch attribute or a sensor value which im unsure of.
If anyone has any advice on how to store a variable so that it can be displayed and referenced in calculations that would be much appreciated.