Hey all;
I am very new to HA and YAML. I get this error after I edited my configuration.yaml to add a template sensor.
“The system cannot restart because the configuration is not valid: Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 11). Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None.”
I added the below to my sensor.yaml and got a lot of errors. I read the topic HERE and thought I was having the same problems. So I didn’t change anything.
- plateform: template
sensors:
hallway_smoke_co_alarm:
unique_id: hallway_smoke_co_alarm_status
friendly_name: "Hallway Smoke & CO Detector Status"
value_template: >-
{% if is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "1")%}
!!!SMOKE DETECTED!!!
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "2")%}
!!!CARBON MONOXIDE ALARM!!!
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "0") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "12")%}
TEST TEST TEST
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "13")%}
Safe - Normal Operation
{% else %}
UNKOWN
{% endif %}
icon_template: >-
{% if is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "1")%}
mdi:fire
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "2")%}
mdi:cloud-outline
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "0") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "12")%}
mdi:alert-octagram
{% elif is_state("sensor.hallway_smoke_detector_51_alarmlevel", "255") and is_state("sensor.hallway_smoke_detector_51_alarmtype", "13")%}
mdi:smoke-detector
{% endif %}
When I go to validate my config I get the above errors. Here is my configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml
nest:
client_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# "Project ID" in the Device Access Console (not Cloud Project ID!)
project_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
frontend:
# your configuration.
themes: !include_dir_merge_named themes
# your configuration.
input_select:
themes:
name: "Themes"
icon: mdi:format-paint
options:
- Caule Black Rose
- Caule Black Purple
- Caule Black Blue
- Caule Black Aqua
- Caule Black Green
- Caule Black Yellow
- Caule Black Orange
- Caule Black Coral
- Caule Black Pink
- Caule Black Gray
- Caule Dark Rose
- Caule Dark Purple
- Caule Dark Blue
- Caule Dark Aqua
- Caule Dark Green
- Caule Dark Yellow
- Caule Dark Orange
- Caule Dark Coral
- Caule Dark Pink
- Caule Dark Gray
- Caule Light Rose
- Caule Light Purple
- Caule Light Blue
- Caule Light Aqua
- Caule Light Green
- Caule Light Yellow
- Caule Light Orange
- Caule Light Coral
- Caule Light Pink
- Caule Light Gray
- Caule Black Rose Glass
- Caule Black Purple Glass
- Caule Black Blue Glass
- Caule Black Aqua Glass
- Caule Black Green Glass
- Caule Black Yellow Glass
- Caule Black Orange Glass
- Caule Black Coral Glass
- Caule Black Pink Glass
- Caule Black Gray Glass
- Default
camera:
- platform: generic
still_image_url: https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?num=20&type=N0Q&mapx=400&mapy=240&brand=wui&delay=15&frame=0&scale=0.75&transx=0&transy=0&severe=1&smooth=1¢erx=400¢ery=240&station=LSX&rainsnow=1&lightning=1&noclutter=1&showlabels=0&showstorms=10&rand=27422459
name: Weather Radar
What am I doing wrong?