Tsar
(Christian)
December 20, 2021, 4:04pm
1
I want to define my first group of switches…
switch:
- platform: group
name: Sfeerverlichting
entities:
- switch.sfeerverlichting_dressoir
- switch.sfeerverlichting_links
- switch.sfeerverlichting_rechts
But the configuration validation says
Invalid config for [group]: value should be a string for dictionary value @ data[‘group’][‘switch’][‘entities’]. Got None. (See /config/configuration.yaml, line 8).
What’s the problem…must be something stupid, but… ?
I don’t think a switch with platform: group
is valid. The documentation does not seem to mention that anywhere. There’s a light group and a group , but no switch group.
Tsar
(Christian)
December 20, 2021, 5:02pm
3
OK, I define it as this and no error anymore
group:
name: Sfeerverlichting
entities:
- switch.sfeerverlichting_dressoir
- switch.sfeerverlichting_links
- switch.sfeerverlichting_rechts
But now, how can I replace the different entities in my automatisations by this group ?
alias: Sfeerverlichting 's avonds inschakelen
description: ''
trigger:
- platform: sun
event: sunset
offset: '-01:30'
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.toggle_op_vakantie
state: 'off'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.toggle_sfeerverlichting_s_avonds
state: 'on'
action:
- type: turn_on
device_id: 7a74e8a0e5c59427d4dd08b85a25577b
entity_id: switch.sfeerverlichting_dressoir
domain: switch
- type: turn_on
device_id: daec5c6545b70ab1e2a1aa4954463ce6
entity_id: switch.sfeerverlichting_links
domain: switch
- type: turn_on
device_id: dd77e7fcd8e29c8129905d5b77f148d9
entity_id: switch.sfeerverlichting_rechts
domain: switch
mode: single
You can call homeassistant.turn_on
with your group as the entity_id
.
Tsar
(Christian)
December 20, 2021, 8:33pm
5
Thank you !
action:
- service: homeassistant.turn_on
target:
entity_id: group.group