I have been setting up a whole load of automation for various things, we use emby for both media playback and live tv around our house, we use no other sources.
We use NVIDIA shields as devices, and the new remote is awesome for those. One problem I had though is that setting the sleep timer on the TV meant using the normal TV remote, which was less than ideal. I found a node to control our bedroom TV, which allows me to switch it off.
I then created a flow which used MQTT and a raspberry pi with a touchphat, this allows me to set up a button on the pi which when touched started a flow off which eventually culmintaed in the TV switching off. This allowed me to create a Sleep Timer function for the TV controlled by Node-Red rather than the TV.
However, this was lacking something which the normal TV sleep timer does, it shows a notification on the screen when the TV is about to go to sleep. Although I managed to get this to work using the webos notification, it wasn't a solution I could replicate for the other TV's in the house. luckily as I said they all use Emby exclusively......and I knew Emby could show notifications.
So I put together this flow which allows you to display a notification on a given device, you need to supply the server URL, API key, device name of the device to show the notification on, a title, the message body and a timeout.
This now allows me to have a sleep timer start, which shows a message showing that the sleep timer has been activated (or reset if you press it again). At 60 seconds before sleep, it shows a 60 second warning and then repeats at 30 and 10, once it gets down to 0 without being cancelled or reset the tv goes off.
I will probably encapsulate both the sleep timer functionality and the emby functionality (plus other things than just displaying a message) in a proper node-red node, but for the moment this is working great for me.
So if you run emby and would like to display a message, here's the flow to do so!