How to set a YAML-created integration to an area?

I have an integration that is added by an entry in the configuration file. This Integration, its Device and Entity do not show an Area.

I want this integration to be allocated to a specific area, but I can see no way to do it. If I click on the Integration, Device, or Entity entries I am not given the ability to set an area for any of them.

How do I get around this?

I think areas can only be assigned in the UI. There is an long standing feature request for this which has gathered quite a lot of votes:

If your integration entities are editable in the UI and there is no area option, it’s presumably because the developer didn’t include one, so you could try raising an issue. If they’re not editable in the UI you could try giving them unique IDs, but with yaml integrations this is often not a valid option.

Thank you for your response.

I have to say that this seems a glaring omission. I don’t have much in my config file, but I know others do. I find it surprising that there’s not been a huge clamour for this to be resolved.

It’s not fixable, which is why it hasn’t been addressed. The only way it can be fixed is if unique_id is added to the yaml configuration or the integration is moved to the UI.

That means nothing to me, I’m afraid. I feel that this needs fixing, however it is achieved.

One possible workaround might be to use an integration like Device Tools to create a ā€œvirtual deviceā€ to which an area could be assigned.

I have done this for a set of entities created by a yaml integration, and the ā€œvirtual deviceā€ can be assigned an area in the UI.

This may be a special case, though, because my integration didn’t supply a device, only a bunch of entities from a cloud-based account. Not sure what would happen if a device already existed.

It means, if the yaml entity you created supports unique_id, add unique_id. If it doesn’t, there’s nothing you can do but wait for a developer to add unique_id or move it to the UI.

Thanks. And what does this ā€˜Unique ID’ need to look like? And how will that enable me to assign an area?

unique_id allows you to manage yaml entities in the UI. It would be covered in the documentation for the yaml integration you’re adding. It can be anything unique.

Nope, not an option for the Virgin Tivo entry.

This seems an odd and rather silly limitation of HA. I’m rather surprised it hasn’t been fixed (as a software developer I was taught that no fix is impossible). The IP address of my V6 box alone is unique, as is the name I’ve given it. Yet these aren’t sufficient to do the job. Oh well…

It’s a limitation of the integration not home assistant, and that integration looks custom. It’s a limitation because it’s impossible to make a yaml entry unique without a unique_id. When something isn’t unique, HA doesn’t have the ability to know what it is to always assign it to the same area. It’s a chicken-egg scenario.

1 Like

The IP address alone is unique. Why wouldn’t that be sufficient?

And what happens when the IP changes? Do you want a separate entity and then be forced to update your automations?

Trust me, this isn’t as simple as you’re thinking it is.

It would be a reasonable compromise. The IP of my Tivo never changes.

Nothing is ever simple behind the scenes, I know that. I was a software developer for 30 years. But nothing is impossible.

It’s not a reasonable compromise, this was done in the past and it caused all sorts of other issues. Mac addresses and IPs are not reliable sources for making things unique. We have 10 years of experience doing this.

Put a PR into the custom integration to add a unique_id then. That is the only solution that works without issues.

I was COBOL. All this OO stuff is a total mystery to me. I wish I could help, but I can’t.

Then you really have no leg to stand on here with this back and forth. This is open source after all and this is a custom integration that isn’t managed by Home Assistant.

1 Like

Looks as if the integration was written about seven years ago - which is why it’s yaml. There was an update five months ago, so the dev may still be active. Report an issue.

1 Like