Hi i am new to Home Assistant ,I am struggling with Yaml as i keep on getting errors messages in my configs. I have looked online and still cannot figure out what is wrong.
Could somebody advise where i am going wrong with these entries ,
I can see one thing wrong already. You should really copy and paste your code as spacing plays a great deal.
Please, no screenshots. Use the code icon (</>) to include Yaml or log output.
The errors:
- wrong keys used (
unit_of measurement:
must beunit_of_measurement
) - wrong case used (
Camera:
must becamera:
,Value_template
tovalue_template
) - wrong indendation (
sensor:
to beginning of line) - missing indendation to express the configuration itemâs level
sensor:
- platform: rest
name: Front Driveway
resources: ....
camera:
- platform: generic
name: Front Driveway
still_image_url: ...
Thanks for your quick replies i have made the alteration according , however whilst using File Editor the Red Indicator does not turn Green like it used to do? When I typed it originally the Green tick came up. I am still getting the following errors when I go to Configuration Validation this is the error message.;-
Configuration invalid
Error loading /config/configuration.yaml: while parsing a block mapping
in â/config/configuration.yamlâ, line 3, column 1
expected , but found ââ
in â/config/configuration.yamlâ, line 32, column 3
I have checked them but can not see the problem.
as mentioned before. please post your yaml as code snipte not as screenshot
it seems you have a lot wrong indentation in your config
We neither.
Thanks for you advise can your explain how to send yaml as code snipte please as i donât want to offend anyone in the future. As i am sure to be asking more question.
I may type it all again as i cannot copy and paste with my Mac as I understand that File editor is not compatible, unless there is another way.
Thanks again
Hi deluxestyle
Thanks I see now.
Hi I am having serious problems with my configuration file. it appears to correct Green tick on each line but when I confirm configuration , i receive the following error messages.
`` Logger: homeassistant.components.hassio
Source: components/hassio/init.py:420
Integration: Hass.io (documentation, issues)
First occurred: 7:55:25 AM (1 occurrences)
Last logged: 7:55:25 AM
Invalid config for [switch]: expected a dictionary. Got OrderedDict([(âdefault_configâ, {}), (âttsâ, [âplatform:google_translateâ]), (âgroupâ, {}), (âautomationâ, {}), (âscriptâ, {}), (âmqttâ, {}), (âswitchâ, â-platform:mqtt name:âPondâ state_topic:âtele/pond/stateâ command_topic:âcmnd/Pond/powerâ payload_on:âonâ payload_off:âoffâ availability_topic:âtele/Pond/LWTâ payload_available:âonlineâ payload_not_avaialble:âofflineâ qos:1 retain:falseâ), (âsensorâ, '-platform:mqtt name:âPond Temperatureâ state_topic:âtele/pond/Hass_stateâ value_template:"{{⌠(See ?, line ?). Invalid config for [tts]: expected a dictionary. Got OrderedDict([(âdefault_configâ, {}), (âttsâ, [âplatform:google_translateâ]), (âgroupâ, {}), (âautomationâ, {}), (âscriptâ, {}), (âmqttâ, {}), (âsensorâ, â-platform:mqtt name:âPond Temperatureâ state_topic:âtele/pond/Hass_stateâ value_template:"{{value_json[âDS18B20â].Temperature}}" unit_of_measurement:"*C" availability_topic:âtele/Pond/LWTâ payload_available:âonlineâ payload_not_available:âofflineâ device_class:âtemperatureââ)]). (See /config/configuration.yaml, line 6). Invalid config for [sensor]: expected a dictionary. Got OrderedDict([(âdefault_configâ, {}), (âgroupâ, {}), (âautomationâ, {}), (âscriptâ, {}), (âmqttâ, {âportâ: 1883, âdiscoveryâ: True, âbirth_messageâ: {âtopicâ: âhomeassistant/statusâ, âpayloadâ: âonlineâ, âqosâ: 0, âretainâ: False}, âwill_messageâ: {âtopicâ: âhomeassistant/statusâ, âpayloadâ: âofflineâ, âqosâ: 0, âretainâ: False}, âdiscovery_prefixâ: âhomeassistantâ, âprotocolâ: â3.1.1â, âkeepaliveâ: 60, âtls_versionâ: âautoâ}), (âsensorâ, '-platform:mqtt name:âPond Temperatureâ state_topic:"te⌠(See ?, line ?).
Yaml file
``# 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
mqtt:
switch:
-platform:mqtt
name:âPondâ
state_topic:âtele/pond/stateâ
command_topic:âcmnd/Pond/powerâ
payload_on:âonâ
payload_off:âoffâ
availability_topic:âtele/Pond/LWTâ
payload_available:âonlineâ
payload_not_avaialble:âofflineâ
qos:1
retain:false
sensor:
-platform:mqtt
name:âPond Temperatureâ
state_topic:âtele/pond/Hass_stateâ
value_template:"{{value_json[âDS18B20â].Temperature}}"
unit_of_measurement:"*C"
availability_topic:âtele/Pond/LWTâ
payload_available:âonlineâ
payload_not_available:âofflineâ
device_class:âtemperatureâ
any help would be appreciated a is have been trying to install this switch for a few days now . I think my Yaml config file is corrupt ? Thanks in anticipation.
YOU STILL havenât posted any properly formatted code!!!
And you havenât put a space after the colon to seperate the key and value.
your_key:"your_value"
correct_key: "correct_value"
Typo in available
.
When pasting code into the comment box, simply make sure it has three backtick symbols before and after, like in the screenshot that @deluxestyle posted above.
Thatâs the only way we can reliably check indentation and issues like âsmart quotesâ.
Hi
I have pasted the yaml file as per deluxestyle request below: The file is from visual studio code the majority of the text after the colon is in red ?
# 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
mqtt:
switch:
-platform: mqtt
name: "Pond"
state_topic: "tele/pond/state"
command_topic: "cmnd/Pond/power"
payload_on: "on"
payload_off: "off"
availability_topic: "tele/Pond/LWT"
payload_available: "online"
payload_not_available: "offline"
qos: 1
sensor:
-platform: mqtt
name: "Pond Temperature"
state_topic: "tele/pond/Hass_state"
value_template: "{{value_json['DS18B20'].Temperature}}"
unit_of_measurement: "*C"
availability_topic: "tele/Pond/LWT"
payload_available: "online"
payload_not_available: "offline"
device_class: "temperature"
or paste code here
Apologise if it is not clear but as i said i am a newly and trying to learn If I use Text Editor and place all text after the colon: it is has a tick on everything but i go to configuration i get the error message, i am not not certain where i am going wrong. The log file is the same every time ?
-platform
Should be
- platform
as I said your indentation is wrong. try this
While youâre in the editor:
tts:
- platform:google_translate
Should be
tts:
- platform: google_translate
i have changed the indentation as per deluxstyle and the amendment to line 6 tts , however the configuration is faulty on the sensor even though i have made the changes
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:420
Integration: Hass.io (documentation, issues)
First occurred: 9:37:52 AM (1 occurrences)
Last logged: 9:37:52 AM
Invalid config for [tts]: expected a dictionary. Got OrderedDict([('default_config', {}), ('tts', ['platform:google_translate']), ('group', {}), ('automation', {}), ('script', {}), ('mqtt', {}), ('sensor', [OrderedDict([('platform', 'mqtt'), ('name', 'Pond Temperature'), ('state_topic', 'tele/pond/Hass_state'), ('value_template', "{{value_json['DS18B20'].Temperature}}"), ('unit_of_measurement', '*C'), ('availability_topic', 'tele/Pond/LWT'), ('payload_available', 'online'), ('payload_not_available', 'offline'), ('device_class', 'temperature')]).... (See /config/configuration.yaml, line 6).
# 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
mqtt:
switch:
- platform: 'mqtt'
name: "Pond"
state_topic: "tele/pond/state"
command_topic: "cmnd/Pond/power"
payload_on: "on"
payload_off: "off"
availability_topic: "tele/Pond/LWT"
payload_available: "online"
payload_not_available: "offline"
qos: 1
sensor:
- platform: 'mqtt'
name: "Pond Temperature"
state_topic: "tele/pond/Hass_state"
value_template: "{{value_json['DS18B20'].Temperature}}"
unit_of_measurement: "*C"
availability_topic: "tele/Pond/LWT"
payload_available: "online"
payload_not_available: "offline"
Here is the log file which now only mentions the sensor previously the switch was also mentioned.
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:420
Integration: Hass.io (documentation, issues)
First occurred: 9:37:52 AM (1 occurrences)
Last logged: 9:37:52 AM
Invalid config for [tts]: expected a dictionary. Got OrderedDict([('default_config', {}), ('tts', ['platform:google_translate']), ('group', {}), ('automation', {}), ('script', {}), ('mqtt', {}), ('sensor', [OrderedDict([('platform', 'mqtt'), ('name', 'Pond Temperature'), ('state_topic', 'tele/pond/Hass_state'), ('value_template', "{{value_json['DS18B20'].Temperature}}"), ('unit_of_measurement', '*C'), ('availability_topic', 'tele/Pond/LWT'), ('payload_available', 'online'), ('payload_not_available', 'offline'), ('device_class', 'temperature')]).... (See /config/configuration.yaml, line 6).```
have you changes tts like samnewman86 suggested?