The problem is that, if my TV is off, I can turn it off again but it actually turns on, even though its state remains off. It makes sense to me that an IR remote would send a single on/off command, and that it’d be up to the device itself to toggle its on/off state. But those packets were gotten by pressing the same on/off button for each respective remote, and they’re clearly different. So that suggests to me that the off packet should probably do something unique rather than toggle, but it doesn’t.
What am I missing here? Can I only toggle on/off a device, even though the packets I got for the press of the same button were different?
I may have misunderstood you but I got that you have a remote for your TV with a single on/off-toggle-button. You have learned that button to your RMPro and got different codes but wonder, why both codes do the same thing? If this is the case, than it is probably by accident that the codes seem different (maybe IR signal noise or something like that?). In reality, the codes do the exact same thing: toggle the power of the TV. I can’t imagine another possibility how the RM should distinguish between on and off without you having learned specific commands to the RM with two specific, different buttons.
Yeah, I suspected as much, though I wasn’t sure how much noise tolerance there was in the RF/IR command set, if remotes had some sort of receive circuitry and could detect device state, etc.
Is there any way to at least detect whether the device is on or off? I likely won’t use the remotes at all once I’ve programmed them into HA, since voice commands are easier than hunting down a physical device. But if I have an automation that turns off devices when I’m not home, and that automation just toggles them, it isn’t very useful.
Breaking it down, there are two issues. HA would need to persist switch state across restarts, and it would need to not turn a switch off if it already is. I don’t know if the first is already a thing, and while I understand the second would cause conflicts in the case of manual changes, the goal is to not need manual intervention by the remotes themselves once this is programmed.
I have an RM Pro connected to a heater. Admittedly mine has separate on/off buttons, but HA does remember the state correctly. Nevertheless, it’s still a problem because the device can be operated independently of HA. In my case, I also have a tp-link switch connected to the heater, so I monitor the power usage to update the state of the heater, independent of the RM Pro. Could you do something similar? Perhaps by using presence detection when they’re connected to your home network (ie. on).
I can probably monitor the power use to set state. That’s a good idea. Thanks for suggesting it–I need to learn how to think creatively like that to wrangle all these non-smart appliances.
Do you have any recommendations for smart outlets/power strips? I typed something like “wifi outlet” into Amazon, and the first few pages of brands all looked no-name but many claimed to be Alexa compatible. I can’t imagine Alexa works with a million no-name brands, so there has to be some common underlying chipset providing a standardized interface I imagine. Or maybe I’ll use zwave for these. My wifi isn’t 100% reliable, so transitioning off of it where possible might be a good move. In any case, trying to cross-reference the brands on the first few pages of results with Home Assistant’s component list didn’t seem to yield anything useful.
I’m using TP-Link HS110 smart plugs. They work fine except for two problems.
Firstly, they spam a non-existent URL with a DNS lookup (about 1 a second). I “fixed” this by blocking it using pi-hole, after which they keep doing it, but less often. It still means that pi-hole blocks about 50% of all my DNS traffic. So given hindsight, I’d pick something else.
Secondly, monitoring power only works easily and reliably with devices that continually use power when they’re on. Mine are connected to a washing machine, dryer and gas heater (with electric fan). They all tend to use minimal power intermittently when on (eg. when the room is warm enough the heater consumes the same electricity as when off ~5W). I’m using Node-Red, so I just checking again in 5 minutes, which is a bit hit and miss (particularly as we’re coming into Spring). An improved solution would be to use the Trigger node (in Node-Red or the equivalent in HA).
Is there a way to have these switches at least not send the off command again if the switch is already off? I understand the switch will get out of sync if you use the remote but if you don’t then it should work fine.
That seems like a lot of work just to get a switch to function like a switch. I was able to do this no problem with a virtual switch in SmartThings, but I’m HA it’s a whole process.