Closed raymondsfk closed 1 year ago
Hi, 1 line needs to be replaced in configuration.yaml
original:
{{ state_attr('sensor.washer', 'remain_time') }}
replace it with this:
{{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }}
Hi, 1 line needs to be replaced in configuration.yaml
original:
{{ state_attr('sensor.washer', 'remain_time') }}
replace it with this:
{{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }}
Thank you so much, it works like magic!
Hi, i have same problem with time :-(
My card show time with seconds... I've tried change configuration.yaml but time is still with seconds... Can you help me?
Hi, attached is my working code, hope it will work for you too,
platform: template sensors: washer_door_lock: friendly_name: "Washer Door Lock" value_template: "{{ state_attr('sensor.washer','washer_door_lock') }}" washer_time_display: friendly_name: "Washer Time Display" value_template: > {% if is_state('sensor.washer_run_state', '-') %} {% elif is_state('sensor.washer_run_state', 'Standby') %} --:-- {% else %} {{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }} {% endif %} dryer_time_display: friendly_name: "Dryer Time Display" value_template: > {% if is_state('sensor.washer_run_state', '-') %} {% elif is_state('sensor.washer_run_state', 'Standby') %} |
---|
{% else %}
{{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }}
{% endif %}
blank: friendly_name: "Blank Sensor" value_template: ""
Still not working :-( I love this LG card, but time covers another icons... configuration.zip This is my configuration.yaml - Now HA show error in log...
It's this entity
This is my config with modified time display without seconds... but still not working configuration.zip
But wit hthis config i dont have any error in log.
Hi - is there anyway to use "-:--:--" as the time remaining after the system is off? I would appreciate it this could be possible instead of just leaving it with 0 time remaining.
Awesome integration btw - absolutely love it!
@raymondsfk I'm glad you got it working in the end. I apologize for my delay, I've been quite busy and behind on my inbox.
@petrklic16 The reason your configuration does not work is because, according to the configuration.zip in this comment, you tried to access the remaining_time
attribute of your sensor.pracka
. There is no remaining_time
attribute, only remain_time
. But the error message in the screenshot shows that you tried to access the remain_time
attribute of sensor.washer
, and of course you don't have a sensor.washer
, so you needed to rename it to sensor.pracka
. I'm guessing the error message is from before you restarted Home Assistant, so it was running an old configuration.
My best advice to you is to take the template code {{ like this }}
and go to /developer-tools/template
in your Home Assistant (if you don't have this, click on your name in the bottom left and turn on Advanced Mode). Tweak it until it works. Then put it in your configuration.yaml and make sure to Restart Home Assistant.
The short answer: make sure you are accessing the remain_time
attribute of sensor.pracka
, in your case, or else it won't work.
@FS1961: the reason your card is showing zeroes instead of going blank is because your machine is showing a different value than my machine when it's done. The code in this project's configuration that you need to change is {% if is_state('sensor.washer_run_state', '-') %}
. This is because when my washer/dryer are done, they show a dash in the run_state
entity. You need to check what your device shows when it's not running, and test for that value in these if statements throughout the configuration. Because I don't know what your particular device shows, I won't be able to tell you what to put in there.
Hi, thanks for the awesome integration. I had a LG washer F2515RTGV which will output 'hh:mm:ss'. Is there away to remove the display of 'ss' ?