A REST API server and MQTT client which provides the power and energy consumption, which uses 2 S0 interfaces. Its the successor project of avr-net-io-smartmeter. Homeassistant MQTT automatic device discovery is supported as well.
- Motivation
- Hardware
- Deployment
- Software
- API Endpoints and MQTT Topics
- Used Libraries
- Issues, Ideas And Bugs
- License
- Contribution
The idea was to have a simple way to get the power consumption of the heatpump and the rest of the house. The data shall be provided over REST-API and MQTT, as well as to Homeassistant.
The Olimex ESP32-POE-ISO board with the RS-232 level shifter Olimex MOD-RS232 is used.
ESPHome is used as the base of the software.
- Install Python.
- Setup virtual environment.
python -m venv .venv
- Activate virtual environment.
- Windows CMD:
.venv\Scripts\activate.bat
- Windows PowerShell:
.venv\Scripts\activate.ps1
- Linux:
.venv/Scripts/activate
- Windows CMD:
- Install packages.
pip install -r requirements.txt
- Create a
secrets.yaml
in the project root folder. Replace my_user and my_password according to the MQTT broker credentials.
mqtt_user: my_user
mqtt_password: my_password
esphome compile smartmeter.yaml
esphome run smartmeter.yaml
| **Name** | **Description** | **REST API** | **MQTT Topic** |
|------------|-----------------|---------------------------------------|------------------------------------------|
| **s0-1** | S0-interface | `http://<IP-ADDRESS>/sensor/s0_1` | `heatpumpctrl/sensor/s0_1/state` |
| **s0-2** | S0-interface | `http://<IP-ADDRESS>/sensor/s0_2` | `heatpumpctrl/sensor/s0_2/state` |
Library | Description | License |
---|---|---|
ESPHome | ESPHome | MIT and GPLv3 |
If you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.
The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.