How do I use a helper dropdown in an automation action

Sorry I feel like this is a really easy answer - but I just can’t find it.

I have 9-midnight free power at home, and want to use my HVAC system based off a helper dropdown.

I thought I’d just add a dropdown to a dashboard as an input. So someone at home can decide in advance what they think the weather will be like in the evening and choose the ‘free power’ mode.

image

So I want the value of this dropdown to insert into where I have;
hvac_mode: dry/heat/cool/auto

device_id: xxxxxxxxxxxxxxxxxxxxx
domain: climate
entity_id: climate.daikin
type: set_hvac_mode
hvac_mode: dry

or call service in the automation if this is a better method;

service: climate.set_hvac_mode
data:
hvac_mode: dry
target:
  device_id: xxxxxxxxxxxxxxxxxxxx

At some point I might also add a slider/dropdown with an acceptable range of temperatures, a set of tick boxes for the rooms to deliver the hvac mode to, and a drop down for low/med/high fan.

service: climate.set_temperature
data:
  temperature: 29
target:
  entity_id: climate.daikin

service: climate.set_fan_mode
data:
  fan_mode: high
target:
  device_id: xxxxxxxxxxxxxxxx

service: fan.turn_on
data:
  percentage: 100
target:
  entity_id:
    - fan.bedroom
    - fan.gym
    - fan.kitchen
    - fan.lounge
    - fan.office

Thanks in advance :slight_smile:

- service: climate.set_hvac_mode
  data:
    hvac_mode: "{{ states('input_select.ac_mode') }}"
  target:
    entity_id: xxxxxxxxxxxxxxxxxxxx

Put your input_select entity id where I put input_select.ac_mode.

Also, use the entity_id, not the device_id. If you ever have to replace a device you can change the entity_id in one place (new to match the old). You can not do this for device_ids, you have to find and replace them all.

Finally, this seems like something you could automate depending on the day/night maximum/minimum temperature rather than relying on someone to change an input_select.

Edit: one more thing. If you want to use capital letters in your input select options to make them look nicer, like Heat, Cool, Dry then change the template to this:

    hvac_mode: "{{ states('input_select.ac_mode')|lower }}"

This will change the options to lower case letters, e.g. Drydry. Other options for this filter are upper, and title.

2 Likes

Thanks for taking the time to post. Appreciate it :).
I will try all this out and post an update soon.

Works perfectly. Thanks very much for the information.

Yes I definitely agree with the automation based off actual temperatures part. I have sensors on the HVAC and Aqara sensors in every room. But I think it’ll be a war between my wife and I about ‘too hot’ ‘too cold’. I might try it again if this drop down isn’t used :).

1 Like