Code issue in config.yaml please help

Hi all.

I keep getting snippets of information from people and learning as I go but this home assistant lark is a f*** nightmare. How on earth do people learn all this coding? How much indentation, which values to use, to use a dash or not to use a dash. I really want to be able to do all this myself but I feel like I’m treading water and just guessing at stuff.

So much documentation is written in a way that you have to know what it is talking about in the first place.

I am trying to add something to my config.yaml so I can use my Flic switches but I cannot get into the yaml correctly and I have no idea why. Someone told me that I can only have 1 template section and 1 sensor section but my point above, I have no idea what that means. I cannot see ‘sections’ within here.

I have pasted pictures of my current config yaml along with the new code to go at the bottom. Please can someone help me with this and let me know what I need to change and also why it needs changing so I learn.


Please don’t post pictures of yaml. Do you really think we are going to retype everything to find your problem ?

Sorry, I posted pictures so you can see the errors in red. If I copy and paste the code, it does not include that.

I have pasted the code below

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
device_tracker:
  - platform: ping
    hosts:
      caj: 192.10000
      dooz: 192.1000
      finlayb: 192.10000
shell_command:
# Washing machine
  washer_start: 'curl --location --request POST ''https://api.smartthings.com/v1/devices/dfe8dba1-fe99-9897-c896-000000/commands'' --header ''Authorization: Bearer 0000-0445-4d37-afad-32114cbd9501'' --header ''Content-Type: text/plain'' --data-raw ''[    {   "capability":"washerOperatingState",        "command":"setMachineState",        "arguments":["run"]    }]'''
  washer_pause: 'curl --location --request POST ''https://api.smartthings.com/v1/devices/dfe8dba1-fe99-9897-000-0000/commands'' --header ''Authorization: Bearer 8e3df9de-0445-4d37-afad-00000'' --header ''Content-Type: text/plain'' --data-raw ''[    {   "capability":"washerOperatingState",        "command":"setMachineState",        "arguments":["pause"]    }}'''
  washer_stop: 'curl --location --request POST ''https://api.smartthings.com/v1/devices/00000-fe99-9897-0000-000/commands'' --header ''Authorization: Bearer 8e3df9de-0445-4d37-afad-0000'' --header ''Content-Type: text/plain'' --data-raw ''[    {   "capability":"washerOperatingState",        "command":"setMachineState",        "arguments":["stop"]    }]'''

template: !include_dir_merge_list templates/

sensor:
  - platform: foxess
    name: FoxESS1
    username: 00
    password: 00
    deviceID: 59e48e7c-95ff-47c8-ae4a-0000000
  - platform: foxess
    name: FoxESS2
    username: 00
    password: 00
    deviceID: b9d1760b-6869-4027-a241-000000
template:
  - trigger:
      - platform: webhook
        webhook_id: [newflicserver]-[flic1]

    binary_sensor:
      - unique_id: "[flic1]_button"
        name: "[flic1] Button"
        state: "on"
        auto_off: 0.1
        attributes:
          click_type: "{{ trigger.json.click_type }}"
          battery: "{{ trigger.json.battery_status }}"


can’t be used together with

you either put the last one in a separate .yaml in your templates dir, or you remove the templates include

By reading the documentation and watching YouTube tutorials.

Give yourself a break. Like everything worthwhile and rewarding it takes time. Don’t expect to know everything instantly.