Scene problems in 101

The scenes has been changed in 101, it is listed as a breaking change, but to be honest I didn’t find it to well explained, so I am unsure why i have problems, but i suspect it is because of input select. For instance this scene:

- name: do_vanlig
  entities:
    light.do_ltak:
      state: true
      brightness_pct: 50
    input_select.dolys:
     option: 50

I get this error (among a lot of others…)

Invalid config for [scene]: State for input_select.dolys should be a string for dictionary value @ data[‘states’][0][‘entities’]. Got None. (See /config/configuration.yaml, line 89). Please check the docs at https://home-assistant.io/integrations/scene/

1 Like

The error tells you it expects a string, so wrap it in quotes :wink:

    input_select.dolys:
     option: '50'

Ok, thanks, so it seems it might have nothing to do with the state-changes in the scenes then?

Tried changing it to this_

- name: do_vanlig
  entities:
    light.do_ltak:
      state: true
      brightness_pct: 50
    input_select.dolys:
     option: '50'

Still the same error.

I just noticed your indenting is off, try

- name: do_vanlig
  entities:
    light.do_ltak:
      state: 'on'
      brightness: 128
    input_select.dolys:
      option: '50'

Sorry, me screwing up the pasting, the intendation seems to be correct in the original file.

I suspect its because scenes now can’t be ‘stateless’, which was one of their primary benefits. Basically you’re not going to be able to use an input_select, input_number or such like in scenes because they are never on or off. You’ll have to convert it into a script.

That might be the case, I don’t really understand the reasoning for the change to be honest. I felt the distinction was logical before, scenes for scenes, scripts for things that needs timing. Now scenes just seem worse for no reason.

1 Like

I completely agree.

Having this same problem. Not a fan of this change since it means reworking all of my scenes into scripts along with changing various other automation which relied on the previous way of doing things. Example of one of the ones causing trouble follows. The interesting thing is that it doesn’t complain on the first input_select, it complains on the one for climate_mode.

scene:
  - name: Arrive
    entities:
      input_select.scene_changed_to: 
        state: "Arrive"
      alarm_control_panel.ha_alarm:
        state: disarmed
        code: !secret alarm_code
      input_select.climate_mode: 
        state: "home"
      cover.garage_door:
        state: open
      alarm_control_panel.alexa_guard:
        state: disarmed

Oh the double quotes around Arrive and home weren’t there until tonight. Tried that to fix the problem. It didn’t work. Also tried with single quotes with no luck either.

Ok reworked all of my scenes into scripts. Haven’t tested yet (rebooting now to pickup changes) but after a few goes at it I finally got config check to work.

There is one advantage I found after doing this though that makes me a little less upset with the change. I have an input_select to switch between scenes manually as well as some automations to activate certain scenes. There was an automation to activate the scene whenever the input_select changed. Before in order to ensure that the input_select was updating properly when a different automation activated a scene, I had to have a second automation and input_select. The extra input select would be set to the scene name and the second automation would turn off the original scene selector automation, then update the main scene selector, then re-enable the original scene selector. Now I just have the disable automation, update main scene selector, re-enable automation directly in the scene scripts instead. It is a bit nicer, hopefully it works.

Let me know if you would like to see some example code.

Please share you example code. Before this update it worked perfectly by just using the input_select to switch scenes. Really dont know why they should remove this.

Example Code from configuration.yaml scene selector

  scene_selector:
    name: Scene Selector
    options:
      - Goodmorning
      - Away
      - OMW
      - Arrive
      - Goodnight

Example code automations.yaml triggering scene script based on name when input_select value changes

  alias: Change Scene
  initial_state: on
  trigger:
    platform: state
    entity_id: input_select.scene_selector
  action:
    - service_template: >
        {{ 'script.scene_' }}{% filter lower %}{{ states('input_select.scene_selector') }}{% endfilter %}

Example code from scripts.yaml definitions of a couple of my scenes

    alias: 'Goodmorning'
    sequence:
      - service: alarm_control_panel.alarm_disarm
        data:
          entity_id: alarm_control_panel.ha_alarm
          code: !secret alarm_code
      - service: switch.turn_on
        entity_id: switch.kitchen_light
      - service: automation.turn_off
        entity_id: automation.change_scene
      - service: input_select.select_option
        data:
          entity_id: input_select.scene_selector
          option: 'Goodmorning'
      - service: automation.turn_on
        entity_id: automation.change_scene

  scene_away:
    alias: 'Away'
    sequence:
      - service: alarm_control_panel.alarm_arm_away
        data:
          entity_id: alarm_control_panel.ha_alarm
          code: !secret alarm_code
      - service: input_select.select_option
        data:
          entity_id: input_select.climate_mode
          option: 'away'
      - service: homeassistant.turn_off
        entity_id: group.all_my_fans
      - service: homeassistant.turn_off
        entity_id: group.all_my_lights
      - service: cover.close_cover
        entity_id: cover.garage_door
      - service: alarm_control_panel.alarm_arm_away
        entity_id: alarm_control_panel.alexa_guard_1fbd7
      - service: automation.turn_off
        entity_id: automation.change_scene
      - service: input_select.select_option
        data:
          entity_id: input_select.scene_selector
          option: 'Away'
      - service: automation.turn_on
        entity_id: automation.change_scene

The reason I am also disabling the Change Scene automation then changing scene_selector then reenabling the automation in the scene scripts is because I have other mechanisms that run the scene scripts directly e.g. Alexa routines, or device tracker automations and I want the scene_selector to be corrected whenever these occur.

I will also note, that none of the alternate methods for triggering these scenes is capable of triggering any of the ones that disable my alarm though. Don’t want someone shouting through a window to be able to disarm my house.

1 Like

tbh, You haven’t really written any scene’s here have you? These are plain scripts, which you c/sh/would have had even with the scene support unaltered…
I wonder what your scenes were like before you did the rewrite?

ha, always learn! I hadn’t seen that before, thanks! I always use:

- service_template: >
     script.scene_{{states('input_select.scene_selector')|lower}}

aamof, even this:

script.scene_{{trigger.to_state.state|lower|replace(' ','_')}}

because I have scene with spaces in them

The behaviors shown in the “scene” scripts were pretty much exactly what I had configured for my scenes before they broke. I just had to adjust them into scripts. I was mostly using scenes to control climate, alarm, and a few lights on or off for modes like Away, Home, Night, etc. I don’t really use scenes for different thematics (TV Watching, Romantic Atmosphere) yet, but you could code the scripts to do pretty much the same thing for those as well.

I ran into this issue after upgrading to 0.101 and took a while to figure out that this was a breaking change in how scenes change input_selects: https://github.com/home-assistant/home-assistant.io/pull/10795

You should change it to:

- name: do_vanlig
  entities:
    light.do_ltak:
      state: true
      brightness_pct: 50
    input_select.dolys: 50
2 Likes

Thanks, you just solved it for me!

This is the solution and solved it for me! no scripts needed.

Was:

  - name: Alles max woonkamer
    entities:
      input_select.welke_scene_wk: 
        option: '100%'
      light.trf_color_1:
        state: on
        transition: 1
        brightness_pct: '100'

And now is:

  - name: Alles max woonkamer
    entities:
      input_select.welke_scene_wk: '100%'
      light.trf_color_1:
        state: on
        transition: 1
        brightness_pct: '100'

Thanks!

I can assure you that you have not solved anything with that code, as you are using completely invalid options.