Input Select bug? HA mixes up values at startup

Every time I restart my hass.io, I get these errors in the log:

2018-01-23 17:01:31 WARNING (MainThread) [homeassistant.components.input_select] Invalid option: 24 grader max (possible options: Morgonbelysning PÅ, Morgonbelysning AV, Kvällsbelysning PÅ, Kvällsbelysning AV)
2018-01-23 17:01:31 WARNING (MainThread) [homeassistant.components.input_select] Invalid option: Morgonbelysning PÅ (possible options: Av, 22 grader auto, 24 grader auto, 24 grader max, 24 grader tyst)

Basically - HA tries to set my two input_select to invalid options. It seems like it mixes the options up between the two selectors.

Invalid value after restart:

Heater%20Selections

…and the other. Invalid as well:
Selections

configuration.yaml:

# Selectors
input_select:
  heater_entryfloor:
    name: 'Värmepumpen'
    icon: mdi:fan
    options:
    - 'Av'
    - '22 grader auto'
    - '24 grader auto'
    - '24 grader max'
    - '24 grader tyst'
#    initial: 'Av'
  light_program:
    name: 'Belysning'
    icon: mdi:lightbulb-outline
    options:
    - 'Morgonbelysning PÅ'
    - 'Morgonbelysning AV'
    - 'Kvällsbelysning PÅ'
    - 'Kvällsbelysning AV'
#    initial: 'Kvällsbelysning AV'

I have tried all I can think of now. With initial values, without initial, with recorder (in hope of resumed state) and without recorder - and a great deal of restarts.

I even changed the input selectors names and deleted the database - but to no avail.

What I really want is HA to resume the selected state it had before a restart. Any tips would be much appriciated.

Have you got an automation running that sets these from elsewhere?

Yep, but I have gone through them carefully and they are correct.
I haven’t tried to remove them completely though, I could do that.

BRB.

Hmm… if I remove ALL automations (leave the folder empty), no errors in the log.

It seems to be related in some way:
As soon as I put any automation back - not in any way related to the input_selects - the lines are back in the log.

Strange stuff.

Are you on normal HA or hass.io?

hass.io (sorry for the inconsistency)

Interesting. I’ve been seeing something similar in my logs (also on Hass.io) for awhile now about invalid input_select options, but I haven’t had the time to chase it down because when I checked all my automations they definitely had the correct values.

OK, do you have have ssh access and are you familiar with grep?

We need to search all of your config files for input_select.

Yes and no. I’m more of a Windows kind of guy so i use Samba ang Notepad++.
But I searched for all occurrences of “Morgonbelysning PÅ” (from the log) and changed the spelling in the automation files to all lowercase just to see from where it originated.

I have spent most of the afternoon on this, but I still can’t explain how it occurred.

What I know is this:
I moved all my automation files to another drive.Then I restarted hass.io (several times just in case), checking the log after each restart. No errors. Then I took my automation files and searched and replaced the old name “heater_entryfloor” with “heater01”. Moved all files back. Restarted. And BAM. No error in the log, Everything works as expected.

I can’t explain why it works now. Best guesses:
Something about underscore in the name? Any relation to swedish letter “ä” in en friendly name? Some mix-up in the resume state-function?

I have the old files in a backup if you want them for deeper analysis, but I’m fine now and my log is clean and good looking again :slight_smile:

1 Like

Ha, I’ll pass on going through your old config :stuck_out_tongue_winking_eye:

Glad you got sorted :+1:

Just because I’m curious I just had to keep trying.
And yes, I managed to re-create the error.

I added a new option “Alla lampor av” to the input_select.lights01 and reloaded Scripts and Automations. I had no automation calling this new option, but still I got an error in the log. And after restart - it’s back.

Once again with reference to wrong input_select (which is what is really strange):

2018-01-23 21:14:21 WARNING (MainThread) [homeassistant.components.input_select] Invalid option: Morgonbelysning av (possible options: Av, 22 grader auto, 24 grader auto, 24 grader max, 24 grader tyst)

The “Morgonbelysning av” is a reference to was previously was the first option in the input_select.
After my addition, “Alla lampor av” is the first option.

So if I try to create an explanation:
If you add a new option to an input_select and then reload scripts and/or automation, hass.io suddenly think that the previously first option in your first input_select belong to your other input_select. Which it doesn’t, and therefore it produces an error.

Phew. It doesn’t seem very likely, but now it has happened twice.

Now I know how to get rid of it, but it still seems like it would be worth investigating.

Yeah, sounds like you found a bug. Chuck a bug report on GitHub :+1:

Hmm…
It also takes the first option “Av” from the second input_select as an input to you first input_select. Also wrong.
But at least there is some kind of logic in that.

Yeah, probably time for a bug report.

Easily resolved however:
1: Temporarily remove your Input_select from configuration.yaml
2. Restart
3: Put the code back
4. Restart.

1 Like

I’ve got the same issue and following these steps didn’t resolve it for me. Any pointers?

I ended up with a different setup: Restore state and automations only work if I don't restart from Hass.io-menu

The solution may seem a little bit unnecessary complex, but it has worked for a couple of months now, so I’ll stick with it.

I think the main problem was the restore_state that restored an incorrect value, but I haven’t dug any deeper into it since it works now.

I’m seeing this error too.

I have two completely unrelated input selects and warnings in the home assistant log that that options for one input select are invalid for the other. I’ve been over all my automations and scripts and I only have valid options for the input select set value service calls.

Was an issue ever created?

WARNING (MainThread) [homeassistant.components.input_select] Invalid option: Bright (possible options: Default, Midnight, Solarized Dark)

Input selects:

select_theme:
  name: Select Theme
  options:
   - Default
   - Midnight
   - Solarized Dark

Automations:

- id: select_theme
  alias: 'Select Theme'
  hide_entity: true
  trigger:
    - platform: state
      entity_id: input_select.select_theme
    - platform: homeassistant
      event: start
  action:
    service: frontend.set_theme
    data_template:
      name: >
        {% if is_state('input_select.select_theme', 'Default') %}
          default
        {% elif is_state('input_select.select_theme', 'Midnight') %}
          midnight
        {% elif is_state('input_select.select_theme', 'Solarized Dark') %}
          solarized_dark
        {% else %}
          default
        {% endif %}

And

- id: set_dark_theme_at_sunset
  alias: 'Set Dark Theme At Sunset'
  trigger:
    platform: sun
    event: sunset
  action:
    service: input_select.select_option
    data:
      entity_id: input_select.select_theme
      option: Midnight

- id: set_light_theme_at_sunrise
  alias: 'Set Light Theme At Sunrise'
  trigger:
    platform: sun
    event: sunrise
  action:
    service: input_select.select_option
    data:
      entity_id: input_select.select_theme
      option: Default

No, I never raised an issue. So please do if you can re-create the issue.

I’ve performed a couple more restarts today and have not been able to reproduce the issue.

Saw this in the log this morning:

Invalid option: Forest (possible options: Off, Powerful Heat, Normal Heat, Silent Heat, Powerful Cool, Normal Cool, Silent Cool)

Again, Forest is an option for a completely unrelated input_select and nowhere in my automations do I try to select it as an option for the air-conditioner input_select.

I have opened an issue for this: https://github.com/home-assistant/home-assistant/issues/19810