- platform: adc
pin: 36
attenuation: 11db
name: "Kontor Plante Fugtighed"
update_interval: 60s
filters:
- lambda: |-
auto first_mass = 100.0;
auto first_value = 0.0;
auto second_mass = 0.0;
auto second_value = 3.3;
auto r = map(x, first_value, second_value, first_mass, second_mass);
if (r > 0) return r;
return 0;
unit_of_measurement: "%"
But I had forgotten that it is not enough to update the code…it also needs to be uploaded…that occured to me later (new to this)…when I had the top code in…But for the sake of an example…would the mapping look as I put it?
yes, it looks good to me. On the ESPhome page, once you edit a code and if syntax is correct the upload button activates. You click that and the node will update OTA.
If button does not activate, then look for a red cross on the page. Hovering over it, it will give an indication what is the mistake in the code.