`scenes.yaml`: what is `entity_only: true` for?

In my scenes.yaml I have:

  metadata:
    light.wiz_lightbulb_kitchen:
      entity_only: true

What is the entity_only: true doing?

According to Google:

  • When you set entity_only to true for an entity within a scene, it means that only the entity’s state is saved and restored when the scene is activated.

Just guessing but I think that this means that attributes aren’t saved?

Link? The search query? I’ve tried to google for it before asking, but haven’t found any sensible results.

BTW, no info in the docs as well: Scenes - Home Assistant

I think Steve is correct. It’s looks to be a bit implicit indeed.

In the docs you quoted it shows how you can define attributes for an entity as part of the scene. In the same way, attributes of an entity (e.g. brightness or colour for a light) would be saved too.

As you can see, there are two ways to define the states of each entity_id:

  • Define the state directly with the entity. Be aware, that stateneeds to be defined.
  • Define a complex state with its attributes. You can see all attributes available for a particular entity under developer-tools -> state.

How did you create the scene? If you wrote the YAML, where did you see that option in the docs, because it’s not on the page already linked to here, as you’ve noted. I don’t use the UI for config, but I don’t see an option for that in the UI or in the UI docs.

I went to look for the source, but I couldn’t find it again. So I asked ChatGPT and got this:

# Calling the turn_on service on a light entity
service: light.turn_on
data:
  entity_id: light.kitchen
  brightness: 255
  entity_only: true
  • If entity_only is set to true, only the entity ID (light.kitchen) is passed to the service call.
  • If entity_only is set to false or not specified, both the entity ID (light.kitchen) and the brightness attribute (set to 255) are passed to the service call.

By default, if entity_only is not specified in the service call, it is considered false.

When I presses ChatGPT for a reference into the docs, I got this:

There isn’t a specific entity_only option documented in the official Home Assistant documentation. The information provided was based on a hypothetical scenario and general knowledge of Home Assistant’s service call structure.

I other words, no one knows.

ChatGPT is delusional.

It’s set by the frontend in the scene editor: https://github.com/home-assistant/frontend/blob/293f89a07b054d8374e7e4fd06e340d1cbc82475/src/panels/config/scene/ha-scene-editor.ts#L824-L840

So consider it internal data to HA, not meant to be used elsewhere.

I’m not a typescript expert, nor have I used scenes, but I presume it has something to do with distinguishing between choosing a single entity vs. entities from a device. https://github.com/home-assistant/frontend/blob/293f89a07b054d8374e7e4fd06e340d1cbc82475/src/panels/config/scene/ha-scene-editor.ts#L624-L646

This answer might be actually be close to the intent (even if it was an accident):

2 Likes