Binary sensors just stopped working

I have been working on configuration.yaml trying to make something work, adding to the end of it instead of keeping it organized by section, and I discovered that all my binary sensors have stopped working.

Here is the code of one of them.

The first line ("template:) is at line 381 of configuration.yaml

template:
  - binary_sensor:
      - name: 371 1st fl Electric Heat Graph Binary
        state: "{{ is_state_attr('climate.371_meadow_electric_ecobee', 'hvac_action','heating') }}"

My recent changes include adding another:

template:

at line 907 of configuration.yaml

followed by

-sensor:

and further sensor code.

Could adding another instance of “template:” prevent the binary sensors defined after the first instance of “template:” from working?

Thank you.

Yeah, that’s not optional. You can only call out each ‘section’ once.

1 Like

That should only appear once in your configuration and is the cause of your issue.

1 Like

Thank you both.

Is there a recommendation, tip, trick, suggestion for a baby-programmer (which would be a generous label for me) for how to make config changes and keep all these changes together to prevent confusion later when debugging (or just giving up and wanting to revert to a known config?

2 Likes

You can also do a large amount of stuff via th UI now, which while I’m perfectly comfortable with YAML, I find a lot more convenient as well as easier to manage/organize.