Long winded explanation of what I’m trying to do: In my one of the rooms of my house I have a single light switch that provides power to a ceiling fan. This fan doesn’t have a pull string and we are expected to use the remote to control the light and the fan. I’ve been using a broad link for a while to get the fan and the light separated in Home Assistant. My grandiose plan was to use a shelly 2.5 running ESPHome behind a dual light switch. When the switches to flipped, the broad link would send the appropriate commands. This way I’d have manual switches to control the fan and the light.
The problem: Everything is wired up exactly as it should be and works, with the exception of the physical switches, which should be read as binary sensors via the software. When I flip a switch, the software switch doesn’t change.
The switches are wired to SW1 and SW2 and the ESPHome firmware has those mapped to GPIO 5 and 13 respectively. Any bright ideas what I’m missing?
Here’s the current binary sensor section of the ESPHome firmware:
Here’s the switch config. Although, I’d like to re-iterate that the switch is working fine. The only issue is that the binary sensors aren’t changing based on the state of the physical switch.
Apart from the fact, that O1 and O2 should go to the neutral of two different consumers and not line and neutral of the same consumer I can not see anything out of the ordinary. But this should be a problem no matter how you operate the switch (hassio vs. physical).
Also N should be connected to neutral not ground, but I’m not really an expert.
Do you use spring loaded switches, that return to their position when released?
In hassio the visual state of the switch does not change when you throw the physical switch?
Correct. The issue ultimately is that the state of the switch does not change when I flip the physical switch. The light switch itself is not a momentary switch. It is a Leviton decora, so it stays in place when flipped. I have these same switches working successfully in three other rooms.
Also, blakadder lists those switch inputs as 83n and 82n. The n is something to do with pullup, but I am not sure what that means you should do in you yaml file.
The log doesn’t show anything when the switches are flipped. It does show the binary sensors when it initially loads, but that’s the only mention of them in the log.
I have (in the absence of much else to do) taken a good look at this again.
From your first post it appears that you do not want this wall switch to switch any mains voltage at all. You simply want it to create binary sensor that home assistant reads and then gets the broadlink to actually control the light/fan.
In that case I really can’t understand your wiring diagram, or the need to switch the relays at all. The logic can all be done in home assistant.
Further: the upper switch in your diagram has only one wire connected to it, It won’t switch anything.
The quick update is that I got it working. The wiring in principal was correct, so I’m not sure what was wrong before. I simplified the line wiring and re-installed everything and it worked fine. Now I’m just fine-tuning the software. Thanks for all the help!