After I started this thread, I searched the internet a little further. My problem seems to be that the GPIO on ESP8266 does not actually have analog input. I need to use the ADC pin, and this is not present on the ESP8266-01 I was playing with.
I'll try using a "bigger" (07..12) version, where the ADC pin is exposed.
Lars Bo Wassini