Hi There,
I have a dehumidifier, and would like to create a sensor that tells me the total runtime (HH:MM) and will only reset when I manually reset it to 0.
From all of the integrations, which one is the best to use?
Hi There,
I have a dehumidifier, and would like to create a sensor that tells me the total runtime (HH:MM) and will only reset when I manually reset it to 0.
From all of the integrations, which one is the best to use?
You can use a History Stats sensor with an Input button helper.
- platform: history_stats
name: "Dehumidifier On-Time"
entity_id: switch.dehumidifier
state: "on"
type: time
start: >
{{ states('input_button.reset_dehumidifier_on_time') | as_datetime }}
end: "{{ now() }}"
Thanks! From all of the possibilities I was looking at before asking, this wasn’t one of them.
I have a little error here:
Error fetching Dehumidifier On-Time data: float() argument must be a string or a real number, not ‘NoneType’
- platform: history_stats
name: Dehumidifier On-Time
entity_id: binary_sensor.dehumidifier
state: 'on'
type: time
start: >
{{ states('input_button.reset_dehumidifier_on_time') | as_datetime }}
end: '{{ now() }}'
You likely just need to “press” the button to give it an initial timestamp.