Read both battery voltage and analog sensor value with NodeMCU ESP8266
to read VCC voltage, ADC pin must be kept unconnected. Additionally, the following line has to be added to the sketch:
  ADC_MODE(ADC_VCC);


The setting of a purpose of the analog pin of esp8266 is at low level and must be projected into the compiled binary. It can't be changed at runtime.

On esp8266 if you want to use the power sensing or to have more ADC you must use an external I2C ADC. 

reference