Zones.yaml not working

I have split up my config.yaml but the zones.yaml returns an error in the log.
configuration.yaml:
time_zone: Europe/Copenhagen
customize: !include customize.yaml

group: !include groups.yaml
light: !include lights.yaml
sensor: !include sensors.yaml
automation: !include automation.yaml
scene: !include scenes.yaml
media_player: !include media_players.yaml
zone: !include zones.yaml

zones.yaml:

Zones yaml

zone:
name: xxx
latitude: xxxxx
longitude: xxxxxx
radius: 100
icon: mdi:sleep

zone 2:
name: xxx
latitude: xxxxxxx
longitude: xxxxxx
radius: 100
icon: mdi:paperclip

zone 3:
name: Home
latitude: xxxx
longitude: xxxxx
radius: 100
icon: mdi:home

Can someone see what is wrong?

When posting logs or configuration snippets please use code blocks and syntax highlighting.

In the editor, paste the code from your zones.yaml file and then highlight your code block and press the preformatted text button indicated in this image:

This way we can see the way that you formatted it so it can be eliminated as an issue or discovered to be the cause.

Sorry… I hope this is better :slight_smile:

configuration.yaml

  time_zone: Europe/Copenhagen
  customize: !include customize.yaml

group: !include groups.yaml
light: !include lights.yaml
sensor: !include sensors.yaml
automation: !include automation.yaml
scene: !include scenes.yaml
media_player: !include media_players.yaml
zone: !include zones.yaml

zones.yaml

Zones yaml

zone:
  name: xxx
  latitude: xxxx
  longitude: xxxx
  radius: 100
  icon: mdi:sleep

zone 2:
  name: xxx
  latitude: xxxx
  longitude: xxxx
  radius: 100
  icon: mdi:paperclip

zone 3:
  name: Home
  latitude: xxxx
  longitude: xxxx
  radius: 100
  icon: mdi:home

Try

zones.yaml

###  Zones  ###
 - name: Home
   latitude: !secret zone_home_latitude
   longitude: !secret zone_home_longitude
   radius: 20
   icon: mdi:home
  
 - name: VS_Office
   latitude: !secret zone_office_latitude
   longitude: !secret zone_office_longitude
   radius: 50
   icon: mdi:city
1 Like

I think it’s the space. Either use zone2: or zone_2:. And @cameron is right about the formatting - here’s mine (all public places so actual lat/long given):

#
# Zones
#
- name: Somerset Shopping Center
  latitude: 40.577232
  longitude: -74.627472
  radius: 50
  icon: mdi:store

- name: Watchung Shopping Center
  latitude: 40.639901
  longitude: -74.423001
  radius: 50
  icon: mdi:store
  
- name: Blue Star Shopping Center
  latitude: 40.6511783
  longitude: -74.4087588
  radius: 50
  icon: mdi:cart-outline

That did the trick :slight_smile: Thanks!!!