Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miele washing machine #62

Closed
dagmoen opened this issue Nov 26, 2022 · 12 comments
Closed

Miele washing machine #62

dagmoen opened this issue Nov 26, 2022 · 12 comments

Comments

@dagmoen
Copy link

dagmoen commented Nov 26, 2022

Hi, I've tried to get a progress bar for my Miele washing machine. But I've been unable to get it to work.
Are you able to help me to figure it out? I've tried creating a template sensor but I was unable to get it to work.
The remaining/duration is in minutes, and the start and endtime is in hh:mm.

image

@rianadon
Copy link
Owner

It's not your fault you've been unable to get the card to work with your washing machine. Based on these entities, there's no way to use the card without resorting to creating a template sensor.

The card expects the start and end times to be full formatted dates—this way it can handle multi-day timers correctly. Your entities do not have dates in them, so a template sensor would need to insert the current date in front of the finish_at and started_at times.

I'll write up more later. I need to refresh myself on how templates work.

However, if you know the washing machine will always run for a set duration, you can use the duration: { fixed option and the washing_machine_remaining_time_2 sensor to get a working timer.

@dagmoen
Copy link
Author

dagmoen commented Nov 29, 2022

Hi, thanks for helping. The duration can vary depending on the program etc.
This is my attempt to creating the template sensor, but I couldn't get it to work.

`template:

  • sensor:
    • name: "Washing machine timer"
      state: "{{ states('sensor.washing_machine_status_2') }}"
      attributes:
      duration: "{{ states('sensor.washing_machine_elapsed_time_2') }}"
      start_time: "{{ states('sensor.washing_machine_started_at') }}:00"
      end_time: "{{ states('sensor.washing_machine_finish_at') }}:00"
      remaining: "{{ states('sensor.washing_machine_remaining_time_2') }}"`

@rianadon
Copy link
Owner

Thanks for writing what you have! You should only need start_time and end_time, but they need to have the full date in them. Try this template:

sensor:
  name: "Washing machine timer"
  state: "{{ states('sensor.washing_machine_status_2') }}"
  attributes:
    start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') }}:00"
    end_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_finish_at') }}:00"

@dagmoen
Copy link
Author

dagmoen commented Dec 2, 2022

Excellent! It worked! Love the card, will implement it for my dryer and dish washer as well :)

image
image

Thanks! :)

@rianadon
Copy link
Owner

rianadon commented Dec 3, 2022

Wonderful! I'm glad it works! I'll add Miele to the list of integrations on the readme.

Also since the washing machine runs for over an hour, I'd recommend you give the remaining time some more space with the text_width: 4.5em option. That should make the card look a little less cramped 🙂

@rianadon rianadon closed this as completed Dec 3, 2022
@Razsmithii
Copy link

Razsmithii commented Feb 28, 2023

Hello, here a tested and working template for using a Miele tumbler dryer together with the Miele integration:

grafik

In sensors.yaml:

- platform: template
  sensors:
    trockner_timer_3:
      value_template: "{{ states('miele.trockner') }}"
      attribute_templates:
        start_time: "{{ now().strftime('%Y-%m-%dT') + states.sensor.trockner_status.attributes.kickoffTime + ':00' }}"
        end_time: "{{ now().strftime('%Y-%m-%dT') + states.sensor.trockner_status.attributes.finishTime + ':00' }}"

Here the configuration for the card itself:

type: custom:timer-bar-card
entity: sensor.trockner_timer_3
name: Trockner
active_state: In Betrieb
icon: mdi:tumble-dryer
debug: false
guess_mode: false
text_width: 4.5em
bar_radius: 4px
bar_width: 40%

Maybe someone can help me with formatting it correctly for Github, so everybody simply can copy it :-)

@rianadon
Copy link
Owner

@Razsmithii thank you for posting the template and config! I've edited your comment to include the code block formatting.

@pille89
Copy link

pille89 commented Nov 30, 2023

Hello,

when I create the following sensor:

 - sensor:            
    - name: "washing_machine_timer"
      state: "{{ states('sensor.washing_machine_status') }}"
      attributes:
      start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_starte_um') }}:00"
      end_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_ende_um') }}:00"

I get the following error message:

