Commit 2e049c6d authored by Nick Busey's avatar Nick Busey

#16 Adding automated apple health import

parent 0a1cb23c
# 0.3
* Added Automated Apple Health Import
# 0.2
* Added Dasher / Amazon Dash Button support
......
# Automated Apple Health Import
HomelabOS supports automatically (kind of) importing of your data from Apple Health.
The non-automatic part is you have to manually create an Export from the Health app on your phone.
Once you upload your export to your [NextCloud](/sofware/nextcloud/) instance, the Apple Health cron task will pick it up within the next hour, and put all the data into [InfluxDB](/software/influxdb). Now you can create nice dashboards in [Grafana](/software/grafana/) to visualize and inspect your Health data.
## Configuring
You need to set the NextCloud username that you want to import Health Data from in your `host_vars/myserver` file. This value defaults to `admin` the default username created at startup by NextCloud.
## Exporting
Make sure you have NextCloud configured on your Apple device. On your Apple device open the `Health` app. Click the `Today` tab, then click the profile icon in the top right of the screen. Now click `Export Health Data`. Once the export completes, save it to NextCloud. Click `Upload` with the default settings. It should save to your `Files` folder with the name `export.zip`.
Now in under an hour you should be able to see your data in Influx via Grafana.
## Debugging
You can always open up [Portainer](/software/portainer/) and view the Logs of the `homelabos_apple_health_influx_1` container to see if things are working or not.
## Access
There is no direct access to this service, you can visualize the data through Grafana.
\ No newline at end of file
......@@ -58,3 +58,6 @@ s3_backup_cron: 0 4 * * *
# Home Assitant API Key
homeassistant_api_key:
# Apple Health Data Importer - Docs: https://nickbusey.gitlab.io/HomelabOS/software/applehealth/
apple_health_nextcloud_username: admin
\ No newline at end of file
......@@ -15,6 +15,7 @@ pages:
- Getting Started: setup/gettingstarted.md
- Backups: setup/backups.md
- Included Software:
- Apple Health: software/applehealth.md
- Convos: software/convos.md
- Darksky: software/darksky.md
- Dasher: software/dasher.md
......
......@@ -5,10 +5,11 @@
state: directory
loop:
- /var/homelabos
- /var/homelabos/telegraf
- /var/homelabos/traefik
- /var/homelabos/apple_health_influx
- /var/homelabos/dasher
- /var/homelabos/docker
- /var/homelabos/telegraf
- /var/homelabos/traefik
- /mnt/nas
- name: Configure Telegraf.
......@@ -20,7 +21,10 @@
- name: Configure Dasher
template: src=dasher.config.json dest=/var/homelabos/dasher/config.json
- name: Configure NAS
- name: Configure Apple Health Importer
template: src=apple_health_config.yml dest=/var/homelabos/apple_health_influx/config.yml
- name: Configure NAS
lineinfile:
path: /etc/fstab
line: '{{ nas_path }} /mnt/nas cifs username={{ nas_user }},vers=2.0,dom={{ nas_workgroup }},password={{ nas_pass }},uid=1000,iocharset=utf8 0 0'
......
influxdb:
client:
host: influxdb
database: health
write_points:
batch_size: 1000
......@@ -4,6 +4,12 @@ version: '3'
services:
apple_health_influx:
image: nickbusey/healthdata_influx:cron
volumes:
- /var/homelabos/nextcloud/data/{{ apple_health_nextcloud_username }}/files/export.zip:/export.zip
- /var/homelabos/apple_health_influx/config.yml:/config.yml
# bitwarden_mssql:
# image: bitwarden/mssql:1.16.0
# container_name: bitwarden-mssql
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment