What do I enter for the name of a zone?

I can’t seem to get a conditional card to recognise the name of a zone. Where am I going wrong?

I have a zone called ‘Work (SomePlace)’. Whether I put ‘Work (SomePlace)’ or ‘work_someplace’ or ‘work__someplace_’ in the below, I can’t get the condition to pass when I am in that zone.

Help!

type: conditional
conditions:
  - condition: or
    conditions:
      - condition: state
        entity: person.geoff
        state: 'work_someplace'
      - condition: state
        entity: person.geoff
        state: not_home
card:
  type: vertical-stack
  cards:
    - type: custom:html-template-card
      title: Oxford Parkway Station
      ignore_line_breaks: false
      content: >-
        {% from 'macros.jinja' import train_departure_board %} {{
        train_departure_board('sensor.train_schedule_oxp_bit') }}

you need to use its entity_id.

It’ll be something like zone.work_someplace

Note: all lower case, spaces replaced by underscores (I think the brackets are ignored).

You can check by going to:
➜ settings ➜ integrations ➜ entities
and then searching for it.

1 Like

Or by going to Developer Tools → States and searching for “zone.” in the first column heading.

1 Like

Weirdly, today, this worked:

type: conditional
conditions:
  - condition: or
    conditions:
      - condition: state
        entity: person.geoff
        state: Work (SomePlace)
      - condition: state
        entity: person.geoff
        state: not_home
...

Thanks for your help.

Don’t be confused by the above answers.

You are using a state trigger for a person entity not a zone entity.

a “person.x” state is either ‘home’, ‘not_home’ or the true (not slugified) name of a defined zone.

The name of the zone will be the friendly_name attribute of the zone which is taken from the “name:” configuration option when setting up the zone.

So in your case the state of person.geoff will be ‘home’, ‘not_home’ or ‘Work (SomePlace)’ as you have found.

Tho I’m not sure why it didn’t work the first time.

1 Like