This morning I added a switch via broadlink integration for my IR blaster to power on/off my xbox. I’ve for some some time now had a simple template switch which references the power sensor on a smart plug for its state and executes a script to have the IR blaster turn the TV on/off. See below for the yaml of both switches.
After getting the xbox switch where I want it (for now), about an hour later I open the app on my phone to find an error message reading Entity not available: switch.living_room_tv
I’ve confirmed that the script the template switch calls still works, the smart plug is working and getting accurate power information, the helper I setup to delineate when the tv is on or off is working. I didn’t make any changes to the the template switch when I added the other switch, it could be coincidence. I also updated HA supervisor this morning IIRC, but that was several hours ago.
I’m at a loss here, I can say with 100% confidence that the yaml for the tv switch has not changed (I got it from a helpful commenter from a post of mine here a while back and I can confirm from that I didn’t accidentally change it in any way).
How are you determining the state of the TV? Is the TV plugged into the Smart Plug? How about posting a connection diagram because what does the Xbox have to do with the other components you mentioned?
Dumb tv plugged into smart plug, when power is over 0.4 Watts and below 105 Watts the binary sensor helper determines the TV is on.
The only thing the TV and Xbox have in common (in HA) is they are both using the same IR blaster and they are next to each other in my configuration.yaml file, my original assumption was I had accidentally changed the tv switch while I was working on the xbox switch as the timing was rather conspicuous.
No, before posting I confirmed the smart plug is working fine. It is reading an accurate power consumption value and responds to on/off commands as I would expect. I just checked again before submitting this reply to be double sure, still looking like rock solid performance on behalf of the plug.
Huh, that did the trick. Kicker is I even looked into that but couldn’t find anything on it, I’m no programmer and mostly taking things from examples and re-purposing them for my own use. I guess sometimes I just lack the right keyword or background knowledge to do the right way, thanks much for the help!