LOL, i know its silly but I live in a house with two of my mates and some of them tend to take too long doing their business.
I’d like a routine to TTS announce the total time spent in the bathroom but I dont know how. I understand there is a built in counter function but not sure how to propely use it or if it’s even the right way to tackle this.
If you have a motion sensor/door sensor in the bathroom then you can set up an automation. Say for example the automation would repeat until motion is off and increment a counter entity every second. After motion is off, then do a service call to tts. You can also reset the counter before or after the counting starts/stops
You need to look into room occupancy approaches which isn’t so straight forward.
Motion detectors are pretty good at detecting entry but not tracking occupancy.
What do you suspect is the process which is time consuming? Is it the shower or the can or the mirror etc? Might be able to localise around that a bit…
I have a magnet sensor on the door, i figured it would be used to track the time spent inside as the door will always be open/closed during the occupancy. The biggest issue for me is that i dont know how to use the counter properly along with having that counted time announced in minutes.
I read the entire thread but never managed to figure out how to bend the code to fit my needs. I’ve tried to search for something similar myself without any luck.
Im surprised this isnt a common question, id also like to learn how this works to announce my total time spent in bed after ive initiated my “bedtime” routine when i run my “good morning” routine.
Then there are probably a few ways you can tackle it. Not sure if my way is the best way, but you can have a go.
You could create a blank automation like this which is triggered when the door is closed
- id: '1756'
alias: Door was just closed
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d0001bf8643
from: 'off'
to: 'on'
action:
#Do nothing
Then you should be able to access the time since it was triggered like this in a template sensor.
Assuming a 2-code door sensor…
A simple automation that triggers on door close, and waits for the door to open. If it doesn’t open it sounds a buzzer. Variations on this are endless.
Nothing to do with a blueprint at all, however, so not quite the right topic to get good answers.
The closest thing I know of would be adapting my blueprint, it sorta does that, with a bit of tweaking…