An M-bus master that poll a meter and logs data to an MQTT server
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Config.cpp Debug statements for loading stored configuration May 2, 2016
Config.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MBus.cpp Documented sample M-bus response May 2, 2016
MBus.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MqttLogger.aps Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MqttLogger.ino Implemented MBus functions. Working with sample MBus response now May 2, 2016
MqttLogger.rc Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MqttLogger.sln Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MqttLogger.vcxproj Implemented MBus functions. Working with sample MBus response now May 2, 2016
MqttLogger.vcxproj.filters Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
MqttLogger.vcxproj.user Implemented MBus functions. Working with sample MBus response now May 2, 2016
PulsePort.cpp Changed to use Serial1 for debugging May 2, 2016
PulsePort.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
README.md Added ReadMe file Apr 29, 2016
RealTimeClock.cpp Changed to use Serial1 for debugging May 2, 2016
RealTimeClock.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
Telegram.cpp Using Serial1 for debugging May 2, 2016
Telegram.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
UserData.cpp Implemented toUnixTime. Removed DateValue, and returning time_t from … May 2, 2016
UserData.h Changed date-functions to return time_t May 2, 2016
WebConfig.cpp Changed to use Serial1 for debugging May 2, 2016
WebConfig.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016
resource.h Initial project. Made as a copy of an existing meter system, reading … Apr 29, 2016

README.md

MBusMqttLogger

This project is using an arduino (really, an ESP8266) to read and log data from two different meters:

Electrical meter: This one is measuring electrical energy consumed by my heat pump system. The meter is a simple thing that has an open collector output, giving one pulse for every Wh that has been consumed. A class has been created, PulsePort, to facilitate IRQ-based reading, and to keep track of the current value.

Heat Pump meter: This one is a Zenner C5 meter, providing data over an M-Bus interface (Meter Bus). A minimal implementation of the M-bus protocol has been implemented in the class MBus.

Featuring:

  • Boots as AP/web server for configuration (if no config, or if a prog-button is pressed during start-up)
  • Uses NTP library to keep track of time
  • Continously stores values in EEPROM, in case of power loss or other failure (can be reset from config)
  • Reports data to an MQTT broker (using json for the data)
  • Can read energy as pulses using PulsePort class
  • Can read energy from M-Bus using the MBus class

No further processing is done here. My OpenHAB is listening on the data being reported and do further calculations, storage and presentation of the data