Skip to content

Feature Request: Support for I2C sensors (temperature, humidity, current, SCT-013 power) #871

@jtronics

Description

@jtronics

Hi @IgorYbema,
I have been running a customized version of HeishaMon with integrated I2C sensor support for the past two months.
The feature has been working flawlessly and stable in my environment.
It was hard to implement the powermeter via the ads1115 as non blocking code, but now it's working fine.

Since adding external sensors via I2C is a great way to extend HeishaMon's capabilities (e.g., for additional ambient temperature or humidity tracking), I would love to contribute this code back to the main project so others can benefit from it as well.

I am not very experienced with the formal Pull Request process, but I have the working code.
Would you be interested in merging this feature?

Added Sensors:

  • BME280 (Addr: 0x76): Pressure, Temperature, Humidity, Altitude
  • BH1750 (Addr: 0x23): Light intensity (Lux), Humidity
  • ADS1115 (Addr: 0x48 & 0x49): Reading 4x SCT-013 power sensors in differential mode, none blocking
  • INA219 (Addr: 0x40): Reading a 4-20mA current loop (e.g., for water level sensors)

I am also working on an mbus master feature, to read out an energy-meter to calculate the real cop, but at first, the i2c sensors!

Best regards
Martin

src_i2c.zip

lib_deps =
adafruit/Adafruit BME280 Library ;@^2.3.0
adafruit/Adafruit SHT4x Library @ ^1.0.5
wollewald/ADS1115_WE @ ^1.5.0
wollewald/INA219_WE@^1.4.1

adding the following to the main
i2cInit(log_message);
i2cLoop(mqtt_client, log_message, heishamonSettings.mqtt_topic_base);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions