Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping in "/home/homeassistant/.homeassistant/configuration.yaml", line 2, column 1 expected <block end>, but found '<block sequence start>'

default_config:

tts:

  • platform: google_translate

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

duckdns:
domain: casamia
access_token: miotoken

http:
ssl_certificate: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/fullchain.pem
ssl_key: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/privkey.pemsensor

I’m not able to understand and resolve the error line given by home assistant

Can you format your code correctly using the code block button please

# 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

duckdns:
  domain: casamia
  access_token: mytoken

http:
  ssl_certificate: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/fullchain.pem
  ssl_key: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/privkey.pemsensor
 - platform: cert_expiry
   host: casabusato.duckdns.org
   port: 8123
sensor:
  - platform: template
    sensors:      
      certificate_expiry:
        friendly_name: "Scadenza certificato"
        value_template: "{{ (( as_timestamp(states('sensor.cert_expiry_timestamp_casamia_duckdns_org_8123')) | int - as_timestamp(now()) | int ) /60/60/24 ) | int }}"
        unit_of_measurement: "Giorni"
        icon_template: mdi:certificate
spotify:
  client_id: myid
  client_secret: mysecret
api:

alexa:
  smart_home:
hacs:
  token: mytoken

Looks like your missing a space before the - on the line below tts:

The problem is your -platfrom: cert_expiry. That’s not a valid configuration for those fields also, its now configured through the UI.

spacing doesn’t matter as long as all fields are in line below the -. YOu can use 2, 3 1, or zero spaces

This is the full configuration.yaml

Yes as I said, this is wrong and not valid.

The cert expiry section doesn’t belong in http

http:
  ssl_certificate: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/fullchain.pem
  ssl_key: /home/homeassistant/dehydrated/certs/casamia.duckdns.org/privkey.pemsensor
 - platform: cert_expiry
   host: casamia.duckdns.org
   port: 8123

Yes… it’s wrong, remove the cert_expiry lines

1 Like

There’s also sensor wrongly appended to you SSL cert url

I’ve deleted it, but the problem persist

I’m assuming you have something else wrong, post the config again

Paste what you have now

# 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

duckdns:
  domain: casamia
  access_token: 0e97ca68-2a0f-49c6-a69a-427c5abf5d9b

http:
  ssl_certificate: /home/homeassistant/dehydrated/certs/casabusato.duckdns.org/fullchain.pem
  ssl_key: /home/homeassistant/dehydrated/certs/casabusato.duckdns.org/privkey.pemsensor
 
   host: casamia.duckdns.org
   port: 8123
sensor:
  - platform: template
    sensors:      
      certificate_expiry:
        friendly_name: "Scadenza certificato"
        value_template: "{{ (( as_timestamp(states('sensor.cert_expiry_timestamp_casamia_duckdns_org_8123')) | int - as_timestamp(now()) | int ) /60/60/24 ) | int }}"
        unit_of_measurement: "Giorni"
        icon_template: mdi:certificate
spotify:
  client_id: ...
  client_secret: ...
api:

alexa:
  smart_home:
hacs:
  token: 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

You left part of the cirt_expiry configuration there…

as @samnewman86 said, you added extra ‘sensor’ at the end of your pem file

the problem appeared when I’ve opened with visual code the configuration.yaml for the first time, and asked me to correct some code line, as I did, everything just stopped working.
The point is that with this configuration everything worked just fine before

Before it all got changed you mean

You didn’t read the breaking changes. You’re suppossed to switch to the UI for the cert_expiry integration. I feel like a broken record here

1 Like