Sync flair vent and nest thermostat?

I would like to create an automation to sync the mode of my nest thermostat and my flair vent. For example, if i set nest to cool the vent is set to cool. I wrote this to try to achieve my goal:

alias: Sync vent and nest
description: ''
mode: single
trigger:
  - platform: device
    device_id: 7ef1f854d63ea618053bab3dc8592e04
    domain: climate
    entity_id: climate.first_floor_hallway
    type: hvac_mode_changed
condition: []
action:
  - choose:
      - conditions:
          - condition: device
            device_id: 7ef1f854d63ea618053bab3dc8592e04
            domain: climate
            entity_id: climate.first_floor_hallway
            type: is_hvac_mode
            hvac_mode: heat
        sequence:
          - device_id: 61f8e1de739fecd3720bf0e50bcb73eb
            domain: select
            entity_id: select.casa_structure_mode
            type: select_option
            option: Heat
      - conditions:
          - condition: device
            device_id: 7ef1f854d63ea618053bab3dc8592e04
            domain: climate
            entity_id: climate.first_floor_hallway
            type: is_hvac_mode
            hvac_mode: cool
        sequence:
          - device_id: 61f8e1de739fecd3720bf0e50bcb73eb
            domain: select
            entity_id: select.casa_structure_mode
            type: select_option
            option: Cool
      - conditions:
          - condition: device
            device_id: 7ef1f854d63ea618053bab3dc8592e04
            domain: climate
            entity_id: climate.first_floor_hallway
            type: is_hvac_mode
            hvac_mode: heat_cool
        sequence:
          - device_id: 61f8e1de739fecd3720bf0e50bcb73eb
            domain: select
            entity_id: select.casa_structure_mode
            type: select_option
            option: Auto
    default: []

Alas, I’m getting this error:

Message malformed: required key not provided @ data['to']

What did I do wrong?

You did nothing wrong. Seems to be a problem with Home Assistant when using the "type: hvac_mode_changed " trigger.

If you haven’t already, you can get this automation working by setting the trigger to “state” and selecting the nest climate entity. if you leave everything else blank, the automation will trigger whenever there is a state or attribute change. To trigger on all state changes, but not on changed attributes, set at least one of from, to, not_from, or not_to to null.

The issue is that the “to” field doesn’t show on the UI for the type “hvac_mode_changed” when using a device trigger. It requires you to add this manually via YAML, but you wouldn’t want to use this trigger anyways as you don’t want to run the automation when HVAC mode is changed “to” a specific mode. You want it to trigger whenever the mode changes in which case you want to use state as a trigger and not device.