You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd originally raised a query under the closed previous issue for a Miele washing machine integration.
I've been playing around with the template and with the help of GPT can can get it to calculate and format.
start time
end time
duration (total between start and finish)
duration (current time since start)
remaining time
but i can't seem to get the card to detect that the timer should be active.
I've tried mapping the status "running" using the active_state variable, but that doesn't seem to work.
I've even got it to try and do some maths to check if the end time falls on the following day, i think this sort of works, but produces some interesting results considering that the start date is constantly checked and updated based on current date.
so i'll see if i can get this to be consistent tomorrow.
Template:
name: "Washing Machine Timer v2"state: "{{ states('sensor.washing_machine_status') }}"attributes:
start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') }}:00"end_time: "{% set start_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') + ':00') %}{% set end_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_finish_at') + ':00') %}{% if end_time < start_time %}{% set end_time = end_time + 86400 %}{% endif %}{{ end_time | timestamp_custom('%Y-%m-%dT%H:%M:%S') }}"duration(total): "{% set start_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') + ':00') %}{% set end_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_finish_at') + ':00') %}{% if end_time < start_time %}{% set end_time = end_time + 86400 %}{% endif %}{% set duration_seconds = end_time - start_time %}{% set duration_hours = duration_seconds // 3600 %}{% set duration_minutes = (duration_seconds % 3600) // 60 %}{% set duration_seconds = duration_seconds % 60 %}{{ '%02d:%02d:%02d' | format(duration_hours, duration_minutes, duration_seconds) }}"duration(to now): "{% set start_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') + ':00') %}{% set end_time = as_timestamp(now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_finish_at') + ':00') %}{% if end_time < start_time %}{% set end_time = end_time + 86400 %}{% endif %}{% set remaining_time = states('sensor.washing_machine_remaining_time') | int %}{% set duration_seconds = end_time - start_time - remaining_time * 60 %}{% set duration_hours = duration_seconds // 3600 %}{% set duration_minutes = (duration_seconds % 3600) // 60 %}{% set duration_seconds = duration_seconds % 60 %}{{ '%02d:%02d:%02d' | format(duration_hours, duration_minutes, duration_seconds) }}"remain_time: "{% set total_minutes = states('sensor.washing_machine_remaining_time') | int %}{% set hours = total_minutes // 60 %}{% set minutes = total_minutes % 60 %}{% set seconds = 0 %}{{ '%02d:%02d:%02d' | format(hours, minutes, seconds) }}"
which returns (noting that with the start, end and remain and status, it shouldn't need the duration.
I'd originally raised a query under the closed previous issue for a Miele washing machine integration.
I've been playing around with the template and with the help of GPT can can get it to calculate and format.
but i can't seem to get the card to detect that the timer should be active.
I've tried mapping the status "running" using the active_state variable, but that doesn't seem to work.
I've even got it to try and do some maths to check if the end time falls on the following day, i think this sort of works, but produces some interesting results considering that the start date is constantly checked and updated based on current date.
so i'll see if i can get this to be consistent tomorrow.
Template:
which returns (noting that with the start, end and remain and status, it shouldn't need the duration.
for the card i'm using
But the output gets stuck stating that it's idle, even when active state has been defined as "running" and it can see that the state is "running"
note sure if this is an issue with the template or with the card, or both?
The text was updated successfully, but these errors were encountered: