Scenes triggers things not on the list

Hi, I used Scenegen to create a scene (I only have one at the moment) and then “cleaned up” what what not needed. But the scene triggers actions that are not on the list!

name: watching_tv
entities:
  switch.sonoff_10005d02c9:
    state: off
  switch.21072088c44f339c3e78:
    state: on
  switch.lamp:
    state: off
  light.cosy6:
    state: on
    brightness: 76
    color_temp: 370
  light.kitchen_4:
    state: off
  light.closet_4:
    state: off
  light.kelder_4:
    state: off
  light.sleeping_room_1:
    state: off
  light.toilet_1:
    state: off
  light.bathroom_1:
    state: off
  light.closet_3:
    state: off
  light.cosy8:
    state: on
    brightness: 76
    color_temp: 370
  light.cosy1:
    state: off
  light.cosy9:
    state: on
    brightness: 76
  light.kelder_3:
    state: off
  light.sleeping_room_4:
    state: off
  light.office_3:
    state: off
  light.kelder_2:
    state: off
  light.hobby_room_2:
    state: off
  light.toilet_3:
    state: off
  light.dining_3:
    state: on
    brightness: 51
  light.office_panel:
    state: off
  light.was_2:
    state: off
  light.closet_1:
    state: off
  light.cosy4:
    state: off
  light.office_2:
    state: off
  light.cosy13:
    state: unavailable
  light.cosy11:
    state: off
  light.sleeping_room_3:
    state: off
  light.office_1:
    state: off
  light.hobby_room:
    state: off
  light.logeerkamer_2:
    state: off
  light.kitchen_5:
    state: off
  light.living_room_3:
    state: on
    brightness: 254
  light.cosy5:
    state: on
    brightness: 76
    color_temp: 370
  light.was_3:
    state: off
  light.sleeping_room_5_1:
    state: off
  light.living_room_2:
    state: on
    brightness: 254
  light.hall_2:
    state: off
  light.was_1:
    state: off
  light.logeerkamer_1:
    state: off
  light.kitchen_2:
    state: off
  light.logeerkamer_3:
    state: off
  light.sleeping_room_2:
    state: off
  light.toilet_2:
    state: off
  light.hall_3:
    state: off
  light.dining_1:
    state: on
    brightness: 51
  light.cosy10:
    state: off
  light.cosy2:
    state: unavailable
  light.living_room_1:
    state: on
    brightness: 254
  light.kelder_1:
    state: off
  light.hall_1:
    state: off
  light.dining_5:
    state: on
    brightness: 51
  light.closet_2:
    state: off
  light.cosy7:
    state: on
    brightness: 76
    color_temp: 370
  light.kitchen_3:
    state: off

This motorized curtain opens/closes when I run this scene: [cover.16236476a4cf12b18892] but it’s not on the list!!

I’m not sure what’s going on… Thanks!

Is there maybe another automation for this cover, triggered one of the items on the list ? Or worse two steps away ?

Yeah I would check your logbook to see if another automation fires related to the cover when you run that scene.

Hi, thanks. If I do this automation with a simple “entity card” - it works. Not rolling shutter trigged. The same with a toggle button (I don’t want to have a 2 step click to trigger it) has the problem. Here’s my toggle button (broken):

type: entity-button
tap_action:
  action: call-service
hold_action:
  action: more-info
show_icon: true
show_name: true
entity: scene.watching_tv

and here’s my simple entity card (working)

      - type: entities
        entities:
          - entity: scene.watching_tv
        title: Watching TV Card

My log tells me the following - I searched but can’t understand what I need to do:
Not passing an entity ID to a service to target all entities is deprecated. Update your call to scene.turn_on to be instead: entity_id: all

Thanks

You say ‘cleaned up’ from the look of the code, it is very clean.
But the fact that you said it leads me to think it was generated by one of the editors ?
So is that what you did with the scripts and automations ?
I’m just trying to see if ALL your automations are in one file ?
If so do a text search in that file for this cover, see what you find.

The Lovelace card editor removes service data when you save the card and go to edit it again. Current bug I guess. You’ll need to update the entity card with the service data again under tap_action: https://www.home-assistant.io/lovelace/entity-button/#tap_action

That error is telling you that you called the scene.turn_on service without specifying an entity ID. When you do that it will turn on all scenes. Might be as a result of the card editor removing the service data.

Scenes are translated into services (e.g. light.turn_on, or light.turn_off). What service would this call?

  light.cosy2:
    state: unavailable

Remove all occurrences of entities with unavailable states from your scene.

That scene.turn_on with a missing entity turns on all scenes is an issue that should be fixed: https://github.com/home-assistant/home-assistant/issues/27281

(I know i said I would do it, but it will take some time before I have everything setup to send a PR so feel free to grab it)

Hi, I have a very “lean” installation - I have no automation yet nor have I scripts running. When I said “cleaned” - I meant that running “SceneGen” built a “scene” with ALL my devices - so I “cleaned” up or removed the ones that were irrelevant for that scene. Thanks

Sorry, not sure what else to suggest

OK - sorry for all those edits! Actually, the scene doesn’t even work - on the last test below - I changed to very simple, single, entity (light). It doesn’t turns on as it should - but the rolling shutters do… Which is that defaulting thing happening from the comments above. I’m wondering then why is the scene not working.

Weird and weirded… I reduced my scene to only this:

name: watching_tv
entities:
  light.cosy6:
    state: on
    brightness: 76
    color_temp: 370

Which is a single entity that is active and works. And still the other one (the rolling shutters) turns down.
I also double checked that it loads. It does under tools/states


Entity
scene.watching_tv

State
scening
 
State attributes (JSON, optional)
{
  "entity_id": [
    "light.cosy6"
  ],
  "friendly_name": "watching_tv"
}

Ok… and as a very last test - I changed entity to the simplest:

name: watching_tv
entities:
  light.office_1:
    state: on

The shutters still turns off :frowning:

I found the solution. The Lovelace UI card generator doesn’t produce the proper code in the card for a toggle button to a “scene.turn_on”. It needs an “entity_id”.

# - Working Solution
      - entity: scene.watching_tv
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.watching_tv

# - WRONG CODE produce by the UI designer of Lovelace for a "Toggle"
#      - tap_action:
#          action: call-service
#          service: scene.turn_on

This now works for me. Thanks all for the help.

1 Like