Tracking BMs with Home Assistant AKA Poop Button
I love Home Assistant, I could play with it all day long. I have dashboards for tracking batteries in different devices, air quality in the house, weather, even network performance. Everything but me. I worked in a nursing home for 13 years and I know how EMRs work. I could add a helper to track my last BM, and build from that alerts and visual reminders so I know how long it has been. Thus, the 'Poop Button' was born.
I started out by adding a helper named LastBM that would keep the date and time of the last time I went number '2'. I manually entered a time for now for testing, but I would eventually need a better way to enter this.
I went back and forth on how I wanted this to be presented, but I decided to create a whole new dashboard with a single view.
I used the mdi:hospital-box icon and made it look like it's official or something.
Then I added a big button with a tiny poo icon in the middle.
I used a Mushroom Template Card with the mdi:emoticon-poop icon.
I added {{ time_since(as_datetime(states('input_datetime.lastbm')), 1) }} to get the time of the last poo under the icon. time_since is a great dynamic function because it will read out the specificity you want based on that last variable you entered. I put in that ',1' because I want 1 degree of specificity. In other words, I don't need to know the minutes if it has been hours, or hours if it has been days. As you can see here, it has been days and I am in pain, yay! Maybe I should add a reminder to take some Dulcolax or something.
To change the color of the poo emoticon I used this code in the mushroom card color section,
{% set last_updated = as_timestamp(states('input_datetime.lastbm')) %}
{% set days_ago = seconds_ago / 86400 %}
{% if days_ago < 1 %}
green
{% elif days_ago < 2 %}
yellow
{% elif days_ago < 3 %}
orange
{% else %}
red
Then adding the actions is as easy as entering 'Send notifications to your device' and entering the message 'No BM in 24 hours', etc, and matching the trigger IDs. In case you didn't know, the HA geniuses created this action so you create one automation to handle multiple scenarios and not have to create separate automations for each one. I also use it for presence detection. In one automation you can have a light turn on if presence is detected, and turn back off if that presence is cleared.

