I have a “GSM modem” project. Simple SIM800l connected to ESM12 and powered by 18650 battery, which is charging if USB connected to charging board
I just include DC detect sensor, to get state of USB connected to charger or not
ESP12 connected to HA with ESPHome
First, your sensor is a regular sensor, not a binary_sensor. You might consider making it an actual binary_sensor.
Second, I suspect what is happening is that the state of sensor.gsm_external_power is sometimes, for probably a very short time, not a numeric value. E.g., maybe it is sometimes unavailable or unknown. In that case the |float filter will output its default value, which is 0.0, and then the template will result in False.
Hm… If you talking about ADC sensor.gsm_external_power, then yes, its regular one. But if you look at the second screenshot, you’ll see another “virtual” sensor.gsm_power_on, with True and False states, and it’s actually binary.
I think same display name confused you Sorry about that
Good point. Coz I have a second automation for sensor.gsm_power_on = False, and it’s triggered as it should, only if I unplug external power.
Will check it, and apply some workaround
Btw
Today I unplugged external power, so SIM800l stay powered with battery (directly attached), but charger module decide “there is no power consumption” and switched off, so ESP module been disabled, and in HA all sensors became unavailable, automation did not triggered…
Hm… need to think about how to workaround this scenario…
I want to use “GSM modem” as reserve notification channel, in case internet connection failed or power issue happen, when nobody home.