Notifications for AndroidTV while TV switched off

Hello, I’m trying to use notifications for Android TV.

Regardless of how integration is set up (yaml or gui) the integration works fine if the target tv is set on. But if tv is switched off the notify.tv_name causes an error.

Thus making the following automation:
If door opened: switch on light - notify on tv - wait 5 minutes - switch off light
Would give an error on step 2 (notification) and would never switch off light

Checkout choose, the docs can be found here. It can be used like an if statement, so you can check if the TV is on before trying to send the notification, and continue the sequence of actions either way.

But how the state of tv can be obtained - to use choose i should first obtain the current state.

Would not it be more correct to ‘send message regardless of state’ - if tv is on then it would receive message, else it would be ‘lost’ and do not influence the next actions?

I assumed, if you could send notifications to the TV, that you’d also be able to obtain the current state. I just have a that I can use to check the state, but I do that through SmartThings since it is a Samsung TV.

I don’t think that would be more correct, no, but I don’t think that matters if that is not the functionality that notify offers. choose is what I would consider the “correct” way to solve the issue that you are facing.