I’m trying to combine twelve Xiaomi leak sensors into one using a binary sensor template. I’ve seen lots of examples of referring to each sensor one at a time, but to keep things easier to manage, I’d like to keep a list of the sensors in a separate file and include it as needed in various parts of HA.
When using entity_id to provide a specific list of entities, how does one actually refer to the entity in the value template? I haven’t seen any examples of this. This is what I’ve got:
+1 I also have this question.
I have several leak sensors, and it seems quite repetitive and unnecessarily complex to setup N alerts for N sensors.
Ideally alert could just take a list of entities to watch state for - this seems like a simple and straightforward solution - but that doesn’t seem possible with the way alerts work today?
So using a “template” binary sensor seems to be the go-to solution for this sort of thing - but again, it requires maintaining a list of all the sensor entity ids in a value_template, which also seems repetitive.
Wonder if there is a way to reference a “wildcard” of sensors in a straightforward way, such that adding sensors with a certain naming convention, or even device_class, etc can be automatically covered by the alert/template-sensor/automation/etc, without needing to manually update multiple references each time we add the nth sensor of some existing type.