Comments (7)
I have found a solution
change
{{ state_attr('sensor.washer', 'remain_time') }}
to
{{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }}
from lg-washer-dryer-card.
This was my solution, but I think I might like @Hootie81's option better.
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 %}
{{ state_attr('sensor.washer', 'remain_time').split(':')[0] + ':' + state_attr('sensor.washer', 'remain_time').split(':')[1] }}
{% endif %}
dryer_time_display:
friendly_name: "Dryer Time Display"
value_template: >
{% if is_state('sensor.dryer_run_state', '-') %}
{% elif is_state('sensor.dryer_run_state', 'Standby') %}
-:--
{% else %}
{{ state_attr('sensor.dryer', 'remain_time').split(':')[0] + ':' + state_attr('sensor.dryer', 'remain_time').split(':')[1] }}
{% endif %}
from lg-washer-dryer-card.
Hey y'all! I actually got this wrong, I had a tweak on my local version that was not in the repo, but it was getting this timestamp parsing wrong as well—it was stripping the hour, which was misleading when the run time was >1h.
I've changed it to strip the seconds, not the hour. This is also better because it reflects accurately how the time display on my washer/dryer actually looks. No leading zero because the hardware doesn't do that either.
I chose not to do strptime
as recommended above, because this is not a time, but a duration, and as shown above, that added timezone complexity etc., because it's not what strptime
is meant for.
Basically: it should be fixed now with 6e1bfb1. Let me know if you try it out! I'll keep this open in case anyone comes back on this.
from lg-washer-dryer-card.
Since my dryer is currently running, can confirm this works:
dryer_time_display:
friendly_name: "Dryer Time Display"
value_template: >
{% if is_state('sensor.dryer_run_state', '-') %}
{% elif is_state('sensor.dryer_run_state', 'Standby') %}
-:--
{% else %}
{{ as_timestamp(strptime(state_attr('sensor.dryer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%-H:%M') }}
{% endif %}
from lg-washer-dryer-card.
To overcome possible issues with timezones I use:
{{ as_timestamp(strptime(state_attr('sensor.washer', 'remain_time'), '%H:%M:%S')) | timestamp_custom('%H:%M',local=false) }}
from lg-washer-dryer-card.
I cannot reproduce this issue (no seconds on my end). Closing but this is useful reference for anyone with this issue. If I can reproduce this, I will modify the configuration to strip seconds.
from lg-washer-dryer-card.
from lg-washer-dryer-card.
Related Issues (20)
- Instruction Improvement HOT 1
- Feature request: Child lock icons/status HOT 2
- Sensor Missing HOT 3
- Multiple images not showing u p HOT 2
- Wash status is not displayed HOT 10
- Card Backgrounds for WM4000HWA and DLEX4000W HOT 2
- README.md image links are b0rked HOT 1
- Everything works except the font HOT 1
- How do I remove this error logo from the cards? I don't have any errors with the integration so not sure why they're there. HOT 3
- Feature request: Display hh:mm only for time remain HOT 8
- Format time from 0:00:00 to -:–:– for washer when complete and system is off HOT 1
- Card showing invalid status? HOT 10
- Still can't get remaining time to be -:-- when state is Off/Standby/- HOT 5
- remain_time or reserve_time? HOT 1
- Add icon in French HOT 10
- Power usage information HOT 1
- [BUG] 7segment font not used in iOS HOT 2
- Pictures disappeared in Lovelace HOT 2
- [BUG] Repository structure for main is not compliant HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lg-washer-dryer-card.