Logger: homeassistant.config
Source: config.py:505
First occurred: 10:22:18 (1 occurrences)
Last logged: 10:22:18
Invalid config for [template]: expected a dictionary for dictionary value @ data['sensor'][0]['attributes']. Got None extra keys not allowed @ data['sensor'][0]['end_time']. Got "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_ende_um') }}:00" extra keys not allowed @ data['sensor'][0]['start_time']. Got "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_starte_um') }}:00". (See /config/configuration.yaml, line 232). 

2023-11-30_11h00_24

2023-11-30_11h01_34

Can anyone give me a tip?
Thx

@rianadon
Copy link
Owner

rianadon commented Dec 1, 2023

It looks like it might be an error with the indentation?
The start_time and end_time underneath attributes in the YAML you posted should be indented by a few more spaces (at least two).

@ncd7
Copy link

ncd7 commented Jan 14, 2024

BTW this doesn't quite work when the start time and end time cross a date boundary (which is exactly why it's a mistake for Miele to only include the "local time" portion of the full timestamp :). Luckily, this can be detected by looking at the elapsed time, but that does cause the template sensor to be be updated by HA every minute, which kind of sucks but not the end of the world :).
(Also, I still prefer to use the start-at time as that's more accurate than using elapsed so I only use elapsed to detect midnight boundary cross).

@markusby
Copy link

markusby commented Mar 9, 2024

Hi There,
can someone mybe help me, as I'm not getting the Miele dishwasher in the time.bar integrated?

I added in the config.yaml the folloing sensor:

sensor:
  - name: Dishwasher_Time
    unique_id: dishwasher_time
    state: "{{ states('sensor.dishwasher_status') }}"
    attributes:
      start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.dishwasher_started_at') }}:00"
      end_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.dishwasher_finish_at') }}:00"

sensor.dishwasher_status:
image

sensor.dishwasher_started_at
image

sensor.dishwasher_finish_at:
image

But somehow it status can not be read incl. start/end time
image

Any ideas I can look into would be appreciated.
Markus

@runeix
Copy link

runeix commented Apr 26, 2024

Hi There, can someone mybe help me, as I'm not getting the Miele dishwasher in the time.bar integrated?

I added in the config.yaml the folloing sensor:

sensor:
  - name: Dishwasher_Time
    unique_id: dishwasher_time
    state: "{{ states('sensor.dishwasher_status') }}"
    attributes:
      start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.dishwasher_started_at') }}:00"
      end_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.dishwasher_finish_at') }}:00"

sensor.dishwasher_status: image

sensor.dishwasher_started_at image

sensor.dishwasher_finish_at: image

But somehow it status can not be read incl. start/end time image

Any ideas I can look into would be appreciated. Markus

I seem to have the same problem trying to get my washing machine to work with:

`sensor:
    name: "Washing Machine Timer"
    state: "{{ states('sensor.washing_machine_status') }}"
    attributes:
      start_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_started_at') }}:00" 
      end_time: "{{ now().strftime('%Y-%m-%dT') + states('sensor.washing_machine_finish_at')  }}:00"
      duration: "{{ states('sensor.washing_machine_elapsed_time') }}"
      remain_time: "{{ states('sensor.washing_machine_remaining_time') }}"'

when checking in the developer tools this returns me:

`sensor:
    name: "Washing Machine Timer"
    state: "running"
    attributes:
      start_time: "2024-04-27T22:58:00" 
      end_time: "2024-04-27T01:28:00"
      duration: "112"
      remain_time: "39"'

so it can grab all the data, although the guide says that i only need the start and end time, and then i pass this entity through to the card

type: custom:timer-bar-card
entity: sensor.washing_machine_timer
name: Washing Machine
debug: true
sync_issues: ignore

the output from debug is then

State: sensor: name: "Washing Machine Timer" state: "running" attributes: start_time: "2024-04-27T22:58:00" end_time: "2024-04-27T01:28:00" duration: "116" remain_time: "34" (state mode = idle)
Mode: idle (explicit; guess mode produces N/A)
Duration: second
Time remaining:
Counter:
Attr: {"icon":"mdi:washing-machine","friendly_name":"washing machine test 1"}

so it looks like it can grab the data from the start and finish time and even the duration and remaining time, but it can't map these to the variables in the card and work out that it's active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants