Wildcard History_Stats

Hi All,

Is it possible to wildcard create history_stats entities for all input_boolean entities types? I’d like to create the below entity for a group of 12 input_booleans entities that I have.

- platform: history_stats
  name: Morning Routine History
  entity_id: input_boolean.habit_morningroutine
  state: 'on'
  start: '{{ 0 }}'
  end: '{{ now() }}'

Thanks!

No that is not possible.

You can create a group helper containing your input booleans and use that group in the history stats sensor, but as you have not explained what you are trying to accomplish this may or may not fit your needs.

Thanks @tom_l , it’s a habit tracker and I wanted to track completion rates of each habit.

Then you will need to create 5 separate history stats sensors.

Note also that this:

  start: '{{ 0 }}'
  end: '{{ now() }}'

Willl only go back as far as your recorder purge keep days setting (10 days by default).

Also would a type: count suit this better?

Thanks, makes sense @tom_l . Yes you are right, type: count is missing.