Definitions of lights and groups

Hi,
progressing a bit with the setup, but have some questions…

I have two objectives with my HA effort; being able to manually toggle lamps with presets, and having automation conditionally doing it for me. I am using Philips Hue.

Starting with the manual scenario

  1. While reading up on configuration, it was stated that each entity should be defined in the configuration.yaml. Question being, how do I do it? I find examples, but none which depicts this?

I tried to add two files;
lights: ~/.homeassistant/light.yaml
group: ~/.homeassistant/groups.yaml

light.yaml:
- platform: hue
entities:
- light.one
- light.two
- light.three

groups.yaml:
- lamp:
name: Lamp
entities:
- light.one
- light.two

and imported them by adding following to configuration.yaml:
“light: !include light.yaml”
“group: !include groups.yaml”

Judging from the log below the contents of those are obviously not correct…

Jan 06 22:45:55 hassbian systemd[1]: Started Home Assistant for homeassistant.
Jan 06 22:45:57 hassbian hass[3675]: 2019-01-06 22:45:57 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
Jan 06 22:45:57 hassbian hass[3675]:   in "/home/homeassistant/.homeassistant/light.yaml", line 2, column 13
Jan 06 22:45:57 hassbian hass[3675]: 2019-01-06 22:45:57 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping va
Jan 06 22:45:57 hassbian hass[3675]:   in "/home/homeassistant/.homeassistant/light.yaml", line 2, column 13
Jan 06 22:45:57 hassbian hass[3675]: 2019-01-06 22:45:57 INFO (MainThread) [homeassistant.core] Starting Home Assistant
Jan 06 22:45:57 hassbian hass[3675]: 2019-01-06 22:45:57 INFO (MainThread) [homeassistant.core] Timer:starting

Loading HA in my browser happily stated that neither ‘light’ nor ‘group’ could be set up…

I have looked through what I could find on “home-assistant.io” but did not find the correct syntax, please help.

Thanks

Please follow the instructions at the top of the page and post your config properly.

Fair enough, Sorry. I have corrected that now.

There hasn’t been a light/hue platform for like a hundred versions. You have to setup the hue component standalone

hue:
  bridges:
    - host: !secret hue_hub_ip
      allow_unreachable: true

Hi,

I do have the config for the bridge you sent already in place. If I uncomment the light.yaml & groups.yaml, it loads and present my lamps on the dash, but I thought it was possible to group lights in HA as well…

I thought it was going to be easier configuring something nice with HA instead of the different apps for hue… Guess I was wrong then?

Yes you can group hue lights in HA. Please check your entity ids from the dev-state page.

You can group the lights, using either groups or light_groups in your configuration, but that’s not what you are doing in your light.yaml, you are trying to declare a light/hue platform that doesn’t exist, hence why it doesn’t load.

Thanks, that sounds hopeful. I did look at the examples here: https://www.home-assistant.io/components/group/ which I tried to translate into the groups.yaml file above. I do know how extremely picky yaml is with syntax.

I got this when syntax checking the file…

Invalid config for [group]: expected a dictionary for dictionary value @ data['group']. Got [OrderedDict([('lamp', None), ('name', 'Lamp'), ('view', True), ('entities', ['light.one', 'light.two'])])]. (See /home/homeassistant/.homeassistant/configuration.yaml, line 113). Please check the docs at https://home-assistant.io/components/group/

It getting late, I have to continue this tomorrow. Thanks for the help so far, if you have an idea of the above misconfig it’d be great.
Thanks

You still haven’t posted a properly formatted groups.yaml, but I’ll post from mine when I get to my laptop, too hard in android.

Presuming you are not using lovelace and have nothing else in your groups.yaml, put this in it:

lamp_one:
  name: Lamp one
  entities:
    - light.ONE
    - light.TWO

lamp_two:
  name: Lamp two
  entities:
    - light.THREE 
    - light.FOUR 

lamps:
  view: yes 
  icon: mdi:lightbulb-outline
  entities:
    - group.lamp_one
    - group.lamp_two

This will create a new tab with two cards in it, and hopefully you can work out how the code relates to what you see on the screen and take it from there :+1:

1 Like

I realise I have mine defined as a light group, not a group. You should probably do the same as the light group is designed precisely for, ummm, groups of lights!

In configuration.yaml I have:

light:
  - platform: group
    name: Hallway Lights
    entities:
      - light.hallwaylight
      - light.hallwaylight2

  - platform: group
     name: Foyer Lights
     entities:
       - light.foyerlight1
       - light.foyerlight2

Docs here https://www.home-assistant.io/components/light.group/

It might also pay to read https://www.home-assistant.io/components/hue/ as I suspect you got your hue config from somewhere outdated.

2 Likes

This worked out really nice. Now I can start planning my lighting and eventually start automating bits of it.
Thanks!

1 Like

Hi, agreed. I chose mf_social’s config above, but appreciate the links you mention. I will definitely read up on the hue, as I had a bit of a struggle to get it going. Guess I must have found some old posts as you suggests. Hope I will find lots of useful stuff in there!
Thanks!

1 Like