Automation not working mapping error

I am back, this automation is still not working. I’ll see if I can paste it in it’s entirety with formatting for your dissection.

pi@raspberrypi:/home/homeassistant/.homeassistant $ cat automations.yaml
alias: Living Room Floor Lamp Off AM
  trigger:
    platform: time
    at: '07:00:00'
  condition: 
    condition: time
    after "06:59:59"
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
  action:
    service: switch.turn_off
    data:
      entity_id: switch.living_room_table_lamp_switch

> pi@raspberrypi:/home/homeassistant/.homeassistant $ tail home-assistant.log
> 2017-10-04 22:19:49 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
>   in "/home/homeassistant/.homeassistant/automations.yaml", line 25, column 10
> 2017-10-04 22:19:49 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
>   in "/home/homeassistant/.homeassistant/automations.yaml", line 25, column 10

Give this a try:

  - alias: Living Room Floor Lamp Off AM
    trigger:
      platform: time
      at: '07:00:00'
    condition: 
    - condition: time
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
    action:
    - service: switch.turn_off
      entity_id: switch.living_room_table_lamp_switch
pi@raspberrypi:/home/homeassistant/.homeassistant $ cat automations.yaml
- alias: Living Room Floor Lamp Off AM
    trigger:
      platform: time
      at: '07:00:00'
    condition: 
    - condition: time
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
    action:
    - service: switch.turn_off
      entity_id: switch.living_room_table_lamp_switch

then:

pi@raspberrypi:/home/homeassistant/.homeassistant $ tail home-assistant.log
2017-10-05 03:07:47 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automations.yaml", line 2, column 12
2017-10-05 03:07:47 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automations.yaml", line 2, column 12

and

pi@raspberrypi:/home/homeassistant/.homeassistant $ cat configuration.yaml
homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 32.736167
  longitude: -97.374556
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 222
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Chicago
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

zwave:
  usb_path: /dev/ttyUSB0


http:
  # Uncomment this to add a password (recommended!)
  # api_password: PASSWORD
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr

# Text to speech
tts:
  - platform: google

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

Can you provide a little more info on what you are trying to achieve @jmcgee?

Edit:

Also, the formatting you have posted is what is causing that error. You have ‘trigger’ indented, which is throwing the error it looks like. Should be like this;

- alias: Living Room Floor Lamp Off AM
  trigger:
    platform: time
    at: '07:00:00'
  condition: 
    condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  action:
    - service: switch.turn_off
      entity_id: switch.living_room_table_lamp_switch

Try surrounding alias in quotes, maybe the Off part breaks the automation.
- alias: "Living Room Floor Lamp Off AM"

1 Like

Thanks Kanga. Put you code in and it works. I also changed the alias to match the light.

1 Like