Problem with honeywell preset mode

I am trying to set a preset mode on a Honeywell RTH9585WF thermostat. Here is the yaml:

  - action: climate.set_preset_mode
    metadata: {}
    data:
      preset_mode: away
    target:
      device_id: f6bb05e0b77b458a3d2ed4e99fff94bd

Sometimes this will change the preset to away, but mostly nothing happens. What is wrong? Thanks.

When the action fails, is there a related error message in Settings → System → Logs?

No error reported in the log. i can change the preset manually with the Lovelace card, but not with an automation or script.

Both the card and the action communicate with the physical thermostat the same way, via this integration:

I have the portal web page pulled up on another tab. When I change the card from none to away and back to none, the portal changes from following schedule to permanent hold and back to following schedule. But when I use the action to change from none to away to none, no change is seen in the portal. In short, the card is communicating with the portal, but the action is not. Here is the yaml for the action, in a script:

  - action: climate.set_preset_mode
    metadata: {}
    data:
      preset_mode: none
    target:
      device_id: climate.townhome_control
alias: Set Townhome Climate
description: ""

I can’t see anything wrong with the action, but it’s not communicating with the portal.

climate.townhome_control is an appropriate value for entity_id, not device_id.

Change that line to this:

        entity_id: climate.townhome_control

Thanks; I made that change. I also learned that the Honeywell integration can be slow to respond so a repeat-until loop is suggested. now it looks like this:

      - repeat:
          sequence:
            - action: climate.set_preset_mode
              metadata: {}
              data:
                preset_mode: none
              target:
                entity_id: climate.townhome_control
          until:
            - condition: state
              entity_id: climate.townhome_control
              attribute: preset_mode
              state: none

I do have a problem in that repeat-until, under some conditions, seems to get stuck in the loop, but that would be another topic. Thanks again.