Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from bram2202/develop
Browse files Browse the repository at this point in the history
1.2.1 release
  • Loading branch information
bram2202 authored Jul 17, 2021
2 parents 192db37 + 80451ae commit 0f2babd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# esp8266-dsmr

A ESP8266 based DSMR reader, posting onto MQTT, powered directly from the meter itself, no external power supply needed.
A ESP8266 based DSMR reader, posting messages onto MQTT.<br/>
Can be powered directly from the meter itself, no external power supply needed*.<br/>
<sup><i>* if enough power can be supplied by the meter.</i></sup>

The code should work on DSRM v2.2 and higher, only tested on V4.2.
The code should work on DSRM v2.2 and higher, only tested on V4.2.<br/>
Supports Dutch and Belgian smart meters.<br/>

## Board in action
![esp8266-dsmr](/docs/PCB_IRL.png "esp8266-dsmr")

## Requirements
Expand All @@ -18,24 +22,24 @@ The code should work on DSRM v2.2 and higher, only tested on V4.2.
- [PubSubClient](https://pubsubclient.knolleary.net) - MQTT client
- [Core for ESP8266](https://github.com/esp8266/Arduino) - Arduino core for ESP8266 WiFi chip

## Supported messages
## Messages

### Info
| Name | unit | DSMR code | MQTT topic |
|:---- |:-------|:------ |:------|
| DSMR version | - | 1-3:0.2.8 | <MQTT_TOPIC>/version |
| Status | online, offline | - | <MQTT_TOPIC>/status |
| Status | online | - | <MQTT_TOPIC>/status |

### Power
| Name | unit | DSMR code | MQTT topic |
|:---- |:-------|:------ |:------|
| current power consumption | kW | 1-0:1.7.0 | <MQTT_TOPIC>/power/consumption |
| current power production | kW | 1-0:2.7.0 | <MQTT_TOPIC>/power/production |
| total consumption low | kWh | 1-0:1.8.1 | <MQTT_TOPIC>/power/total_consumption_low |
| total consumption high | kWh | 1-0:1.8.2 | <MQTT_TOPIC>/power/total_consumption_high |
| total production low | kWh | 1-0:2.8.1 | <MQTT_TOPIC>/power/total_production_low |
| total production high | kWh | 1-0:2.8.2 | <MQTT_TOPIC>/power/total_production_high |
| power tariff | 1 = low, 2 = high | 0-0:96.14.0 | <MQTT_TOPIC>/power/power_tariff |
| total consumption tariff 1 | kWh | 1-0:1.8.1 | <MQTT_TOPIC>/power/total_consumption_tariff_1 |
| total consumption tariff 2 | kWh | 1-0:1.8.2 | <MQTT_TOPIC>/power/total_consumption_tariff_2 |
| total production tariff 1 | kWh | 1-0:2.8.1 | <MQTT_TOPIC>/power/total_production_tariff_1 |
| total production tariff 2 | kWh | 1-0:2.8.2 | <MQTT_TOPIC>/power/total_production_tariff_2 |
| power tariff | [See tariffs](#tariffs) | 0-0:96.14.0 | <MQTT_TOPIC>/power/power_tariff |
| short power outages | - | 0-0:96.7.21 |<MQTT_TOPIC>/power/short_power_outages |
| long power outages | - | 0-0:96.7.9 |<MQTT_TOPIC>/power/long_power_outages |
| instant current phase 1 | A | 1-0:31.7.0 |<MQTT_TOPIC>/power/phase_1/current |
Expand Down Expand Up @@ -63,6 +67,16 @@ The code should work on DSRM v2.2 and higher, only tested on V4.2.
| timestamp| - | 0-1:24.2.1| <MQTT_TOPIC>/gas/timestamp |
| device id | - | 0-1:96.1.0 | <MQTT_TOPIC>/gas/device |

## Tariffs
The meter has a power tariff property, and is used for the total consumption/production counters.<br/>
The values for the day and night tariffs are different in the Netherlands compared to Belgium.
| Country | tariff | value |
|:---- |:---- |:---- |
| NL | Night (low) | tariff_1 |
| NL | Day (high) | tariff_2 |
| BE | Night (low) |tariff_2 |
| BE | Day (high)| tariff_1 |

## Settings
Copy `Settings.example.h` to `Settings.h` and fill in the correct data.

Expand Down Expand Up @@ -124,6 +138,9 @@ Connecting to the DSMR with a RJ11/12/25 (6p6c or 6p4c) cable plugged into the P

`* 1 and 6 are not needed if powered by USB.`

## Known issues
# Known issues
- Some DSMR cannot deliver enough power to run the Wemos stably.<br>
Connect a 5V usb supply to fix this.

# Missing properties?
Are you missing a property? don't be afraid to open a [issue](https://github.com/bram2202/esp8266-dsmr/issues), or contribute to this repo yourself!
10 changes: 5 additions & 5 deletions esp8266-dsmr.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const Measurement measurements[] = {
{"power/device_id", "0-0:96.1.1", 11, 45, Measurement::STRING},
{"power/consuption", "1-0:1.7.0", 10, 16, Measurement::FLOAT},
{"power/production", "1-0:2.7.0", 10, 16, Measurement::FLOAT},
{"power/total_consuption_low", "1-0:1.8.1", 10, 20, Measurement::FLOAT},
{"power/total_consuption_high", "1-0:1.8.2", 10, 20, Measurement::FLOAT},
{"power/total_production_low", "1-0:2.8.1", 10, 20, Measurement::FLOAT},
{"power/total_production_high", "1-0:2.8.2", 10, 20, Measurement::FLOAT},
{"power/total_consuption_tariff_1", "1-0:1.8.1", 10, 20, Measurement::FLOAT},
{"power/total_consuption_tariff_2", "1-0:1.8.2", 10, 20, Measurement::FLOAT},
{"power/total_production_tariff_1", "1-0:2.8.1", 10, 20, Measurement::FLOAT},
{"power/total_production_tariff_2", "1-0:2.8.2", 10, 20, Measurement::FLOAT},
{"power/power_tariff", "0-0:96.14.0", 12, 16, Measurement::INT},
{"power/short_power_outages", "0-0:96.7.21", 12, 17, Measurement::INT},
{"power/long_power_outages", "0-0:96.7.9", 11, 16, Measurement::INT},
Expand Down Expand Up @@ -92,7 +92,7 @@ void setup()
ArduinoOTA.setHostname(WIFI_HOSTNAME);
ArduinoOTA.begin();

logger.info("Setup complte");
logger.info("Setup complete");
}

void loop()
Expand Down

0 comments on commit 0f2babd

Please sign in to comment.