I’ve encountered an error in my logs indicating a duplicate key issue: “YAML file /config/configuration.yaml contains duplicate key ‘homeassistant’ at lines 44 and 63.”
Here’s YAML configuration for reference
# Configure a default setup of Home Assistant (frontend, api, etc)
#default_config:#
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
input_number:
ac_temperature:
name: AC Temperature
initial: 64
min: 60
max: 80
step: 1
input_boolean:
ac_virtual_switch:
name: AC Virtual Switch
initial: off
kvm_input_one:
name: KVM Input 1
initial: off
kvm_input_two:
name: KVM Input 2
initial: off
counter:
bedroom_heater_activation_count:
name: Bedroom Heater Activation Count
initial: 0
step: 1
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.19.0.6
- 172.18.0.6
- 172.20.0.7
- 172.20.0.4
- 172.29.0.4
- 172.18.0.7
homeassistant:
external_url: https://hass.secret.com
auth_mfa_modules:
- type: totp
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.1.224
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
automation man: !include automations-man.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
mqtt: !include mqtt.yaml
homeassistant:
country: US
name: Home
unit_system: imperial
customize: !include customize.yaml
cloud: !include cloud.yaml
I thought the solution was straightforward—simply remove one of the duplicate entries. However, after doing so and restarting, the system became unresponsive, forcing me to revert to a backup. Could someone take a look at my YAML file and suggest what I might be overlooking?
I’m getting the same problem as described in the OP. Upon making those changes, when I comback to the frontend it is unresponsive, saying “unable to connect to home assistant” . The only thing that fixes it, is changing the code back to the two instances of homeassistant , and restarting the docker container.
Maybe I didn’t do as you said here is what I currently have after following your suggestions:
# Configure a default setup of Home Assistant (frontend, api, etc)
#default_config:#
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
input_number:
ac_temperature:
name: AC Temperature
initial: 64
min: 60
max: 80
step: 1
input_boolean:
ac_virtual_switch:
name: AC Virtual Switch
initial: off
kvm_input_one:
name: KVM Input 1
initial: off
kvm_input_two:
name: KVM Input 2
initial: off
counter:
bedroom_heater_activation_count:
name: Bedroom Heater Activation Count
initial: 0
step: 1
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.19.0.6
- 172.18.0.6
- 172.20.0.7
- 172.20.0.4
- 172.29.0.4
- 172.18.0.7
homeassistant:
country: US
name: Home
unit_system: imperial
customize: !include customize.yaml
external_url: https://hass.secret.com
auth_mfa_modules:
- type: totp
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.1.224
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
automation man: !include automations-man.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
mqtt: !include mqtt.yaml
cloud: !include cloud.yaml
Try starting with this, then recreate your input_number, input_boolean and counter helpers via the UI. I’ve commented out your external access and MFA for now: add that back in if required once you know the internal setup works.
I followed your guidance and re-enabled default_config in my YAML configuration, which resolved the initial issues I was facing. After ensuring that setup was stable, I proceeded to uncomment and configure the input_number, input_boolean, and counter sections, and I’m pleased to report that they are functioning as expected now.
However, I’ve opted to leave the external access settings in a commented state for now. Interestingly, despite this, I’m still able to remotely access my Home Assistant instance using my external URL