Setting up MQTT-triggered automations more efficiently - inspiration needed

Hi all,
I need some inspiration on how to minimize the number of automations needed in my setup…

I have a setup now with a lot of automations used to turn different z-wave devices on/off triggered by MQTT.

I define the messages myself (like “topic/room/device/action”).
What I want is an automation that extracts “device” and use that in the action part and then initiate “action” for that service, that is, the message include the name of the device as it is defined in Home Assistant.

I’ve been searching a lot but haven’t found some good examples - anyone who could point me in a direction of examples doing that?
In theory that could reduce something like hundred automations to one :slight_smile:

I think this is the sort of thing you are looking for

Exactly!
Thank you - totally what I was looking for!

1 Like