Pull Attribute Help

I am sure its been done a million times but i need to get the competion time of my washing machine runtime for display on my dashboard. Can someone please help.

I have this in my yaml but the value is unknown

platform: template
sensors:
washer_completion_time:
friendly_name: “washer finish time”
value_template: “{{ state_attr(‘timer.washing_machine_runtime’, ‘finishes_at’) }}”

And if possible I just want the time

Please format your code correctly by surrounding it with three backticks like this:
```
YOUR CODE HERE
```

There could be various indentation and character errors in your code. The template looks good, so perhaps you didn’t reload template entities (or restart, if it’s your first template sensor). Is there anything in the logs?

In modern configuration, returning just the time:

template:
  - sensor:
      - name: Washer finish time
        state: "{{ state_attr('timer.washing_machine_runtime', 'finishes_at')|as_timestamp|timestamp_custom('%H:%M') }}"

You don’t need to use YAML though: the UI is good for setting up template sensors now, under Helpers:

Brilliant, never realised you could use a helper ! piece of cake :slight_smile: now to figure out how to attach the ETA of the wash to the message that says the washing has started :slight_smile:

  message: "Washing has started, ETA {{ state_attr('timer.washing_machine_runtime', 'finishes_at')|as_timestamp|timestamp_custom('%H:%M') }}."

How easy was that !! :slight_smile: Wife is going to love me :slight_smile:

It’s the 21st century, you’re also allowed to use the washing machine. :wink:

1 Like