"Time Since Last Shower" tracking

https://lemmy.world/post/44638534

Would you be able to share your code? I have the same problem possibly due to undiagnosed ADHD instead. I’ve been basically guilt tripping myself (or a parent has) to motivate myself to shower my whole life. Thanks for posting this, it seems like a way more fun way where I can be nerdy about it and still be a functional human being.

Here is my Automation:

alias: Update Last Shower Time description: "" triggers: - entity_id: binary_sensor.showering from: "on" to: "off" trigger: state actions: - data: datetime: "{{ now() }}" action: input_datetime.set_datetime target: entity_id: input_datetime.last_shower

You also need to create an ‘Input DateTime’ helper called “Last Shower” This is where the last shower time will be stored (and can be changed)

Make these too:

Template Binary Sensor called “Showering”:

{{ (states(‘sensor.bathroom_sensor_humidity’)|float - states(‘sensor.average_bathroom_humidity’)|float) > 9 }}

Template Sensor called “Time Since Last Shower”:

% set diff = now() - as_datetime(states('input_datetime.last_shower')).astimezone() %} {% set days = diff.days %} {% set hours = (diff.seconds // 3600) %} {% if days > 0 %} {{ days }} day{{ 's' if days > 1 }} {{ hours }} hour{{ 's' if hours != 1 }} {% else %} {{ hours }} hour{{ 's' if hours != 1 }} {% endif %}

Let me know if you hit any snags!

I just got tested myself so I might be in the same boat! Waiting to get the results