Yaml errors with two sensor: sections

I’m using the systemmonitor sensor and the aarlo sensor in the configuration.yaml. This is erroring on multiple sensor elements on line x and y. So, I’m trying to split out either Aarlo or the system monitor.

I’ve tried creating a aarlo.yaml and pointing to it in the configuration.yaml but got nothing but errors.

Tried creating a sensors: !include sensors.yaml and put the systemmonitor sensor code in it. This errors with “Component error: sensors - Integration ‘sensors’ not found.”

Is there a better way to do this, or can someone tell me what I’m doing wrong? I would paste the aarlo or the systemmonitor snippets in here, but they’re kinda large. So, I’m simply using the items from these links in the configuration.yaml

aarlo sections are arlo: camera: binary_sensor: sensor:

systemmonitor sections is just the sensor:

Thoughts?

The configuration.yaml file should have one sensor: section where you define your aarlo and system monitor sensors. Something like this:

sensor:
  - platform: systemmonitor
    resources:
      - type: memory_free
      - type: memory_use_percent
      - type: processor_use

  - platform: aarlo
    monitored_conditions:
      - total_cameras
      - last_capture
      - recent_activity
      - captured_today
      - battery_level
      - signal_strength
      - temperature
      - humidity
      - air_quality

If you choose to do this:

sensor: !include sensors.yaml

then you are instructing Home Assistant to look for all sensor definitions in a separate file called sensors.yaml.

Well, don’t I look dumb, lol.

To keep the configuration.yaml clean, would it be better to put both Aarlo and System sensors in the sensors.yaml?

See also the docs on that and the docs on splitting your config.

I personally go with one file per sensor, and use a merge:

switch: !include_dir_merge_list switch/

That also means that when you’ve made edits and broken something, it’s much easier to find/remember what you edited :smiley:

You have choices in how to organize your sensor configurations. Tinkerer provided yet another example representing the extreme opposite end of the organizational spectrum: not one file for all sensors but one file per sensor. The key is to adhere to whichever one you choose; pick a way of storing them and then stick with it.

FWIW, I have all my sensors in a single sensors.yaml file. However, I plan to break that up into multiple files, organized by the sensor’s purpose, within a sub-directory (similar to Tinkerer’s suggestion).

1 Like