Why is scenes.yaml so verbose?

I’ve created a few scenes using the Home Assistant UI. Today I started looking at them in scenes.yaml to better understand that and make some changes, and I noticed most of the entities are shown with all (or most) of their attributes, even though the scene simply just needs to turn it on or off. Here’s an example of a light that is supposed to be turned on and set to a certain brightness and color temp. Is it normal that the GUI scene editor stores all parameters like this? I’d like to trim it down for readability, is there any harm in that? I’m guessing it might even cause a slight improvement in ZHA reaction time, if I only send one “off” command instead of a whole list of commands.

light.philips_lct016_huelight_2:
      min_color_temp_kelvin: 2000
      max_color_temp_kelvin: 6535
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - colorloop
      supported_color_modes:
      - color_temp
      - xy
      color_mode: xy
      brightness: 51
      hs_color:
      - 345.566
      - 83.137
      rgb_color:
      - 255
      - 43
      - 94
      xy_color:
      - 0.62739
      - 0.277241
      off_with_transition: false
      off_brightness:
      icon: mdi:coach-lamp
      friendly_name: Front Porch Huelight
      supported_features: 44
      state: 'on'
      device_id: '14'
      zone_id: '8'
      
1 Like

I use MQTT now and my scenes are stored in Z2M but, when I was using my Hue hub, I wrote my scenes as follows. I have many others, but this has both ‘off’ and ‘on’ and colour. I did play about a bit to work out what was useful and what was extraneous.

scene:
  - name: accents
    icon: phu:bloom
    entities:

      input_select.light_scene:
        state: "accents"

      light.landing:
        color_mode: brightness
        brightness: 178
        state: 'on'

      light.hallway:
        color_mode: brightness
        brightness: 178
        state: 'on'

      light.livingroom_lamps_half_on:
        color_mode: brightness
        brightness: 178
        state: 'on'
      
      light.livingroom_lamps_half_off:
        color_mode: brightness
        brightness: 178
        state: 'on'
      
      light.livingroom_blooms:
        color_mode: rgb
        brightness: 255
        rgb_color: [255,68,0]
        state: 'on'

      switch.orangery_smartplug:
        state: 'on'
      
      light.orangery_lantern:
        color_mode: rgb
        brightness: 177
        rgb_color: [255,176,128]
        state: 'on'

      light.porch_colour:
        color_mode: rgb
        brightness: 180
        rgb_color: [255,173,74]
        state: 'on'

      light.side_colour:
        state: 'off'

      light.patio:
        state: 'off'

I don’t know if this is good practice or not, but this worked well for years. I only stopped to move to a single Sonoff 3.0 stick (to replace multiple hubs/networks with a single Zigbee network).


[edit: removed one scene as the one remaining had examples of both ‘off’ and ‘on’ within]


[edit:] I should add that to do this you need to write your own yaml scenes. I don’t think you can do this in the UI (but if you are only using the UI, it shouldn’t matter anyway).