I have setup HASS to track the on status of my TV and DVDplayer . If they are on, I receive an icon called DVD and TV home, which is great. I just need to be able to add a line in my script that says:
If DVD is not home turn on
If TV is not home turn on.
I’m at a loss on how to do this in homeassistant. I see alot of people do this with triggers and automations, however can I do this from a simple script with and if then statement?
How are you tracking the status of these devices? If you are using the media-player component, then you should be able to use the following in your automation:
When the device comes online, it status changes to home - which is great. I just need a way to check its status in the scripts.
movieon:
sequence:
- service: wake_on_lan.send_magic_packet
data:
mac: 00:XX:XX:XX:XX:XX #check if tv_family.home, if no, turn on TV
- service: script.tvon_