I have a d1 mini configured to a reed sensor; copy/pasted from another project. I am trying to modify the project so the sensor will power a relay. I have tried many combinations but can not get the correct code. I did have the switch showing in home assistant but it did not control the relay so I removed the code.
What is the code for the switch and then how does the switch power the relay on/off with the status of the binary_sensor?
The binary_sensor is working correctly, just need to have it control the relay. The relay is stacked on the D1 mini.
The switch should be named “Freezer Light” and will be GPIO5. I want it to turn on when the binary_sensor: “Freezer Door” opens and remain off when the binary_sensor: “Freezer Door” is closed.
thanks, would you mind double checking the switch code? all seems to be correct as far as the switch operation in home assistant however the relay is not responding. If the code looks correct I will check and see if maybe there is a faulty solder connection?
thanks again, very much appreciated.