Hello,
So I have a “number” helper that gets incremented by 10 everytime I get an action from sensor (1clic = 10L gas).
That works, I have a nice graph showing the “index” increase throughout the day.
The helper gets updated only when there’s an action from the sensor though…
I want to see the instantaneous usage using a derivative sensor, but since the helper does not get updated when the boiler stops it shows the last usage until the boiler restarts.
I tried to create an automation that would update the helper with the same value every 2 minutes if the last action was more than 2 minutes ago… but the helper does not update (edit: if the value is exactly the same) even if I do it manually…
Since a picture is worth 1000 words :
alias: Ikea-gaz_counter-2
description: ""
trigger:
- platform: time_pattern
hours: "*"
minutes: /1
seconds: "0"
condition:
- condition: template
value_template: >-
{{ as_timestamp(now()) -
as_timestamp(states.input_number.gaz_counter.last_updated) > 120 }}
action:
- service: input_number.set_value
data:
value: "{{ states('input_number.gaz_counter') | int + 0 | int }}"
entity_id: input_number.gaz_counter
mode: single
I tried with value: "{{ states('input_number.gaz_counter') }}"
first but it did not work either that’s why i added the int + 0 hopping it would work…
Any idea would be great !
Thanks in advance !