A good way to periodically check your HomeKit status / values?

Cupertino, March 28, 2020

Anyone have a good way to periodically record HomeKit sensor values? In particular, for those where the seller does not provide logs through their application? Ex: I have aqara temperature sensors that I would like to log in, say, every 4 hours.

Homebridge is an option, but I'd rather not create an ecosystem just for that.

After analyzing and testing what is native available in HomeKit / etc, I came up with a few options that will work for any sensor / status value that is available for shortcuts:

** Option 1: Quick automation switch ** running on an iPhone / iPad that stays home. Via shortcut:

* get the sensors reading through "Get the status of my house"
* Combine text to get all the sensors in one text.
* save to file

Problems:

* the device must remain local
* You must write the same automation n times to run n times a day. And keep those n kids.

** Option 2: Automation shortcut. ** There are only two ways in which I can obtain data from the walls of an automation:

1. Run the script through ssh. It doesn't work for me. It works fine as a test (because it runs on iphone / ipad), but it seems that no one has managed to do this as a home automation on a home hub (it runs from AppleTv / HomePod). So it's not an option unless Apple does something about it.
2. Get the content of the URL (as HTTP POST).

So, I set up web service on a Mac with a very simple PHP script that saves POST data to a file.

We then set up a LaunchAgent to monitor file changes. When modified, it runs a script that reads the new data and adds it to the log file. I probably could have added this to the PHP script (?), But I'm more familiar with shell / python / etc than PHP.

I'd be interested to hear if anyone is using Get URL Content to write something that works really well ... doing what I'm doing I finished the job, but it's pretty weak. There must be a better way!

For example, POST to a Google document. I think there is a way to use a google script to get the data and add it to a sheet.

Finally, I set up Home Automation at midnight, then used a party-like application (Eve / Controller for HomeKit) to add more triggers for every 4 hours.

So a single automation must be maintained (eg adding another sensor) and running on the home hub.

edit: formatting

Best selling & Top trending HomeKit product in our shop at this moment

HomeKit.Blog is in no way affiliated with or endorsed by Apple Inc. or Apple related subsidiaries.

All images, videos and logos are the copyright of the respective rights holders, and this website does not claim ownership or copyright of the aforementioned.

All information about products mentioned on this site has been collected in good faith. However, the information relating to them, may not be 100% accurate, as we only rely on the information we are able to gather from the companies themselves or the resellers who stock these products, and therefore cannot be held responsible for any inaccuracies arising from the aforementioned sources, or any subsequent changes that are made that we have not been made aware of.

HomeKit.Blog Is A Participant In The Amazon Services LLC Associates Program, An Affiliate Advertising Program Designed To Provide A Means For Sites To Earn Advertising Fees By Advertising And Linking To Amazon Store (Amazon.com, Or Endless.com, MYHABIT.com, SmallParts.com, Or AmazonWireless.com).

The opinions expressed on this website by our contributors do not necessarily represent the views of the website owners. 

Copyright © 2022 HomeKit Blog
. All rights reserved
United States