maurizio53
(Maurizio Fabiani)
May 7, 2022, 3:35pm
1
I am using this sensor to check the amount of time my SkyQ decoder worked last 24 hours:
- platform: history_stats
name: SkyQ ON Ieri
entity_id: media_player.sky_q
state: "playing"
type: time
end: "{{ now().replace(hour=0, minute=0, second=0) }}"
duration:
hours: 24
And before upgrading to the latest release of HA (2022.5.2) the sensor had also an attribute showing the real hours and minutes while the state were showing an absolute number like 9.89.
Now, with the latest release the attribute disappeared and the state actually shows 9.89 hours.
How to convert this state to real hours and minutes? Or how to have back the attribute?
P.S. Hope you understand what i mean due to my poor english…
maurizio53
(Maurizio Fabiani)
May 7, 2022, 3:44pm
3
Thanks, but how to add that template in my sensor statement?
petro
(Petro)
May 7, 2022, 3:46pm
4
You can’t, you make a separate template sensor, or use that template wherever you were using the attribute before.
maurizio53
(Maurizio Fabiani)
May 7, 2022, 3:50pm
5
Hmmm… in my case i was using this card:
- type: attribute
entity: sensor.skyq_on_ieri
name: Sky Q Acceso Ieri
icon: phu:sky-q-logo
attribute: value
… and now?
petro
(Petro)
May 7, 2022, 3:51pm
6
you make a template sensor
petro
(Petro)
May 7, 2022, 3:52pm
7
exactly like you did in this post from 2 years ago
Can somebody help me to understand why this sensor template is not working anymore after installing 0.107.x ?
- platform: template
sensors:
nextsunrise:
entity_id: sensor.time
friendly_name: 'Prossima Alba'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %H:%M') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sensor.time
friendly_name: 'Prossimo Tramonto'
…
1 Like
maurizio53
(Maurizio Fabiani)
May 7, 2022, 3:55pm
8
Wow… I feel like being spied on by the CIA or the FSB!
BTW Thanks always for your precious support…
petro
(Petro)
May 7, 2022, 3:56pm
9
Just trying to get you to combine skills you already have I remember helping you in the past.
2 Likes