You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to use a timer with a sensor template entity I've made. The entity is to track the progress of media playing on a media player within HA, and has the following attributes: remaining: 174.864, duration: 183.22, friendly_name: Media Player Progress, with the remaining and duration in seconds
Your card configuration
This is my yaml in my config.yaml to make the sensor:
template:
- sensor:
- name: Media Player Progressstate: "{{ states('media_player.tv_google_cast') }}"attributes:
remaining: > {% set pos = state_attr('media_player.tv_google_cast', 'media_position') %} {% set dur = state_attr('media_player.tv_google_cast', 'media_duration') %} {% if pos and dur %} {{ dur - pos }} {% else %} None {% endif %}duration: "{{ state_attr('media_player.tv_google_cast', 'media_duration') }}"
That did the trick, thanks! Now I'm getting another error about it being in the wrong format and needing to convert, but that's a different issue I think! Thanks so much!
Describe the bug
I am trying to use a timer with a sensor template entity I've made. The entity is to track the progress of media playing on a media player within HA, and has the following attributes: remaining: 174.864, duration: 183.22, friendly_name: Media Player Progress, with the remaining and duration in seconds
Your card configuration
This is my yaml in my config.yaml to make the sensor:
Here is my yaml in my card I'm trying to use:
Debug information
Here is a link to a screenshot of what the card is saying and doing with this code
The text was updated successfully, but these errors were encountered: