Skip to header Skip to main navigation Skip to main content Skip to footer

Search form

Site branding

Home
What's up, home?

Main navigation

  • Home
  • Story mode
  • About
  • Features
  • Hardware list
  • Videos
  • GitHub (opens in new tab)
  • Daily AI generated stories (opens in new tab)

Part 42: Monitor your iPhone & Apple Watch with Zabbix

Breadcrumbs

Breadcrumb

  • Home
  • Part 42: Monitor your iPhone & Apple Watch with Zabbix

Main page content

By whatsuphome | 5:44 AM EET, Sun March 12, 2023

TL;DR

I connected Home Assistant's iCloud integration to pull location and device data from my iPhone and Apple Watch, then fed it into Zabbix using HTTP items with long-lived access tokens. This lets me visualize and alert on personal device metrics like
Zabbix dashboard

I'm entering a whole new level of monitoring and "What's up, home?" could now also be called "What's up, me?". Recently my colleague did hint me about Home Assistant's HomeKit Controller integration just to get my HomeKit-compatible Netatmo environmental monitoring device to get to return value back to Zabbix without my Siri kludge.  One thing lead to another and now I'm monitoring my iPhone and Apple Watch -- so, practically monitoring myself.

But how to get here?
But how to get to this level? Let's rewind a bit.

 

Home Assistant is a nice home automation software. It is open source and provides many, many integrations for automating your home. I now have my Netatmo comfortable monitored through that ...

Netatmo in Home Assistant
Bye bye, mobile app and my Siri kludge. This screenshot is from Home Assistant.

... but while exploring around Home Assistant's integrations, I came upon it's iCloud integration. Oh boy. This takes my monitoring to a whole new level.

iPhone data on Home Assistant

But how to get this data to Zabbix? 

On Home Assistant, you can go to your account settings and create a Long-lived access token. With that, you then just pass the authorization bearer as part of your HTTP request and you are done. So, like this.

Authorization bearer

 

This way you'll receive your Home Assistant data back in JSON format. As the output is really really really long, and I needed just a relatively small set of data for myself, I cherry-picked those using the above item as the master item, and then creating a bunch of dependent items.

Dependent items

 

... and here's a single item so you get the idea.

JSONPath pre-processing

Let's create some dashboards 

Now that I have my data in Zabbix, it's time to create some dashboards. Fascinating that I can now truly monitor my iPhone and Apple Watch like this.

Zabbix dashboard

I also created a Grafana dashboard.

Grafana dashboard

 

Observations

This has been now running for roughly a day for me. Already some observations:

  • While driving, on traffic lights I tried what happens if I disable the Bluetooth connection between my car and my iDevices. For the rest of the trip my status was reported as Cycling instead of Automotive. Hmm. 
  • Not all the data will be updated in real-time, but there's a significant lag. Also it seems I might need to VPN to my home so the data would be updated sooner while I'm not at home.
  • iPhone's custom focus modes are not updated to Home Assistant. During the sleep focus mode, the focus mode was reported as On, but for any other mode I tried it only shows Off. Shame, I would have loved to start tracking things like how long it takes from me to put our baby to sleep or how much of the time I'm spending with this blog. That has to wait for now.

 

But anyway, this thing just opened a whole new Pandora's box for me to explore. 

 

 

whatsuphome
zabbix
grafana
homeassistant
homekit
apple
iphone
applewatch
  • Add new comment

Comments (1)

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

To the whatsuphome.fi admin,…

Millard Riordan (not verified)

3 years 2 months ago
Permalink
New

To the whatsuphome.fi admin, Thanks for the well-researched and well-written post!

  • Reply
I connected Home Assistant's iCloud integration to pull location and device data from my iPhone and Apple Watch, then fed it into Zabbix using HTTP items with long-lived access tokens. This lets me visualize and alert on personal device metrics like

Search

Who am I?

  • Janne Pikkarainen from Finland 🇫🇮
  • Began with computers in 1986 with C64
  • Doing IT for living since 1999
  • Principal Site Reliability Engineer at Forcepoint
  • A Zabbix Summit speaker every year since 2022
  • Walking, talking Zabbix commercial

Support my project

Buy me a coffee 

Footer menu

  • Contact

What's up, home? | Janne Pikkarainen | contact(at)whatsuphome.fi | 2022 - 2026

Developed and Designed by Janne Pikkarainen