phrz / lg-washer-dryer-card

Lovelace cards for use with the Home Assistant LG ThinQ Integration
MIT License
260 stars 52 forks source link

remain_time or reserve_time? #27

Open rpanizzon opened 1 year ago

rpanizzon commented 1 year ago

Thanks for the update to fix the time issue - the new changes work great. However, I'm wondering whether we should be using reserve_time instead of remain_time in washer_time_display. The reason I suggest it is if you use the Time Delay feature on your Washer, the display shows "Time to end" including the delay time. If we want the card to mimic the actual washer display, then I think we should be using reserve_time.

rpanizzon commented 1 year ago

Looks like reserve_time should only be used if run_state equals 'Delay Set'. This is the change I made to config.yaml to display the delay time when using 'Delay End' on the machine.

washer_time_display:
    friendly_name: "Washer Time Display"
    value_template: >
        {% if is_state('sensor.washer_run_state', '-') %}
        {% elif is_state('sensor.washer_run_state', 'unavailable') %}
        {% elif is_state('sensor.washer_run_state', 'Standby') %}
           -:--
        {% elif is_state('sensor.washer_run_state', 'Delay Set') %}
           {{ state_attr("sensor.washer","reserve_time").split(":")[:-1] | join(':') }}          
        {% else %}
           {{ state_attr("sensor.washer","remain_time").split(":")[:-1] | join(':') }}   
        {% endif %}