Adapt analog input

Hi,

I don’t know Yaml, how can I do this calculation in the analog input of the D1 mini

thank you all

sensor:
  - platform: adc
    pin: A0 * 3.18 / 1024.0        this line gives me error    
    name: "Analog"
    update_interval: 0s
captive_portal:

Use a sensor filter Sensor Component — ESPHome

By the way, one multiplication (by .0031)

hello thanks, but how do I divide a value?

thank you

Multiply by its inverse, but I have done the math. * 3.18 / 1024 is identical to * .0031.

1 Like