Please help - scenes

Hello. I have now got this far (picture 1 and 2) with hassio lovelace.
pic 1

pic 2

On the last picture I have included some red text in Paint as where I want it to go. I get no errors now on an easy scene inclusion wich is inbedded in configuration.yaml:

scene:
  - name: Test
    entities:
      light.datorrum: true
      light.golvlampa_vardagsrum:
        state: true
        brightness: 200

Tänd allt = Turn on all lights (turn on all selected light on x percent)
and so on (red text)

I nreally need this scenes/groups to work and easy to find at “startpage”. I find the new Lovelace easy to include stuff like Fibaro multisensors (temp etc) as you can see. But including scenes I dont get working.

Any ideas?

Best regards,

I don’t get it. Your scene’s aren’t working? or are you not able to activate the scene from lovelace? Or you’re unable to include scene’s in lovelace?

Hello Pippyn.
I created this:

scene:
-name: Test
entities:
light.datorrum: true
light.golvlampa_vardagsrum:
state: true
brightness: 200

as a test in my configuration.yaml.
I however cannot test if it works becuse I dont find it/know how to get it to front end or what you call it. And I do not find any easy documentation on the subject.
I want it to be where I put the red text in picture 2.

:frowning_face:

Best regards,

EDIT: I have been looking here also to try find/test add it as I stated above (pic 3

please correctly format your code. Instructions are at the top of the page…every page

As Sparkydave said; please fix your formating of the code. If this is what you have in your configuration file, it will not work. The indentations are wrong. It should be something like;

scene:
  - name: Test
    entities:
        light.datorrum:
            state: true
        light.golvlampa_vardagsrum:
            state: true
            brightness: 200

To add a button to call the scene in lovelace add this as a test;

- type: glance
  title: Test Scene
  entities:          
      - entity: scene.test
        tap_action: call-service
        service: scene.turn_on

when was this changed? Up to now I have all my scenes configures as follows, and they work without any issue:

##########################################################################################
# Scenes Home theater
##########################################################################################

- name: Home theater off
  entities:
    light.buffet: off
    light.dining_table: off
    light.office_inside: off
    light.master_bedroom: off
    group.bureau_lights: off
    light.living_ceiling_3_wall: off

- name: Home theater on
  entities:
    light.kist:
      state: on
      transition: 4
      brightness: 125
      hs_color: [14,83]
    light.home_theater:
      state: on
      transition: 4
      brightness_pct: 40
      rgb_color: [255,188,85]
    light.office_outside: on
    light.gym_audio:
      state: on
      transition: 4
      brightness_pct: 40
    light.lounge_chair_long:
      state: on
      transition: 4
      brightness_pct: 40
      hs_color: [21,65]

somehow https://www.home-assistant.io/components/scene/ indicates you can set a light to state true, but what does that mean…? a light is on or off?

of course you can use a button to call a scene, but most likely you will need automation to do so automatically based on other Home settings, see the link for an example how to call a scene.

What changed? your config looks also fine.

As far as I know are On, true and 1 all the same. Also Off, false and 0

Well he asked for a button in lovelace

that might be the case, but that would be used best for the various entities one can use in a scene, which have different states. It is rather counter-intuitive to mix them, and to use true false for an entity that is on or off…

A light is either on or off, so I prefer using state: on in a scene. Especially when one reads the first line on the docs page:

a scene can specify that light A should be turned on

sure, working smoothly. In fact it looks better than yours :wink:
in Yaml you don’t need the 4 spaces indentation (like you do in Python) and it is preferred to use indentations of 2 spaces. Yaml his very picky about spaces, so forcing yourself to be rigid in this respect is a good thing.

which can be cool indeed.
Still, scenes really prove their power when used automatically, and of course that’s what Home Assistant does fantastically: HomeAutomation. Calling scenes from an automation based on states of other entities really makes your Home setup shine.

Hello again, Pippyn.
In what file should I add “-type: glance” text?

ERROR:

YAML Error: YAMLException: bad indentation of a mapping entry at line 2, column 8: title: Test Scene ^

In lovelace click “Configure UI”, after that in the same place click “Raw config editor”
image

Thats what I did :frowning_face:

title: Start

  • cards:
  • type: glance
    title: Test Scene
    entities:
  • entity: scene.test
    tap_action: call-service
    service: scene.turn_on
    badges: []
    title: SCENER

Now it works Pippyn.
Thank you very much for the help!

  - badges: []
    cards:
      - entities:
          - entity: scene.lights_on
        show_name: false
        show_state: false
        title: Tänd allt
        type: glance
      - entities:
          - entity: scene.lights_of
        title: Släck allt
        type: glance
    title: SCENER

SOLVED:

In configuration.yaml, create/add (but use your own light entitys and do not write “scene” twice) somewhere:

scene:
    - name: lights on
      entities:
        light.wall_light_datorrum: true
        light.golvlampa_vardagsrum: true
    - name: lights of
      entities:
        light.wall_light_datorrum: false
        light.golvlampa_vardagsrum: false

To create a “card”/layout, in lovelace click top right corner (…), click “Configure UI”.
Click + and add “Glance”, then see picture 1 and picture 2