Input Select Drop Down problem

I have created an input select drop down helper in Home Assistant to sync modes between my Hubitat hub and home assistant, I have this working perfectly but seem to have a strange problem.

The drop down looks like this - I have called this Home Modes

I also have the same drop down which is a sensor created from Hubitat, This is called Hub Mode

I have created 2 home assistant script’s which are triggered by 2 automations to keep these in sync and that part seems to work fine.

The problem I am running into is that if the mode is changes via hubitat one of the scripts will run to change the input select mode and when this happens I seem to lose all the drop down options from the list. This is how the drop down looks after the mode change
image

it only seems to list whatever the mode was changed to in the drop down rather than all of the option I set, If I go back into the helper section and press update then the mode re-appear.

As far as I can see this is happening when the following script runs.

choose:
  - conditions:
      - condition: state
        entity_id: sensor.hub_mode
        state: Home
    sequence:
      - service: input_select.set_options
        target:
          entity_id: input_select.home_status
        data:
          options: Home
  - conditions:
      - condition: state
        entity_id: sensor.hub_mode
        state: Night
    sequence:
      - service: input_select.set_options
        target:
          entity_id: input_select.home_status
        data:
          options: Night
  - conditions:
      - condition: state
        entity_id: sensor.hub_mode
        state: Away
    sequence:
      - service: input_select.set_options
        target:
          entity_id: input_select.home_status
        data:
          options: Away
  - conditions:
      - condition: state
        entity_id: sensor.hub_mode
        state: OnHoliday
    sequence:
      - service: input_select.set_options
        target:
          entity_id: input_select.home_status
        data:
          options: OnHoliday
  - conditions:
      - condition: state
        entity_id: sensor.hub_mode
        state: No Automations
    sequence:
      - service: input_select.set_options
        target:
          entity_id: input_select.home_status
        data:
          options: No Automations
default: []

This is probably more so me doing something wrong rather than being a home assistant problem as I am a newbie who is only nearing 3 weeks into the HA journey!

You don’t want to set the options, you want to select_option. Setting options replaces all the options, you just want to select a specific one from what you already have.

      - service: input_select.select_option
        target:
          entity_id: input_select.home_status
        data:
          option: Home

Note the differences, the service changed to input_select.select_option and the field in data changed to option.

4 Likes

You should be using the select_option service not set_options

Ahhhhhh, that makes perfect sense when you think about it.

Knew it was something I was doing wrong, thank you very much will amend the script now!