Automation not working with input select

Hello,

I’m trying to set up an automation to adjust the bedroom temperature based on the selection from an input.

input_select:
  kitchen_mode:
    name: kitchen mode
    options:
      - comfort
      - eco
      - auto
      - absence
  bedroom_mode:
    name: bedroom mode
    options:
      - comfort
      - eco
      - auto
      - absence

input_number:
  bedroom_temp:
    name: Bedroom temperature
    min: 12
    max: 30
    step: 0.5

automation:
  
    alias: bedroom_automation
    
    triggers:
      platform: state
      entity_id: input_select.bedroom_mode
      to: "comfort"
    
    action: climate.set_temperature
    target:
      entity_id: climate.bedroom_heater
    data:
      temperature: "{{ states('input_number.bedroom_temp')|float }}"

When I run the action in developer mode, it works perfectly. However, it doesn’t work within the automation. I suspect the issue comes from the triggers, but I’m not sure what the problem is.

Do you have any suggestions?

Is that literally how your automation looks?

Because if that’s exactly how it appears in the configuration.yaml file (or automations.yaml) then it’s invalid.

If you created it manually with a text editor, I recommend you remove it and start over using Home Assistant’s Automation Editor in Visual mode. It won’t let you save an automation containing incorrect YAML syntax.

When you switch the Automation Editor’s mode from Visual to YAML, you’ll see your automation’s properly formatted YAML code.