When the ‘gong’ (which is a loudspeaker) is rang, the power meter reports a value of up to 0.8v or so. The value on the speaker is reporting 0.4 watt. So all low values.
Wanted to use something like a binary_sensor, but that doesn’t change unless I (dis)connect the wires. I would have expected that 0.0v would be off, and > 0.0v would be on. But maybe there always is at least 0.01v on it?
Would like to have a switch in ESPHome to go on when it’s above 0.5v, is this (easily?) possibly?
Currently using ADC pin 34, and the other wire is connected to ground.
There is may be a point on the doorbells board that gets pulled to ground or maybe high to run the tone generator. The high signal would be 4.5v at most since only powered by the 3 batteries.
Can you send a picture of the board?
Thanks CeeCee. I did look into them, but could figure out something that could work.
Hmm, I see what you are doing. Hopefully works, because the adc this is a little ‘special’ First I thought that the switch.turn_on etc was from HA, but it looks like it is from ESPHome itself, which is good.
Check the voltages on the pins marked IDEL and DAT.
That board appears to be the receiver added onto a wired doorbell board.
You should see it change when the button is pressed
Will probably replace the lambda with: return (id(doorbell_chime_voltage).state > 0.1)
Adjusted the voltage to 0.1v, because sometimes it does drop back before continuing back above 0.5v. Could find a way like a delayed_on or a delay in general. It would be nice if the switch was on for 5 seconds when once above 0.1v.
This is not the prettiest solution. I would still like to completely hide the logging that is generated, 4 lines a second, but couldn’t find a way.
Your template will work but I personally prefer a slightly different style where you leave the lambda out and put the logic in the adc. This lets you play with delays etc. It will still generate logs I guess (I have the logger disabled personally).
At my home, with a wired AC doorbell, I decided to instead put the ESP32 completely between the button line and the doorbell so there’s no direct connection. Instead:
the doorbell button line connects to small a 5V power supply,
the 5V from the power supply goes to the ESP32’s GPIO, which has a pulldown configured in esphome,
I have a cheap 4-channel aliexpress SSR module using 4 GPIOs and one output powers the doorbell.
This lets me have an esphome switch to ring the doorbell programatically (only used for alarms, ie. never) and have a template switch to silence the physical doorbell button.