I would like to make the lighting in my home smart but am inexperienced with ESPHome and Home Assistant.
At het moment the lights in my house are managed by relays and low voltage momentary switches.
I would like to keep this as is because it is a stable system.
Parallel to this system I would like to add a esp32 that controls everything via HA / google home.
Example:
I Would add a optocoupler module in parallel to the 230V of the light source and connect this to gpio pin D6. This would give information to the module if the light is on or off.
Via pin D11 I could control the light switch via the SV-5A1R1P-N PNP module 3.3V signal to 24V.
I think the hardware side is ok but I am unable to correctly program the ESP32 with ESPHome so that in HA it shows up as a light with push button.
I could just create a push button in ESPHome separate of the light state but I want ESPHome to know that this button via D11 controls the light on D6.
@thomas.beutels the 1-Bit AC 220V Optocoupler Isolation Module Voltage Detect Board Adaptive 3-5V For PLC 24V Level TTL Level you are using only measures 220v but can be powered from 3.3 to 24v. I don’t see anywhere in the description that it can measure less than 220v.
The reason I am interested as this is exactly what I am thinking of doing! I might buy one and test!
I realised I misread your schematic. The 24V was close to the L line … so I though you were measuring 24V. But I see clearly it is AC Live! And this module looks perfect. Thank you for the link.
My lighting is 220V and controlled by Wise Box scene setting (Wise Scene Box Receiver Clear Lid 240V 4x500W | Wireless Radio Technology); the circuits are 3.3v momentary for on/off and hold to dim. It can also be controlled by way of RF … which is what my circuit is set up to do; it activates a RF transmits which has been programmed to control a few circuits between four different boxes. The only thing I am missing is a sensor to tell me when a circuit is on… and of course you are right …it probably will not work if the circuit has been already dimmed… more fiddling and testing!