It there way to do these in 1 automation, and not to do 3 different per zigbee remote controllers:
I have 3 different rooms with remote controllers ( 4 button ones ) and Sonos speaker. I do exactly same thing to remotes (plays music) but every room remote start playinig music in that room where they are mounted. So do i still haveto write own automations to every remote or is there way to do it in 1 automation what understand what remote was pressed and after that knows where music wanted to play?
The best way to do this is with a blueprint. You can then configure (easily) an instance of the blueprint for each room and it will use the same code but be configured differently.
Wouldn’t a blueprint be the same thing as an automation. And creating three blueprints is just the same thing as three automations?
I would believe it’s quite easy to template.
You have the device_id that triggered the automation, this can be used to template what room to play in.
But we can’t really help you since you have not really posted anything that we can help you with.
There are a lot of blueprints for things like the IKEA remotes, so my guess is there are. I haven’t done any blueprints myself, though, so I’m not actually sure.
This is what i know. But there is three triggers ( 3 philips hue remotes what each has 4 button) + 2 sonos speakers in dirfferent rooms. So each remote what control sonos speaker in same room. But now i just haveto make tons of automations to evert remote ( i copy paste and change targers and entities ).
i was just asking is there better and easier way to do this
There is, but we need something to help you.
It’s of no good if we just make a generic automation that you need to adapt and fail with and then we are back on square one again.
Just post what the events are, and what the service calls are.
Just some of it, that way we can post what you need and how you adapt it.
Here is info:
3 rooms: Toilet, Hallway and Livingroom ( future too Kitchen and Bedroom )
3 Remotes ( Philips Hue 4 button new gen zigbee swiches connected to ZHA in HA )
3 Sonos Speakers, 1 in every room.
Personally, I would setup one automation per remote since there are 16 actions per remote. That way, you have just one automation that contains all the triggers for your remote. Assign each trigger item a trigger ID (3 button menu > Edit ID) and give it a descriptive name. Then in the “Then Do” section, add a Choose block and choose “Other Conditions > Triggered By” as your option and add as many options as you need. Then you pick the ID and add the actions you want to take if that particular trigger was executed.
I use this method for various remotes I have around the house.
I make one automation per remote. Blueprints may sound smart but then you want one remote to be a little different and you can spend a month getting a blueprint to work for all.
But one automation that handles all the buttons - yes that is useful.
I use deconz so the triggers are events. But you can surely use this example as inspiration.
Note that in this example I use the same feature as Philips Hue does to increase and decrease the light. Instead of flooding the Zigbee network with small incremental changes you start an increase or descrease with long transition time when you press down the +/- buttons long pressed and when you release the button, a new command is sent that stops the transition. That gives a smooth and reliable function. And it is was the Philips Hue hub also does