How to press a button/switch in a scene?

Hi,

Trying to create a scene (Game Night) where it should do the following actions:

Turn on android TV - working
Turn on fan switch - working
Turn on pin light switch - working

These 2 I added using the Wake On Lan integration and they are working fine by clicking the Press button. Just don’t know how to call them in the scene.
Turn on PC (wake on lan)
Turn on another PC (wake on lan)

This is my switches.yaml. I also added the wake on lan switch manually. (Also don’t know how to turn them on in the scene. Just for reference)

- platform: wake_on_lan
  name: hp_mini_switch
  mac: xx:yy:zz:aa:bb:cc

- platform: wake_on_lan
  name: ryzen_switch
  mac: 00:22:44:66:88:00

In my scenes.yaml

- id: '1730362167959'
  name: Game Night
  entities:
    media_player.aquos_4ktvx17:
      friendly_name: AQUOS-4KTVX17
      volume_level: 0.10
      state: 'on'
      source: HDMI 1
    switch.veranda_switch_switch_1:
      device_class: switch
      friendly_name: Veranda Switch Switch 1
      state: 'on'
    switch.veranda_switch_switch_2:
      device_class: switch
      friendly_name: Veranda Switch Switch 2
      state: 'off'
    switch.veranda_switch_switch_3:
      device_class: switch
      friendly_name: Veranda Switch Switch 3
      state: 'on'
    switch.hp_mini_switch: 
      friendly_name: "HP Mini PC"
      state: 'on'
    switch.ryzen_switch:
      friendly_name: "Ryzen PC"
      state: 'on'
  metadata: {}

Check configurations does not show any issues. I’m able to restart fine. When I try to active the scene, everything works except for the wake on lan switches.

Looking at the logs, it shows

  • Unable to find entity switch.hp_mini_switch
  • Unable to find entity switch.ryzen_switch

Not sure why it did not find them even though I defined them in the switches.yaml.

Appreciate any help

Buttons do not have “real” states, so they won’t work in a scene.

This is why I moved from scenes to scripts. You can perform any action in a script.

1 Like