Open jbrepogmailcom opened 3 years ago
Docs says that if you want to measure HCC you must connect nothing to A0. Isn't it accurate?
Actually, it is not correct. Lets say you have two digital pins GPIO12 and GPIO13 and analog pin A0. You connect photoresistor between A0 and GPIO12 and you connect GPIO13 to A0. Then you set both GPIO12 and GPIO13 as INPUT. Therefore nothing is connected to A0 and you can measure battery Vcc. Then you set GPIO13 INPUT_PULLUP and GPIO12 OUTPUT LOW. This way you create voltage divider from + voltage internal resistor to GPIO13 to A0 to photoresistor to ground on GPIO12 and you can measure variable voltage on A0 that depends on light intensity. This way you can measure both Vcc on disconnected A0 and voltage on A0. Therefore I would request to enable both VCC and A0 pins in one yaml configuration for sensor.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Operating environment/Installation (Hass.io/Docker/pip/etc.):
HASSIO
ESP (ESP32/ESP8266, Board/Sonoff):
ESP8266
ESPHome version (latest production, beta, dev branch)
latest prod
Affected component:
A0 and VCC
Description of problem:
Hello. I would like to measure voltage on A0 pin and also VCC battery voltage. If I program it in C++, it works. But following configuration only sends one mqtt sensor - I suspect that one definition overrides the other. Is there any other way how to define both sensors?
Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried: