Apologies for this very basic question but I can’t figure it out. I have a cheap rain sensor which using ESPHome reports a voltage drop. I want to send out an email when that happens, so we know it’s raining and can bring the washing in
The sensor, in ESP Home, is configured as below and I use the lambda to convert the value to a positive % instead of a voltage level drop. Looking at my Home Assistant dashboard, the values look fine.
- platform: adc
pin: A0
name: "RainDensity"
unit_of_measurement: "%"
update_interval: 10s
filters:
- lambda: return (1 - x) * 100;
The automation is triggered like this:
platform: state
entity_id:
- sensor.raindensity
for:
hours: 0
minutes: 0
seconds: 0
from: "86"
But it never triggers although the value passes the 86 frequently. I tried many different values including 86%, 0.86 but it never works.
I’m wondering if it has something to do with the variable type of the reading returned by ESPHome that maybe it’s a string and not a number but not sure if that is the case or how to change that.
I put it in the configuration forum and not the ESPHome forum as I thought the problem is more likely to be in the Automation rather than the way the sensor is configured.
Thank you in advance for your guidance.