myradon
December 12, 2019, 6:03pm
1
Hi guys,
I try to add a group of Hue Zigbee lights to HA according to example page Zigbee2MQTT HA-integration
HA thrown an error Configuration not valid;
Invalid config for [group]: expected a dictionary for dictionary vale @data [‘group’]. Got [OrderDict([‘platform’, 'mqtt and so on
I’ve got a specific group.yaml which is included in configuration.yaml. This is contents of group.yaml;
- platform: mqtt
name: lights_ceiling_small_bedroom
schema: json
command_topic: "zigbee2mqtt/lights_ceiling_small_bedroom/set"
state_topic: "zigbee2mqtt/lights_ceiling_small_bedroom"
color_temp: true
brightness: true
zigbee2mqtt-group;
'1':
friendly_name: lights_ceiling_small_bedroom
retain: false
optimistic: true
transition: 2
devices:
- '0x0017880104fffffff'
- '0x0017880104eeeeee'
‘group-topic’ set “on” from dev-tools tab MQTT, Zigbee2MQTT set state to ON for independent lights. So that’s fine.
As a HA-newbie I can’t debug the vague error message. What’s wrong with the syntax?
francisp
(Francis)
December 14, 2019, 10:06am
3
Just guessing, since I don’t zigbee2mqtt groups, but I think your HA configuration should not be in groups.yaml, but in light.yaml.
myradon
December 14, 2019, 10:21am
4
@francisp your right! I’ve tried to change that. Like in configuration.yaml > group: !include_dir_list groups . In groups-folder a lights_ceiling_small_bedroom.yaml . It just throws the same error. Fiddling with settings and include-types at a certain point HA wasn’t complaining, but I never saw the group under entities.
myradon
December 14, 2019, 5:42pm
5
Okay I figured it out. A zigbee2mqtt-group isn’t a group in HA. For example my 2 Philips Hue lights paired in zigbee2mqtt shall be configured as a light. Even though z2m-docs mention a section about group. Minor detail Took me 3 days to figure out.
groups.yaml zigbee2mqtt;
'1':
friendly_name: lights_ceiling_small_bedroom
retain: false
optimistic: true
transition: 2
devices:
- '0x001888010526af6a'
- '0x00188801053019eb'
manual light entity HA:
light:
- platform: mqtt
name: "lights_ceiling_small_bedroom"
schema: json
command_topic: "zigbee2mqtt/lights_ceiling_small_bedroom/set"
state_topic: "zigbee2mqtt/lights_ceiling_small_bedroom"
color_temp: true
brightness: true
Basic automation will be;
- alias: Toggle_lights_ceiling_small_bedroom
initial_state: true
trigger:
- platform: state
entity_id: sensor.switch_single_small_bedroom_click
to: 'single'
action:
- service: light.toggle
data_template:
entity_id: light.lights_ceiling_small_bedroom
brightness: 125
zigbee2mqtt docs groups: https://www.zigbee2mqtt.io/integration/home_assistant.html#groups (I asked Koen to add some extra explanation after posting solution over here)
Home Assistant docs adding entities (general): https://www.home-assistant.io/docs/configuration/devices/
2 Likes
Thank you for this example!!
RKor
(Rani)
March 4, 2020, 11:18am
7
I’m trying to add the “transition” setting to one device, do I add it in devices.yaml under the device?
If you could give me an example, that would be great
Thank you!
EDIT; It’s a offtopic. Yep you do! I can’t access the config but search for your device in devices.yaml. Add at bottom of entry. Pretty straight forward. https://www.zigbee2mqtt.io/information/configuration.html#device-specific-configuration , https://www.zigbee2mqtt.io/information/supported_devices.html
RKor
(Rani)
March 4, 2020, 12:11pm
9
Thanks, sorry I probably should’ve mentioned this before but I have already tried this but it isn’t working for me.
This is what I have in devices.yaml
'0x001788010415f21c':
friendly_name: 'Office Hue Bulb'
retain: false
transition: 10
It should. Which device? Do a search in here and also Z2M-forum. Else open up new topic. Cheers!
Thank you so much!!!
You helped me out after searching for this for months now ^^
In the end and with your hint it was super easy to find the official guidance to this group topic ^^
haha - of course
May you please update your solution post #5 with this link to the official guidance:
https://www.zigbee2mqtt.io/integration/home_assistant.html#groups
there is also the rgb feature enabled! absolutely useful for hue and other rgb friends
I think as a newbie to understand the concept. Bit of a learning curve but he that’s the way you learn, right. Making mistakes and find out what goes wrong.
When you find out yourself it makes sense HA can’t look into a crystal ball when it subscribes to and publish messages from/to a MQTT-topic it actually is a group of devices in Z2M.