I’m trying to make a smartest possible binary sensor
If my alarm is armed, the sensor reads “armed_night”, “armed_…” etc.
I want to have ESPHome turn on a LED if it is any kind of ‘armed’.
So my first thought was to make a binary sensor, and have that placed in the ESPHome device, and just have the LED react on that.
So I made a template:
{{ states('alarm_control_panel.alarmo') [:5] }}
This will just return the first 5 letters.
So I thought I could make a simple binary sensor like
{{ states('alarm_control_panel.alarmo') [:5] = 'armed' }}
This will make a binary sensor that reflects the armed state as true/false, and I can react on that in ESPHome.
But is there a better way, so I don’t make an extra sensor in HA, and just let ESPHome determine the substring from the sensor itself?