Objective: 5 manual buttons that each toggle their respective Climate devices in 5 different rooms. I'm hoping for 1 automation that takes some "room" selection input from the button and then conditionally turns that room's climate on or off.
Trying to find the right content on how to do what I'm looking for, but I keep getting a lot of alternate information for doing other things which are not really related to what I want to do.
Two parts to solution:
- How to set/pass the room (or target climate device if needed to be granular) by a button when running an automation. Is there some "select room" field that can be set on the button and passed to the automation for use in the Climate device/area selection?
- On the backend in the automation, how can input be allowed or used from the button as the target for the automation's Climate action. I.e. IF: "Climate <DEVICE> is on" -> THEN: "Turn off Climate <DEVICE>" Where <DEVICE> can be selected/passed from the button config on the frontend.
It seems I could solve this very likely by making a large automation with nested "Choose:" conditions where I duplicate the "on/off" logic for each room, explicitly. But my hope is I can pass in/select the climate room/entity on the front end and use that parameter directly in the "Climate <DEVICE> on/off" logic to save a lot of duplication.
The impact is big because not only is there a lot of code duplication, but any time I want to adjust the automation logic, I'll have to do it 5 times (once for each room) which makes iteration painful.
I could also, of course, just make 5 different automations, one for each climate room/device, and call each automation separately with each button, but again, it would require 5 edits any time a change is made.