I’m tyring to get a witty cloud ESP8266 work with this setup as it has a build-in LDR. I have the LDR working on A0 (analog) as a stand-alone input. But when I try to use the A0 pin on as the “pulse_pin” I get an error message saying: “GPIO17 (TOUT) is an analog-only pin on the ESP8266”.
So how do I convert or get the LDR to input on the power_meter sensor?
You can’t (at least not without more tinkering). You would need a digital pin (which is ether high or low) and not a analog one you a trying to make use of.
Think about it that you want to detect if the light is on or off but on the other hand your a not interesting at all in the particular light level. Your setup (LDR on a analog pin) is more to estimate brightness levels but doesn’t give the output you need for a pulse meter.
You can still use your witty cloud (essentially a esp82xx) for that use case. You only need to invest a dollar or a half one for a sensor mentioned in the github (TCRT5000 for example) that you can connect to your witty thingy (follow the d1 mini / esp8266 instructions) and you should be good to go