Hello, I am trying to create an automation that tracks my time at the gym on a Google Calendar. I have the calendar integration set up and have been able to create events where the start time and end time are more static but this automation is not working for me.
The idea is that it starts when I arrive at the gym, waits till I leave, ensures that it was more than 5 mins (the gym is at a shopping center I drive by there often and that unfortunately doesn’t count as a workout) and then is supposed to create a calendar event with the start time being when I arrived and the end time being when I left. For some reason it’s not working. Here’s the YAML:
alias: Gym Tracker
description: >-
Track time spent at the gym and create a calendar event if more than 5
minutes.
trigger:
platform: zone
entity_id: person.john
zone: zone.gym
event: enter
action:
I also want one that tracks my sleep. I use a CPAP and it’s plugged into a smart plug with power monitoring. I’m assuming I can use the same logic for this automation, but I wanted to ask here if there is a better approach since I’m not really sure if it’s a bad thing to have that automation technically “running” the entire time I’m asleep, waiting for the power demand to drop to log my wake up.
Not exactly sure what starting time you’re after but my guess is it may be in trigger.from_state. Post the entire trace and help me understand what you mean by start time.