Archive for June, 2019

Blue Maestro sensor, openHAB or Home Assistant 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 and Home Assistant, 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.

For openHAB:

  1. 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.
  2. 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.

For Home Assistant:

  1. The Home Assistant running on another Raspberry Pi using uses an MQTT connection to expose the values as sensor readings.
  2. … and also uses the HomeKit integration to publish the temperature to Apple HomeKit. Which works perfectly out of the box.

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

Read the entire post »
Comments 8 comments »