Why do my devices not show in Configuration.yaml?

I have HA setup in a Docker Container on a Raspberry Pi5. I have a few devices connected, one of which being my Risco Cloud alarm system.

I’m just learning at the moment, and understanding how to configure things, but I’m stuggling with manually editing devices, as there is nothing useful in my configuration.yaml, which every internet guide seems to point me towards.

I have a Docker volume mapped to the /config folder in the HA image. I can see the automations.yaml includes all of the automations I have configured, but this is all that shows in configuration.yaml:

Loads default set of integrations. Do not remove.

default_config:

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Is Device config stored somewhere else?

Firstly:

Screenshot 2024-07-15 at 22-35-52 Why do my devices not show in Configuration.yaml - Configuration - Home Assistant Community

Or see point 11 here: How to help us help you - or How to ask a good question

You have default _config in your configuration.yaml. This includes a lot of integrations for you. All these listed here: Default Config - Home Assistant

What device do you want to edit?

1 Like

configuration.yaml is never written to by HA, only read from. “Every internet guide” tends to be out of date: HA is moving more and more towards full UI configuration. Automations, script and scenes are a bit of an outlier in that regard: most “incoming” config is stored in registries and files that you should not be fiddling with.

If your devices are already in HA, there’s rarely any YAML editing needed or possible.

Which devices are you trying to “manually edit” and why?

Also understand the difference between devices and entities. HA mostly runs off entities (such as a binary sensor as to whether your alarm has triggered; or a backup battery voltage sensor), which can be associated with devices.

Thanks for the help guys.

Didn’t spot the </> option, as it was hidden under the cog button.

Thanks, understood about the configuration.yaml. So out of interest, where in the system does it store device information and settings?

Specifically, I was wondering if it was possible to edit a device to ignore specific states. With Risco Cloud, whenever their API is down, I get a “became unavailable” state, which then when it returns triggers one of my automations.

I tried using a “template” to ignore changes from “unavailable”, but that hasn’t worked, but I could have done it wrong. I’m learning!

So I suppose, the question is - can I change devices to only listen/record specific events, so I could ignore the “unavailable” one that is causing automation issues?

Then the second question is, what did I do wrong with my automation?

alias: House Alarm Set
description: ""
trigger:
  - platform: device
    device_id: 68e6403fac93d22f5b7311977bb04dbe
    domain: alarm_control_panel
    entity_id: 49f4065f83bc6ee64822716db015bd2e
    type: armed_away
condition:
  - condition: template
    value_template: "{{ trigger.from_state.state != \"unavailable\" }}"
action:
  - service: media_player.turn_off
    target:
      device_id:
        - 7c1f75ca6cf84c99acfb824bdb23ce9f
    data: {}
  - service: notify.mobile_app_pixel_7
    metadata: {}
    data:
      title: Alarm notifications
      message: House Alarm Set
  - service: media_player.turn_off
    metadata: {}
    data: {}
    target:
      device_id: 42508317134a016cd0eac8a22ded5777
mode: single

States of discovered and UI created devices are not user editable. And you dont need to anyway. You just need to adjust your trigger.

trigger:
  - platform: state
    entity_id: 49f4065f83bc6ee64822716db015bd2e # change this to the actual entity id
    to: 'armed_away'
    not_from: 
      - unknown
      - unavailable

Have a read of this: Why and how to avoid device_ids in automations and scripts

Also remove this condition:

condition:
  - condition: template
    value_template: "{{ trigger.from_state.state != \"unavailable\" }}"

It is now unneeded and is actually invalid. See how all the text in your post is red after it?

That is becasue your two double quotes match here:

value_template: "{{ trigger.from_state.state != \"

You need to use single quotes inside double quotes:

condition:
  - condition: template
    value_template: "{{ trigger.from_state.state != 'unavailable' }}"
2 Likes

Sorry I meant to mention that it might be there if you are on a mobile device.

3 Likes

Brilliant, thank you! That’s great advice, I’ll have a read and give that a try!

Another question, not related to scripting…

How do you backup and restore configuration?
I have the config folder backed up, but if none of the devices configs are stored in there, copying this back into a fresh instance wouldn’t reinstate my current devices surely?

The files that store the info referred to are stored in hidden subfolders under /config.

Therefore backup / restore for core or container is a complete copy of config and all its subfolders including the hidden ones…

1 Like

Hadn’t spotted the hidden files and folders! Thanks!