Read teleinfo from serial port and publish with mqtt.
Run the official Docker image (i386, amd64, armv6, armv7, arm64).
docker run -d --name teleinfo-mqtt \
--device=/dev/ttyUSB0:/dev/ttyUSB0 \ # add serial port device from host
- e MQTT_URL=mqtt://my_mqtt_broker:1883 \ # set mqtt broker url
fmartinou/teleinfo-mqtt
Configuration uses environment variables.
Env var | Description | Default value |
---|---|---|
LOG_LEVEL | Log level (INFO, DEBUG, ERROR) | INFO |
SERIAL | Serial Port location | /dev/ttyUSB0 |
MQTT_URL | MQTT Broker connection URL | mqtt://localhost:1883 |
MQTT_USER | MQTT user (optional) | |
MQTT_PASSWORD | MQTT password (optional) | |
IDENTIFIER | Identifier for Home-Assistant Discovery | |
DISCOVERY_PREFIX | Topic prefix for Home-Assistant Discovery | homeassistant |
EMIT_INTERVAL | Interval in seconds between 2 MQTT emissions (0 : All frames are sent) | 0 |
The frames are published to the topic teleinfo
.
If you define an identifier, the frames are published to the topic teleinfo/$identifier
.
MQTT JSON messages may vary upon your Electricity meter.
Values are sanitized and converted to Numbers if possible (you can still access the original raw
value if necessary).
Example
{
"ADCO": {
"raw": "12345678901",
"value": 12345678901
},
"OPTARIF": {
"raw": "HC..",
"value": "HC"
},
"ISOUSC": {
"raw": "45",
"value": 45
},
"HCHC": {
"raw": "9058688",
"value": 9058688
},
"HCHP": {
"raw": "9752846",
"value": 9752846
},
"PTEC": {
"raw": "HP..",
"value": "HP"
},
"IINST": {
"raw": "22",
"value": 22
},
"IMAX": {
"raw": "90",
"value": 90
},
"PAPP": {
"raw": "4110",
"value": 4110
},
"PAPP": {
"raw": "A",
"value": "A"
}
}
Home Assistant can automatically discover the teleinfo sensor.
See here.
- ⭐ Add Homeassistant MQTT Discovery capabilities
- ⭐ Upgrade all dependencies
- ⭐ Upgrade all dependencies
- ⭐ Upgrade all dependencies
- ⭐ Upgrade to node 14
- ⭐ Upgrade all dependencies
- ⭐ Prevent identical frames to be published
- ⭐ Add ARM v6 support
- ⭐ Add multi arch Docker images (i386 / amd64 / armv7 / arm64)
- ⭐ Initial release