Some background: I have had a somewhat functional home theater flow for a while now, but it seems like over time it has been getting less and less reliable (probably due to Vizio TV firmware changes) and I finally got fed up enough to figure out another solution. I know most people control this via a universal remote like Logitech Harmony, but I wanted a solution using the default IR “dumb remote”.
Setup: Vizio P65-F1 Smart TV, power reporting zigbee plug on TV (Iris 3210-L), and any endpoint devices like lights, curtains, scenes, etc.
Initially, I had a pretty simple flow with no looping, and a simple check on if the plug was reporting above or below a power threshold determined by a full black screen, and a rbe just to stop unnecessary polls on the TV. However this flow is completely dependent on the pushing of data from the smart plug both for better and for worse and sometimes resulted in the TV reporting off when it is right on the threshold and does not report again for up to a minute later.
Second iteration had a loop built in to help with the previous issue because it keeps going until it is in the state it should be (again for better and for worse but mostly better). Also it checks for a mismatch between the current state of the TV and the guess of the state according to the power level. The issue with this is if you mix the looping with the plug reporting in, messages can quickly out of hand so I had to put limits on output of the plug and at the start of the flow to calm things down. This worked for a while but recently it was taking like 15 seconds to detect and off state and that delay at night in pitch black isn’t really acceptable.
In the third iteration I thought I would take an entirely different approach, instead of making the guess based on an analog measurement like power, I tried to find a binary one and I came across the castv2 nodes from i8beef which paired perfectly with my Vizio TV that has chromecast built in. The setup was simple, just put in the IP (actually it scanned my network and just found it) and thats basically it. You can send things into the node to cast things to the TV, but it also receives pushes from the CC and outputs them. Unfortunately, it did not include any power data, just if it was in standby, if it was the active input, and some volume data. Then I noticed that part of that volume data includes the mute status, which just so happens to change on the power state of the TV. Now I had a much more reliable input for my flow, so I started simple with the gen 1 of the power monitor flow, but quickly adapted to the second iteration which is currently in use and very reliable.
One thing I did change with the second gen of CC is to remove the first limiter of messages as it provided unreliable results, and on the second instead of dropping intermediate messages like all flows have done previously when used, it just queues them, again because it provided more reliable results. If someone knows why this might by the case that would be interesting to know.
ON: The moment an images comes on the screen triggering my lights and motion sensing to go off.
OFF: Under 5 seconds after pressing the off key on the remote which triggers motion sensing to turn on.
One other thing to keep in mind, when controlling the TV “digitally” whether that be via another input like a pico or via Alexa, this flow becomes unnecessary as I know for a fact what the state will be. These flows are purely to detect physical “dumb” remote changes.
If anyone wants more specifics like what is in the change or switch nodes, let me know.
Also as an aside I was thinking that it could be good to create threads for common areas of the house where people might want to put automations, that way new users just have to pick a room and then go to town.