AI tells me there’s a “scene_created” event but I suspect it’s a hallucination because it doesn’t work (tested both in the developer tools and in a dummy automation). Tried googling as well but nothing comes up for that that I see. Thanks.
You can listen for related call_service
events:
- trigger: event
event_type: call_service
event_data:
domain: scene
service: create
- trigger: event
event_type: call_service
event_data:
domain: scene
service: delete
Ooh interesting! I’m not near a computer now but this particular scene is created via the Hue integration. Do you think that will also work? I will absolutely test it once I go back anyway. This is very cool, had no idea you can detect any call
I’m not sure about that… my guess would be “no”, but it’s worth a try in the Event tool. I don’t use any integrations that provide scenes, so I can’t test it.
A workaround might be to set up a template sensor that keeps a count of scene
entities provided by Hue and fire on its state changing. You could use templates to determine if the value is increasing or decreasing.
You were correct, it does not. It probably uses some internal APIs available to HA integrations that do not report to the event bus.
I’ve marked your original answer as the solution since my question didn’t explicitly mention that this scene creation happens via the Hue integration (basically, I want to catch when someone creates a new scene in a room in the Hue app – those get auto-created as HA scenes as well). So I think my question as posed + your answer can be very useful to others.
But the true answer to my problem will likely be the template idea you had. I think that’s good enough. Thanks!
- Go to Developer Tools → Events
- In Listen to events → Event to subscribe to enter
entity_registry_updated
- Click Start Listening
- Create a new scene using the Hue app.
- Examine the details of the generated event (Home Assistant will register the creation of a new
scene
entity). - Assuming an event was generated, use its relevant details in an Event Trigger.
Bare minimum:
trigger: event
event_type: entity_registry_updated
If you need help to fine tune the EventTrigger, post the details of the generated event.
Oooh interesting!! Thanks @123
I’ll play with it tomorrow and report back
this worked great, thanks!