In the below alert - I I’m trying to alert my mobile if a chromecast has been left streaming - and also include the amount of time it has been streaming.
The alert itself works - after 60min - I get the notification - but the actual last_updated time given is incorrect, random minutes e.g. first 60min - the message said 7min - second 60min the message was 5min.
I suspect its because the actual media_player is updating meta-data (images,etc) as it plays - is there away of getting the time the actual state changed to playing?
bedroom_chromecast_left_streaming:
name: "Bedroom Chromecast has been left streaming for {{ relative_time(states.media_player.bedroom_tv.last_updated) }}."
entity_id: media_player.bedroom_tv
state: "playing"
repeat: 60
skip_first: true
can_acknowledge: True
data:
tag: 1
channel: Media
actions:
- action: "StopBedroomStream"
title: "Stop"
- action: "PauseBedroomStream"
title: "Pause"
notifiers:
- cellphone_group