Hi,
Trying to get a template setup working with variables as the inputs rather than hard coding anything. I’m failing to get my MQTT Switch via Selector (I know this holds ID only) to pass the Device Name so that the Topic tracks correctly:
If not obvious, I want to replace the hardcoded “Office - Switch …” with a variable relating to the Switch from the selector.
I’ve tried “{{device_attr(switch, ‘name’)}}” in various places + permutations, but all cause the blueprint to have a fit !
Hi,
Pretty much that is the entire YAML, I’ve written it from scratch as a way to try to learn the language / syntax used in HAOS.
Only thing missing is the header and a couple of dummy actions at the end.
I was leaning, towards something didn’t work right with device_id’s but wasn’t 100% as a lot of posts seemed to just say “use device_attr …”.
I think my problem is how to use entity_IDs with MQTT properly and the only entities that look like they are being exposed for use are battery and firmware update.
I’ll post the full code when I’m not on a mobile device.
Ta.