homebridge-bme280-piotr
v2.0.1
Published
BME280 temperature/humidity/barometric-pressure sensor accessory for Homebridge, modernised for current hap-nodejs (ES6-class characteristics) and Node 18+. Fork of homebridge-bme280.
Maintainers
Readme
homebridge-bme280-piotr
Bosch BME280 temperature / humidity / barometric-pressure sensor accessory for Homebridge.
This is a modernised fork of homebridge-bme280 (originally by RXSeger /
NorthernMan54). The original plugin (v1.2.6, ~2020) crashed on current Homebridge
with:
TypeError: Class constructor Characteristic cannot be invoked without 'new'because it defined its custom HomeKit characteristics with the pre-ES6
Characteristic.call(this, …) + util.inherits() pattern. Modern
hap-nodejs ships Characteristic
and Service as ES6 classes, which cannot be invoked without new. This fork
rewrites those definitions as proper class … extends Characteristic, preserving
every UUID, format, unit and permission. It also drops the unmaintained Google
Sheets logging dependency for a lighter install. Verified on Node 18+ /
Raspberry Pi running Ubuntu Server 24.04 LTS.
- Reports temperature, humidity and barometric pressure from a BME280 over I²C.
- Supports the Eve app history graphs (via
fakegato-history).
Uses bme280-sensor.
Prerequisites — enable I²C
The BME280 talks over I²C, so the bus must be enabled and the Homebridge user must have access to it.
- Enable the I²C interface and load the kernel module:
On Raspberry Pi OS usesudo apt-get update sudo apt-get install -y i2c-tools sudo modprobe i2c-dev echo i2c-dev | sudo tee -a /etc/modules # load on every bootraspi-config→ Interface Options → I2C. On Ubuntu thei2c-devmodule above is the equivalent step. - Give the Homebridge service user access to the bus:
Restart the Homebridge service (or reboot) for the group change to take effect.sudo usermod -aG i2c homebridge - Confirm the sensor is visible (address is usually
0x76or0x77):sudo i2cdetect -y 1
Installation
- Install Homebridge:
npm install -g homebridge - Install the native build prerequisites (the
i2c-busdependency compiles a native addon):sudo apt-get install -y build-essential python3 - Install this plugin:
sudo npm install -g homebridge-bme280-piotr
Configuration
accessory:"BME280"(unchanged — existing configs keep working)name: descriptive namename_temperature(optional): name for the temperature sensorname_humidity(optional): name for the humidity sensorrefresh(optional): refresh interval in seconds, default 60storage(optional): fakegato history storage,fs(default) orgoogleDriveoptions: options passed to bme280-sensor
Example:
"accessories": [
{
"accessory": "BME280",
"name": "Sensor",
"name_temperature": "Temperature",
"name_humidity": "Humidity",
"options": {
"i2cBusNo": 1,
"i2cAddress": "0x76"
}
}
]If you get an I/O error, check the I²C address (0x76 vs 0x77, jumper-dependent)
and that i2cdetect sees the device.
This plugin creates two services: TemperatureSensor and HumiditySensor (with an Atmospheric Pressure characteristic on the temperature service, as the Eve app expects).
Changes from the original
- Custom characteristics/services rewritten as ES6 classes for current hap-nodejs.
- Removed
mcuiot-logger(Google Sheets logging) andmomentdependencies. enginesraised to Node >= 18, Homebridge >= 1.6; markedlinux-only.- Bumped
i2c-bus/bme280-sensor/fakegato-historyto current ranges.
Credits
- RXSeger — original author and creator
- NorthernMan54 — barometric pressure and device polling
- simont77 — history service (fakegato)
- Modernisation fork maintained by piotranonimowy
License
MIT (unchanged from the original)
