Node-Red: When TV is turned off, is there any way to get the history of the last 5 minutes it was on, then restore it when I turn it back on?

Let’s say I turn my tv before I leave the house. I want Node Red to pull the last states/attributes of the TV and associated devices (android box, speaker level, last channel/input it was on, etc.) before shutdown and store it. Then when I return home and my zone arrival activates, the TV turns on to the last setting it was before it was turned off?

I’m assuming that when I press the tv off button, I can’t create a scene because creating a scene with snapshot will pull the CURRENT state of the TV (off) and will not restore it when it comes on. That is why I want it to pull from the TV’s history within the last 5 minutes (or even better the last instant before it was shut off).

You could create/update the scene whenever a change to one of the attributes in the scene occur, except for when the TV is turned off.

Good idea! I’ll try that now

did that work out for you?

It did! Thank you for the help!