Giter Site home page Giter Site logo

Comments (8)

iwhosts avatar iwhosts commented on July 28, 2024 2

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') }}

from lg-washer-dryer-card.

raymondsfk avatar raymondsfk commented on July 28, 2024

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!

from lg-washer-dryer-card.

petrklic16 avatar petrklic16 commented on July 28, 2024

Hi, i have same problem with time :-(

image

My card show time with seconds... I've tried change configuration.yaml but time is still with seconds... Can you help me?

image

image

from lg-washer-dryer-card.

raymondsfk avatar raymondsfk commented on July 28, 2024

Hi, attached is my working code, hope it will work for you too,

#LG Washer

  • 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: ""

from lg-washer-dryer-card.

petrklic16 avatar petrklic16 commented on July 28, 2024

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...

image

It's this entity
image

from lg-washer-dryer-card.

petrklic16 avatar petrklic16 commented on July 28, 2024

This is my config with modified time display without seconds... but still not working
configuration.zip

image

But wit hthis config i dont have any error in log.

from lg-washer-dryer-card.

FS1961 avatar FS1961 commented on July 28, 2024

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!

from lg-washer-dryer-card.

phrz avatar phrz commented on July 28, 2024

@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.

from lg-washer-dryer-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.