[area_id] is an invalid option for [automation]

Hi,

I recently decided to recreate hy HA config from scratch to make better use of all the new features. One i’d like to acheive is using areas instead of groups everywhere in my config. However, a simple automation like:

- id: '1537632445043'
  alias: Welcome Home
  trigger:
  - entity_id: group.presence
    platform: state
    from: not_home
    to: home
  action:
  - service: light.turn_on
    area_id: kitchen

Throws the error [area_id] is an invalid option for [automation] when i click check config. I’ve tried using the ID for the kitchen area also but it doesnt help, this error is that the whole “area_id” tag is unexpected. I was under the impression this should work now, can anyone spot what I got wrong? Thanks!

Your automation is correct, however using an area_id in an automation is not possible (yet). The whole area thing is still in the works and currently it’s only usable in a few specific use cases.

Ah ok, I think i got misled by this section of the 0.90 release notes: “Areas can now also be used as targets in services. Just specify area_id instead of entity_id in your scripts or automations.” https://www.home-assistant.io/blog/2019/03/20/release-90/

Yes you are right, must have missed that one. Does the automation work and it’s just the config checker that throws an error or does it not work at all?

I don’t think the automation works at all, and it also disables it throughout HA, e.g. as soon as i swap entity_id with area_id the automation disppears from the service list in developer tools etc.

I need to test this when I’m back home. Which version of HA are you using?

I must agree, I know that this is where the devs are heading but I didn’t think they were anywhere near implementating it yet.
Why the docs (edit: see below) ‘notes’ suggest this is the case I’ve no idea.
The ‘old’ methog of listing the entity id’s you need still works and will continue to work (or a LOT of advanced users will be “a bit miffed” )
I know this is not what you wanted to do but it seems that this is still a work in progress.
Welcome to the club :crazy_face:

Very latest, 0.105.2. Was the same in 0.104.x, but i didnt try anything earlier. Thanks for your help! @Mutt yes im totally happy to use the old method in the mean time, im just reporting in case this was a bug :slight_smile:

I don’t see it mentioned in the docs, only in the release notes of version 0.90. However I see, that someone already created an issue on Github for this, see here, which got closed because this PR has been merged. Just from taking a quick look at the code, it actually looks to me like this should work. Will need to test.

1 Like

Ah, one of the perils of reading stuff on a phone, I’ve corrected the above to cause minimum confusion.
I shall leave this in your capable hands :smiley:

@RJKeevil Rob, you are absolutely correct and it’s only through efforts of worthies such as yourself that these issues get picked up. I applaud your efforts (only wish I was half as good at spotting the mistakes in my own typing :crazy_face: ) I don’t think this is a ‘bug’ more likely is someone jumped the gun or it was wishful thinking based on the development track.

To be REALLY honest, I’m surprised there aren’t more such errors buried deep in the code and documents. It’s a testament to people involved that we have a ‘platform’ that is as reliable and as supported as it is.

Mind you, I have it on good authority that they are officially “Awesome” :smiley:

2 Likes

Thanks both! Fully agree the team are officially awesome :sunglasses: most open source projects cant claim to acheive this level of stability in a such complex project as HA. If I can help with dev or testing of the fix, please point me in the right direction.

@Burningstone did you get a chance to test this?

I tested it yesterday and it didn’t work, I also tried with this long, meaningless area_id but I didn’t succeed. I also didn’t see any error messages. I will not investigate further as I still don’t see the advantage of a area over a normal group. Any specific reason for not using groups instead of areas?

I tried to use areas in my new config for a few reasons, they seem to be more supported than groups in the UI (therefore less config to maintain for me), apparently they are faster as they dont constantly track state, plus I like the like the interface (e.g. I can chose all devices in the kitchen, or just lights etc). But if its not ready for primetime then ill go back to groups, no bother.

I got this to work. seems like there are two important notes.

  • Use the database id (hex format 32 bytes) not the reference name
  • area_id is not accepted as a generic action attribute and needs to be within the data param (maybe this is only an error going through the automatons UI)
action:
  service: light.toggle
  data:
    area_id: ffffffffffffffffffffffffffffffffffff99

Hope this gets it working for you and others. It has been a bit of a search for me to get the answer since it’s a new feature.

3 Likes