So i have an automation for a remote, if the sensor = 1, turn on light, if sensor = 2 turn off light, if sensor = 3 run routine, etc etc.
I currently have to create 7 automations per remote and I feel like its a bit overkill, is there a better way to do this? Right from the UI its a bit hard to tell.
There are lots of ways to do this, but, from the UI is probably the most tedious.
If you use a text editor and edit the YAML directly you can copy and paste the automation and then change the entities.
With YAML anchors you can eliminate some of the repetition.
Using a script that takes a few variables may help to make your automations smaller.
a python_script can help reduce the amount of code required in the script
Pyscript, AppDaemon, or NodeRed can help reduce this even more and simplify the code entirely.
Pyscript and AppDaemon both support the concept of “Apps” allowing you to to configure each set of automations with only a few lines of config (probably YAML).
At the Home Assistant conference in December, it is likely that a new feature called “Blueprints” will be announced that may simplify this greatly.
This sounds like this is the type of use case the chooser logic was created for.
Thanks alot this was perfect!