12-22-2021 12:05
12-22-2021 12:05
Hi all,
Very new to the fitbit community so please forgive me if my terminology is complete rubbish!
I am wondering if what I want to do is possible. I have some sleep disorders so I am trying to maximise the sleep time I get. My eventual goal is to trigger an automation in my Home Assistant setup which would turn off the TV and lights when I fall asleep on the couch.
The flow as I see it would be as follows
1) Write a Fitbit studio app to run on the watch which would hook into the sleep events (I have already done the mandatory hello world and it was surprising easy)
2) The watch app should trigger the phone companion (not sure if this is possible) or the phone companion polls the watch for data every x mins
3) Once the phone companion has been notified the event has triggered call a web api to trigger the automation in Home Assistant.
Is this workflow possible? Or if not what parts have I assumed I can do that are not possible.
Thanks loads
12-22-2021 12:09
12-22-2021 12:09
Hi, @Squiggley! Hopefully someone can give you a better answer, but I'm wondering if an alternative might be to do it based on heart rate? Maybe something like heart rate is 5 bpm below resting or something like that. Sounds like a great goal! Good luck with it!
MakMak | Community Council
If you find a response useful, please mark it as a solution to help others.
Check out the Lifestyle Forums for ways to get more active!
12-22-2021 12:14
12-22-2021 12:14
Thanks for the reply @amak
There are already events in the phone api for detecting falling asleep and waking up. I am sure fitbit have a much better idea of what is required to detect if someone has fallen asleep or woken up than I do, so I am quite happy to use their events.
The info I am looking for is more how to communicate that event happening to my home automation system.
Hope this clarifies my question better