Hi everybody,
I have a CH-926 coin collector which I am trying to integrate to my Home Assistant via ESPHome
.
Does anybody here have experience with this kind of device and can help me integrate it in Home Assistant?
The device itself has
12V
GND
COIN
COUNT
pins. I have read you have to connect ground to both your 12V power supply’s ground and your arduino (or in this case, ESP8266). I only tested this with the arduino, and when I do, the device will not power on. So I did in later tests not connect GND to anything other than the 12V power supply.
I have tried these three different ways to integrate it via ESPHome
so far
sensor:
- platform: adc
pin: A0
name: "Coin Collector"
update_interval: 1s
# OR
sensor:
- platform: pulse_counter
pin: D5
name: "Pulse Counter"
# OR
binary_sensor:
- platform: gpio
pin:
number: D5
mode: INPUT_PULLUP
name: "Input Pullup"
filters:
- delayed_on: 2s
- delayed_off: 2s
I have tried both COIN
and COUNT
for this, as I wasn’t sure which to use. Neither of these will provide reliable output. Sometimes, it will automatically switch between ON
and OFF
when I am not doing anything at all, other times it will not switch when I actually insert a coin.
I have also tried putting different resistors in between the ouput (COIN or COUNT) and A0/D5. This will sometimes produce less output, at other times no output at all.
Unfortunately, there isn’t much documentation that I can work with. I have found this sample arduino code, which will work on an Arduino MEGA 2560
, well, at least to some extend. It does actually count inserted coins, though it will not reliably identify which coin had been inserted (though this might be configurable when setting up the coin collector).
I read that you can somehow run “generic” arduino code in ESPHome, but I have not the slightest clue on how to do this. Does anybody here and would help me out?
I would at least have this as a binary_sensor entity reporting when any coin has been inserted. If possible, it’d be nice to report which coin had been inserted. So far, I trained the machine to identify three different types of coin (50c
, 1€
, 2€
). This is all just for fun, so the any coin option would already be great, but if possible, I’d like to report the value just for completeness’ sake.
Thank you for your ideas