Template that can create counter, template sensor and automation

Hey guys, I made a custom medication tracker and now I’m trying to find the easiest way to modify it when needed.
Tracker is using automation, template sensor and counter for each medication. So If my medication schedule change, I have to modify 3 files: automation.yaml contains automation, configuration.yaml contains sensor and counter contains counter of course.
I was looking at blueprints, but If I understood that correctly, they can be used as template for automation or scripts only? Is there any solution like blueprint that can create a counter and template sensor on top of automation?

I have 2-3 approaches (different schedule: once a day at specific time, twice a day or every X days) for different medication, but this is the basic one:


- id: folacin_reminder
  alias: folacin reminder
  description: ''
    path: tride/medication_reminder.yaml
      reminder_time: '16:00:00'
      notify_device: 1837906933bf358948d496191c617080
      input_boolean: input_boolean.pills
      notification_title: Folacin
- id: folacin_decrement
  alias: folacin decrement
  description: ''
  - platform: time
    at: '16:00:00'
  condition: []
  - service: counter.decrement
    data: {}
      entity_id: counter.folacin
  mode: single


  - sensor:
      - name: "pill_folacin"
        state: "{{ states('counter.folacin') | round(0) }}"
          usage: "{{ 1 }}"
          pill: "Folacin"
          days: "{{ (states('counter.folacin') | float / state_attr('sensor.pill_folacin', 'usage')) | round(0, 'floor') }}"
          last: "{{ (as_timestamp(states.counter.folacin.last_changed + timedelta(days = state_attr('sensor.pill_folacin', 'days')))) | timestamp_custom('%A, %d.%m.') }}" 

Well, one thing you can do is put them all in a single package file. You can read about that, here.

Thank you mate, you opened my eyes.
I can have all my code in one yaml it seems. Im still researching, but it looks promissing.
HA is awesome

pop back here if you have any questions on creatingt/using a package file :slight_smile: