I’m trying to get the name of the single one switch entity of a device and I’ve gotten this far:
So – for later automation ideas – I have the device name in a text helper, I can get the device ID I need for an automation but I need the one switch entity id from that device to be able to toggle it in the automation. I have currently three of these cool Ulanzi clocks, flshed with the Awtrix firmware and I’m trying to use one IKEA Symfonisk gen2 remote to control all three of these watches/matrix display.
But I’m a noob at templating and Jinja2 and don’t quite understand the link between the Jinja2 select/reject/selectattr/map/… commands and the HA specific attributes.
So the last line doesn’t work yet.
Maybe someone has an idea? Maybe @petro, the templating Ninja?!
UPDATE:
Ohhh nooo, I’m afraid, my whole idea of using a text helper that contains the current Ulanzi clock’s device id and use that in an automation goes bunkers:
Please don’t say I can’t use templates in an automation?