Skip to content

Is it possible to dynamically create a group? #278

Answered by dlashua
wsw70 asked this question in General
Discussion options

You must be logged in to vote

It is possible (I think, though I've not actually tried it with group, however, it works fine in other domains) to create a group from pyscript though it may be more complicated than it is worth.

Once a group is created, you can change its entities using the group.set service call.

With that being said, if your intended use case of these groups is all within Pyscript, you don't actually need a Home Assistant Group to do this. You could create a variable in pyscript that maintained the list of entities that should be in the group and refer to the variable whenever you needed to access them.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wsw70
Comment options

@dlashua
Comment options

@wsw70
Comment options

Answer selected by wsw70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants