Adding two scenes into one

Hi!

I’m trying to make an home button, which includes turning on specific lights and heating my house by my thermostats from Netatmo. However, the lights should only turn on after sunset. I think the only option for this to work is to make two scenes: one for the thermostats and one for the lights, and then combine these into one scene.

And here is my problem: it won’t work! When I activate the scene, nothing happens, although the two scenes works individually. Has anyone experienced the same problem?

The scene config is this:

- id: '1587665066579'
  name: Ankomst 2
  entities:
    scene.lys_ved_ankomst_2:
      entity_id:
      - light.entre
      - light.kokken
      friendly_name: 'Lys ved ankomst 2 '
      id: '1587664880677'
      state: scening
    scene.termostater_ved_ankomst:
      entity_id:
      - climate.netatmo_gang
      - climate.netatmo_kokken
      - climate.netatmo_kontor
      - climate.netatmo_sovevaerelse
      - climate.netatmo_stue
      friendly_name: Termostater ved ankomst
      id: '1587316917480'
      state: scening
  

- id: '1587316917480'
  name: Termostater ved ankomst
  entities:
    climate.netatmo_gang:
      battery_level: 90
      current_temperature: 19.5
      friendly_name: Netatmo Gang
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_kokken:
      battery_level: 91
      current_temperature: 20
      friendly_name: Netatmo Køkken
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_kontor:
      battery_level: 89
      current_temperature: 19
      friendly_name: Netatmo Kontor
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_sovevaerelse:
      battery_level: 91
      current_temperature: 19.5
      friendly_name: Netatmo Soveværelse
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_stue:
      battery_level: 90
      current_temperature: 21
      friendly_name: Netatmo Stue
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 20

- id: '1587664880677'
  name: 'Lys ved ankomst 2 '
  entities:
    light.entre:
      brightness: 254
      friendly_name: Entré
      state: 'on'
      supported_features: 41
    light.kokken:
      brightness: 254
      effect: none
      effect_list:
      - colorloop
      - random
      friendly_name: Køkken
      hs_color:
      - 255.059
      - 100
      max_mireds: 500
      min_mireds: 153
      rgb_color:
      - 64
      - 0
      - 255
      state: 'on'
      supported_features: 63
      xy_color:
      - 0.158
      - 0.05

Without seeing any of your scene or button configuration it is hard to say anything useful.

Please format them correctly.

I think it is easier to read through pastebin

https://pastebin.com/0TeQyN76

see step 11 here, How to help us help you - or How to ask a good question

Ok, i see. Hope this is better

- id: '1587665066579'
  name: Ankomst 2
  entities:
    scene.lys_ved_ankomst_2:
      entity_id:
      - light.entre
      - light.kokken
      friendly_name: 'Lys ved ankomst 2 '
      id: '1587664880677'
      state: scening
    scene.termostater_ved_ankomst:
      entity_id:
      - climate.netatmo_gang
      - climate.netatmo_kokken
      - climate.netatmo_kontor
      - climate.netatmo_sovevaerelse
      - climate.netatmo_stue
      friendly_name: Termostater ved ankomst
      id: '1587316917480'
      state: scening
  

- id: '1587316917480'
  name: Termostater ved ankomst
  entities:
    climate.netatmo_gang:
      battery_level: 90
      current_temperature: 19.5
      friendly_name: Netatmo Gang
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_kokken:
      battery_level: 91
      current_temperature: 20
      friendly_name: Netatmo Køkken
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_kontor:
      battery_level: 89
      current_temperature: 19
      friendly_name: Netatmo Kontor
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_sovevaerelse:
      battery_level: 91
      current_temperature: 19.5
      friendly_name: Netatmo Soveværelse
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 16
    climate.netatmo_stue:
      battery_level: 90
      current_temperature: 21
      friendly_name: Netatmo Stue
      hvac_action: idle
      hvac_modes:
      - auto
      - heat
      max_temp: 35
      min_temp: 7
      preset_mode: Schedule
      preset_modes:
      - away
      - boost
      - Frost Guard
      - Schedule
      state: auto
      supported_features: 17
      target_temp_step: 0.5
      temperature: 20

- id: '1587664880677'
  name: 'Lys ved ankomst 2 '
  entities:
    light.entre:
      brightness: 254
      friendly_name: Entré
      state: 'on'
      supported_features: 41
    light.kokken:
      brightness: 254
      effect: none
      effect_list:
      - colorloop
      - random
      friendly_name: Køkken
      hs_color:
      - 255.059
      - 100
      max_mireds: 500
      min_mireds: 153
      rgb_color:
      - 64
      - 0
      - 255
      state: 'on'
      supported_features: 63
      xy_color:
      - 0.158
      - 0.05
1 Like

I don’t know if you can use scenes as entities in scenes. You can use them in scripts:

script:
  - home_button
      sequence:
        - service: scene_turn_on
          entity_id: scene.termostater_ved_ankomst
        - condition: state
          entity_id: sun.sun
          state: below_horizon
        - service: scene_turn_on
          entity_id: scene.lys_ved_ankomst_2

Call the script from your button tap action as a service like this:

type: button
name: Home Button
tap_action:
  action: call-service
  service: script.home_button
1 Like

then this problem pops up image

Apologies I missed a colon after the script name. Should be:

- home_button: 
1 Like

If I wasn’t this new on home assistant, I could’ve probably seen it myself. :sweat_smile:

however, I don’t understand this problem when checking the config:

Try this:

script:
  home_button:
    sequence:
      - service: scene_turn_on
        entity_id: scene.termostater_ved_ankomst
      - condition: state
        entity_id: sun.sun
        state: below_horizon
      - service: scene_turn_on
        entity_id: scene.lys_ved_ankomst_2

Note the lack of “-” in front of the script name. It’s been a while since I wrote a script. I forgot they were dictionaries not lists.

1 Like

Now it looks like this:

script:
 home_button:
    sequence:
      - service: scene_turn_on
        entity_id: scene.termostater_ved_ankomst
      - condition: state
        entity_id: sun.sun
        state: below_horizon
      - service: scene_turn_on
        entity_id: scene.lys_ved_ankomst_2

image

Of ffs. I’m not having a good day.

script:
 home_button:
    sequence:
      - service: scene.turn_on
        entity_id: scene.termostater_ved_ankomst
      - condition: state
        entity_id: sun.sun
        state: below_horizon
      - service: scene.turn_on
        entity_id: scene.lys_ved_ankomst_2

Finally it works! I have been using too many hours to fix this!!

Thank you!

No worries. Apologies for the appalling amount of errors in the original script.

Hopefully you learned a bit about what the error messages were trying to say though.

1 Like