I have a sensor that updates around every second with the power consumed by my house.
I want to store the maximum into another sensor
At the moment I’ve created a number helper and an automation
The trigger is the state change of the sensor (so it’s triggered very often, nearly every second)
The condition is sensor>input number
The action is updating the input number with the value from the sensor
This seems very inefficient to me as the automation is triggered continuously, is there an alternative?
alias: Max Power House Inst
description: ""
triggers:
- entity_id: sensor.prism_potenza_casa
trigger: state
conditions:
- condition: template
value_template: >-
{{ states('sensor.prism_potenza_casa') | float >
states('input_number.max_house_power') | float }}
actions:
- target:
entity_id: input_number.max_house_power
data:
value: "{{ states('sensor.prism_potenza_casa') | float }}"
action: input_number.set_value
mode: single