Lifestyle Counters
Want to keep track of things in your life but in an automated way? Today we will look at the Automation for Home Assistant Counters that logs your daily, weekly, monthly and yearly coffee intake. With years I am getting more conscious of my health so limiting caffeine intake may not be a bad idea. You can of course adapt this to any other quantifiable activities in your life.
YAML:
Template (Sum)
*** Add single angled bracket before/after each % symbol *** Add double angled brackets around the last "weekly_coffee" in the string (before 'target:') service: counter.set_value data: value: %- set weekly_coffee = states('counter.coffee_weekly') | int(default=0) % %- set weekly_coffee = weekly_coffee + states('counter.coffee_daily') | int(default=0) % weekly_coffee target: entity_id: counter.coffee_weekly
Template (Notification):
{{states('counter.coffee_daily')}}
Template (Day of the month):
{{ now().day == 30 }}
SUBSCRIBE today!
https://www.youtube.com/@brenvelm