Core: Invalid config for [scene] HA 0.101.0

Created on 31 Oct 2019  路  16Comments  路  Source: home-assistant/core

Hi,
after upgrade to version 0.101.0 I got this errors on notifications:

Invalid config for [scene]: State for cover.tapparella_cucina should be a string for dictionary value @ data['states'][0]['entities']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 163). Please check the docs at https://home-assistant.io/integrations/scene/
Invalid config for [scene]: State for cover.tapparella_cucina should be a string for dictionary value @ data['states'][0]['entities']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 163). Please check the docs at https://home-assistant.io/integrations/scene/
Invalid config for [scene]: State for cover.tapparella_sogg_divano should be a string for dictionary value @ data['states'][0]['entities']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 163). Please check the docs at https://home-assistant.io/integrations/scene/

Here is full scene.yml file; this file is imported in config.yml

- name: Apri tapparelle
  entities:
    cover.tapparella_cucina:
      position: 100
    cover.tapparella_sogg_tavolo:
      position: 100
    cover.tapparella_sogg_divano:
      position: 100
    cover.tapparella_bagno_1:
      position: 100
    cover.tapparella_bagno_2:
      position: 100

- name: Mezza apertura tapparelle
  entities:
    cover.tapparella_cucina:
      position: 100
    cover.tapparella_sogg_tavolo:
      position: 30
    cover.tapparella_sogg_divano:
      position: 50
    cover.tapparella_bagno_1:
      position: 55
    cover.tapparella_bagno_2:
      position: 55

- name: Chiudi tapparelle
  entities:
    cover.tapparella_cucina:
      state: "closed"
    cover.tapparella_sogg_tavolo:
      state: "closed"
    cover.tapparella_sogg_divano:
      state: "closed"
    cover.tapparella_bagno_1:
      state: "closed"
    cover.tapparella_bagno_2:
      state: "closed"

- name: Tapparelle aperte a righe
  entities:
    cover.tapparella_sogg_divano:
      position: 18

Cannot find any trace for changes on that.. any idea?

Most helpful comment

@sr-as2 please add a state to media_player.salon. I'll clearify this behavior in the docs asap.

why there's state needed?
I've got scenes based on daytime, and they not only set my lighting, but also set volume on sonos devices and google home's - so for example when I play something at evening/night it won't blow up my house with too high volume etc. something like "default starting point". if I must set the state within scene - that mean, that I'll have to force stop media_player if I set "state: off", right? or there's any "neutral" state that could be set without interrupting current state of media_player and I am not aware of?

All 16 comments

if you define the state and position does it work? might be related to #27914 but not sure.

Also make sure not to delete the issue template...all requested info is important.

Hey there. It is kind of related. With reproducing state every scene entity needs a state. That's what your errors are saying, too. Just add state: (insert state here) to the configuration where no state is specified and tell us if that helps.

Hi all,
having the same problem since 101 update:

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

- name: RegarderFilm entities: media_player.lg_webos_smart_tv: state: on delay: '00:00:05' source: 'Shield TV' media_player.salon: source: 'Salon - HDMI 1' script.shieldkodi: state: true

@sr-as2 please add a state to media_player.salon. I'll clearify this behavior in the docs asap.

Ok, adding state attribute make scenes work. It definitely need clarification in docs, if I can, I would also suggest to clarify the exception raised, it's a bit misleading. A clearer exception would make configuration debugging easier.

Thanks again.

ok thanks !!

For scenes with covers, you also have to change "position" to "current_position" - additional to adding a state (which should be "open" for every current_position > 0)

I just ran into this same issue. Why are these changes needed?

It makes the configuration/YaML rather longer. Also, the change from position to current_position in scenes seems unnecessary (and does not match the current documentation which specifies position still).

Could this be rolled back?

@l-mb The idea behind these changes is to reproduce the state of entities using their current representation in HA. This is based on the current state and state attributes. With this method, scenes will become more flexible and usable from the UI in the future. The changes will not be rolled back.

But specifying a position that's not 0 implies not-closed, e.g., open. And specifying "closed" means 0.
I get that just "open" might be ambiguous (return to last open position or 100?), but requiring users to specifying redundant information is not useful.
(And unless "position" becomes a new reserved word, it could have been aliased instead of breaking existing configurations.)

For scenes with covers, you also have to change "position" to "current_position" - additional to adding a state (which should be "open" for every current_position > 0)

This has resolved my issue. Thank you.

FWIW, I've also changed my configuration and it works again.
But from a wee bit of experience in the software world - please consider that upgrades are one of the most crucial experiences for users and breaking them w/o a transition period on the configuration syntax at the very least is really painful.
That said, thanks for the great project!

Sometimes things just slip through the cracks. At least the changes were very minimal in this case. The HA team is usually really good at catching these things prior to release but sometimes it happens.

Whats amazing is how quickly the turnaround was to figure out the issue and get things resolved. Less than 1 day.

@sr-as2 please add a state to media_player.salon. I'll clearify this behavior in the docs asap.

why there's state needed?
I've got scenes based on daytime, and they not only set my lighting, but also set volume on sonos devices and google home's - so for example when I play something at evening/night it won't blow up my house with too high volume etc. something like "default starting point". if I must set the state within scene - that mean, that I'll have to force stop media_player if I set "state: off", right? or there's any "neutral" state that could be set without interrupting current state of media_player and I am not aware of?

@pejotigrek I feel the same way and haven't thought of any workarounds yet for the issue. Have you figured out anything by chance?

@pejotigrek I feel the same way and haven't thought of any workarounds yet for the issue. Have you figured out anything by chance?

well, yes - but actually no ;)
eventually I moved to scripts instead of scenes, as the changes made to scenes just made them totally useless for me.. so being in scripts I can set volume with no state change

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soldag picture soldag  路  143Comments

Gio76 picture Gio76  路  223Comments

McGiverGim picture McGiverGim  路  124Comments

jeromelaban picture jeromelaban  路  123Comments

neotrunks picture neotrunks  路  169Comments