Changes

1,779 bytes added ,  09:51, 15 June 2023
no edit summary
Line 4: Line 4:     
== Background ==
 
== Background ==
I've been trying to quit smoking on and off, with temporary but ultimately limited success. I thought having some more qualitative data on how much smoke might help me to a) identify the extend of my smoking habit and potentially also find some triggers/situations in which I smoke and b) ultimately figure out a way to deliver feedback to help me stop. This project was partially inspired by a reddit post regarding using [[Flic button|Flic buttons]] as a [[One Button Tracker|one-button tracker]].  
+
I've been trying to quit smoking on and off, with temporary but ultimately limited success. I thought having some more qualitative data on how much smoke might help me to a) identify the extend of my smoking habit and potentially also find some triggers/situations in which I smoke and b) ultimately figure out a way to deliver feedback to help me stop. This project was partially inspired by a reddit post regarding using [[Flic button|Flic buttons]] as a [[One Button Tracker|one-button tracker]]<ref>https://www.reddit.com/r/QuantifiedSelf/comments/vu74jo/comment/ifc9eul/?utm_source=share&utm_medium=web2x&context=3</ref>.  
    
== Initial setup, protocol and baseline collection ==
 
== Initial setup, protocol and baseline collection ==
 
[[File:Flic-spreadsheet-setup.png|thumb|The Google Sheet into which data is written automatically. Geolocation for the first data points is empty as location permissions weren't set correctly.]]
 
[[File:Flic-spreadsheet-setup.png|thumb|The Google Sheet into which data is written automatically. Geolocation for the first data points is empty as location permissions weren't set correctly.]]
Before starting on any interventions or even providing feedback, I wanted to collect some baseline data on how much I smoke and when. For this I connected my Flic button to my phone and set it up to trigger an IFTTT trigger every time the button was pressed. IFTTT in turn would write the button presses into a Google Sheet to collect the data. In total I decided to collect 3 types of data:  
+
Before starting on any interventions or even providing feedback, I wanted to collect some baseline data on how much I smoke and when. For this I connected my Flic button to my phone and set it up to trigger an IFTTT<ref>https://ifttt.com/</ref> trigger every time the button was pressed. IFTTT in turn would write the button presses into a Google Sheet to collect the data. In total I decided to collect 3 types of data:  
    
# Type of click, the Flic supports regular clicks, double clicks as well as recording holding the button
 
# Type of click, the Flic supports regular clicks, double clicks as well as recording holding the button
Line 44: Line 44:  
As a result, every time I double click the Flic button, the value in cell N3 automatically increments upwards for a given day, before jumping back to zero at midnight. With this automated counting in the Google Sheet in place I then added a monitoring of this particular cell (N3) to IFTTT, and every change in the cell's value will trigger a notification on my phone/watch through the IFTTT app that informs me about today's counter status. IFTTT does not monitor the data in real-time, but rather every 5 minutes, which seems timely enough for now.  
 
As a result, every time I double click the Flic button, the value in cell N3 automatically increments upwards for a given day, before jumping back to zero at midnight. With this automated counting in the Google Sheet in place I then added a monitoring of this particular cell (N3) to IFTTT, and every change in the cell's value will trigger a notification on my phone/watch through the IFTTT app that informs me about today's counter status. IFTTT does not monitor the data in real-time, but rather every 5 minutes, which seems timely enough for now.  
   −
In a few weeks it will then be time to check the the data and compare it to the baseline to see if the intervention made any difference.
+
In a few weeks it will then be time to check the the data and compare it to the baseline to see if the intervention made any difference.  
 +
 
 +
=== Fixing the feedback mechanism ===
 +
'''Update 2022-08-17''': Unfortunately the regular monitoring that IFTTT provides for Google Sheets seems not to work reliably, leading to notifications rarely being sent. My workaround for this was to slightly change my IFTTT setup using the "webhooks" integration: 
 +
 
 +
# I expanded the IFTTT action that is taken when clicking the Flic button is pressed. After writing the data to the Google Sheet it now also uses the webhook integration to send a web-request to IFTTT itself. This webhook can than be used to trigger a second action
 +
# The second IFTTT action listens for activity on the webhook that fired in step 1. When triggered it manually requests the current value of the cell in the Google Sheet as outlined above and then delivers the value as a rich notification to my phone/watch. 
 +
 
 +
This approach is pretty rigged together, but so far seems to work reliable and didn't require any programming.
 +
 
 +
== Project update - July 2023 ==
 +
[[File:Respiratory rate time.png|thumb|Respiratory rate change while smoking and after stopping to smoke.]]
 +
This project has stopped because of an amazing reason, as I stopped smoking: After switching to vaping for a few months in November 2022, I totally stopped smoking/vaping in February 2023. But there's some alternative, interesting data following this change: Looking at my respiratory rate as measured by the [[Oura Ring|Oura ring]], it seems that post-smoking my respiratory rate dropped an average of 2 breaths/min, which is super encouraging!
 +
 
 +
== References ==
 +
<references />
 +
 
 +
[[Category:Projects]][[Category:Habits projects]]