Hello,
I am setting up an automation to update one of my groups by removing a member at night. The actions I have here run without errors, but the members of the group don’t change when I check the Helpers tab. Please advise, and thanks in advance!!
No, but the changes you made will not show up I believe until the groups are reloaded in some way. To be sure you could run your script then go to developer tools / yaml and manually reload groups then check if the changes are applied as you expected.
Done, same result though. No errors in the logs, but no change in the group. I did notice that if I change the object_id to something that doesn’t exist, it also runs with no errors…
Ah, well I may be reading the documents wrong here but I believe the script you are trying to run is only for the old yaml groups and not for those created in the Ui
The group.set service is for creating modifying entities whose domain is group.
You used the Helpers menu to create a Switch Group entity called switch.dynamic_ac_units. Note that this entity’s domain is switch and not group therefore it’s my understanding that you can’t use the group.set service call to modify it.
If you need to programmatically create/modify a group’s membership, I suggest you define it as a traditional group and not as a Switch Group helper.
Understood- thank you for explaining the difference for me!
I’ve updated the group accordingly, see below. Do you see any flaw? Still not changing the group members, even after an update.
Correct. The Helpers menu has a Group helper but the resulting entity’s domain is not a group but whichever domain was chosen from the menu (binary_sensor, cover, fan, etc).
Ironic that the Group helper cannot create a group entity but it is what it is.
Then you’re doing something wrong (that I can’t pinpoint) because it works for me. I can use group.set to create a group and then use the same service call to modify its membership. The change is immediately visible when the group entity is viewed in Developer Tools → States.
service: group.set
data:
name: Just a test group
object_id: test_group
entities:
- input_boolean.alarm_1
- input_boolean.alarm_2
- input_boolean.alarm_3
I guess there was no better way to express what that helper achieves so they chose “Group” which was already the name of an existing entity domain. Kind of a misunderstanding of who does what but there it is … a Group Helper that doesn’t actually create group entities.