jenswilly.dk


Archive for June, 2019

Blue Maestro sensor, openHAB and HomeKit

28. June 2019 21:27 by Jens Willy Johannsen
Categories: BLE | Home Automation

Since I’m already working on a device for showing the temperature reported from a Bluetooth sensor (read more) and I’ve also been doing some home automation stuff using openHAB, I thought it ought to be possible to get the openHAB server to report the temperature as well. It is. This is how it works:

  1. The BLE device reports the current temperature in BLE advertisement packages.
  2. The Raspberry Pi server runs a Python script as a service that performs BLE scanning and looks at the advertisement packages, identifying and parsing packages from the BLE device.
  3. Whenever a matching BLE advertisement package is found, the current temperature is extracted (along with humidity and dewpoint) and posted to an MQTT server.
  4. The openHAB server running on the same Raspberry Pi uses the MQTT Binding to connect to the MQTT server and things and items are configured to subscribe to the appropriate topics and expose the temperature and timestamp.
  5. The openHAB server also uses the HomeKit Add-on to publish the temperature as a HomeKit compatible temperature sensor so it's available on all my iOS/watchOS/macOS devices.

Awesome. But there were several steps along the path. Read on for the details and code...

Read the entire post »
No comments No comments »