Missing a "on new entity created" event?


Trying to create a dynamic group using appdaemon that would contain newly created entities created elsewhere in the system.

Does appdaemon have any hooks into this ?
I couldn’t find any.

Ideally my appdaemon class should be notified on newly created entities that match a predefined pattern. entity name is not one of them.

I want to create a group that holds all media_player entities created by the google chromecast groups feature.
These groups are maintained in the google home app and are in turn exposed as new mediaplayer entities within HA. I dont know the names beforehand so creating a group the good old fashioned way will not suffice here.

I am not sure if there is a hook for this but you can use get_state() or get_state("media_player") to get a dictionary of entities and their attributes. You can filter this data and store it in a variable or in another entity (such as in an AD namespace to persist restarts). It wouldn’t be too difficult to run this on a timer every hour or whatever works for you.

1 Like