Feature Suggest: Customizeable Pins (e.g. for BME280)

first of all, thanks for these brilliant piece of gatway :slight_smile:
I really love it and currently i’m using 3 devices with openmqttgateway in my setup.
1 NodeMCU with RF and BME280 and two ESP01 with BME280.

With the ESP01 i’ve struggles accross the problem, that the IO Pins needs to be changed… Maybe you can merge my changes into git to support some more boards “out-of-the-box”

Here is my changed prod_env.ini

default_envs = esp01_1m-OpenMediaGateway

lib_deps =
build_flags =

platform = ${com.esp8266_platform}
board = esp01_1m
lib_deps =
build_flags =

further i changed ZsensorBME280.ino and added at line 103

#ifdef I2CPIN1
#ifdef I2CPIN2
Serial.println(“Change I2C Pins”);
Wire.begin(I2CPIN1, I2CPIN2);

Last change is in config_bme280.h

//If you need custom I2C Pins for BME280 you can change it here
//#define I2CPIN1 0
//#define I2CPIN2 2

By the way, i use FHEM as automation software and the openmediagateways reports here. Some days ago i talked about a feature with some guys there in the FHEM forum and he didn’t know OMGW before but he is responsible for the mqtt2 implementation for FHEM and he really loves OMGW and in future there hopefully will be a native support for OMGW in FHEM with predifined Templates. So everyone can easily connect OMGW-Sensors to FHEM…

1 Like


Thanks for the idea, in the future I will include more possible definitions into PIO file.

Nice, don’t hesitate if you or he has questions. I will be happy to answer.

It work. Good idea @Dattel01. I have created a pull request with your code.