Remaining_program_time home connect

Hi,

I have a siemens washing machine which I have connected to home assistant through the Home Connect integration. (I run home-assistant (OS) on an RPi3B+)

So far so good. I get the following information in my dashboard:
image
(it is in dutch, but you get the idea.)

I wanted to do some automation in node-red using the remaining_program_time information in the above picture. Unfortunately the information that is shown is some sort of calculation on the actual value of the remaining_program_time. The actual value is something like this:
image
(node red debug node screenshot)

The first part is clear, it is the date, however then it looks like there is a time and some more numbers followed by 00:00. The time is neither the time the washing machine started, nor the time it should be finished. The numers after the time will sometimes get lower and then later on they could be higher again. The 00:00 never changes. See image below for changes time and numbers)

image

I have no idea how to convert this to a the time until the programm will be finished. But apparently it can be done, because the information in the dashboard is correct. (although always with a 2 minutes offset)

Trying to find out how the dashboard convert the numbers to a time remaining, I experimented with the different cards in the dashboard and saw the following: when using an entity card I get the date-time-numbers, but when I use an entities card (with only one entity) it gives me the time remaining. (See image below)

image

Does anyone have any idea how to convert the (strange) date/time/numbers sequense, to a program time remaining?

All the help I can get will be very helpfull.

It is a datetime object. It has a date, then time (to the microsecond) in UTC then the timezone, which unless you are living in UTC+0 does not appear to be set.

The good news is that datetime objects are easy to manipulate to display how you wish. The bad news is I know nothing about node red. I have moved your post to the node red category so you will get the appropriate help.

Hi tom_I,

Thanks for the feedback.

image

So this would mean the following:
hours: 10
minutes: 36
seconds: 39
and then 526800 microseconds.
and then the timezone?

Correct.

Second question I’ve seen in two days that has an issue with ISO datetime format haha.
Shame the relative_time template helper function doesn’t work for future datestimes.

the examples here might help you

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/cookbook/using-date-and-time-entities-to-trigger-flows.html

Hi Kermit,

Thank you! I will look into it when I have the time.

Hi,
I have a Bosch dryer and I have integrated it into Home Assistant.
I have exact the same question. Have you made any progress?

It is not giving an answer on your question, but I do check on the wasmachine programm progress if it is 100% it is ready and sending a message

Anyone have a solution for formating the time string to print it to a lovelace card?

Thanks!

The easiest way would to just create a sensor in yaml

sensor:

  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'

Yes, i have such a sensor, but how to format a time?

Here is mine runtime remaining for a homeconnect dishwaher

 -  platform: template
    sensors:
      opvaskemaskine_program_tidtilbage:
        friendly_name: "Opvaskemaskine tid tilbage"
        value_template: >
            {% if states('sensor.opvaskemaskine_remaining_program_time') == 'unavailable' %} 
              ---
            {% elif (as_timestamp(states('sensor.opvaskemaskine_remaining_program_time'))) >0  %}
              {% set sec = as_timestamp(states('sensor.opvaskemaskine_remaining_program_time'))-as_timestamp(now()) %}
                {%set hr = (sec / 3600) | int %}
                {%set min = sec / 60 - hr * 60%} 
                {% if hr > 0 %}
                  {{"%d:%02d" % (hr, min)}}  
                {%else%}
                  {{min | int}}
                {% endif %}
            {% endif %}
2 Likes

thank you verry much for this template value