When exploring MQTT messages, we advise installing and using an MQTT client on the computer to investigate the message content and format.
Several free MQTT clients are available, for example:
During initial MQTT setup for your installation, you may encounter error messages in the user interface:
Check the log of the MQTT broker to understand what is going on, and how to remedy the situation.
In the MQTT messages, parameter names are abbreviated in order to make the messages compact. See examples at the end of this guide.
At the time of editing this guide, the following MQTT payload formats can be selected:
With this setting, parameters are sent as separate MQTT messages, and the messages that are sent depend on what the meter sends - which will vary. Parameters are grouped in subtopics.
“minimal” vs “full”: If “minimal” is selected, fewer parameters are sent.
Use an MQTT client to see which messages are sent.
This is a quite “basic” payload that sends data to five Domoticz devices.
When this payload is selected, a new tile appears in the GUI, where the user must provide IDX numbers for the Domoticz sensors.
Requires that a Domoticz MQTT-message-broker is setup. HOWTO: https://www.domoticz.com/wiki/MQTT.
Domoticz MQTT payloads will be published to MQTT topic "domoticz/in". The Domoticz MQTT client must therefor be configured to use "domoticz/in as "Topic In Prefix". See https://www.domoticz.com/wiki/MQTT.
The following virtual sensors can currently be used (see: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's):
Create the sensors in Domoticz under Hardware > Dummy > Create virtual sensors, and use the IDX assigned to the sensor as input to the configuration here.
Sensor discovery messages are sent to the topic set in "Discovery topic prefix" (default: "homeassistant"). Discovery messages are sent at device startup, and if Home Assistance restarts (sending an "online" message).
Sensor data messages are sent to the topic set in "Publish topic".
Two JSON strings are transmitted on MQTT each time the device receives a payload from the meter:
Sends one structured JSON string each time the device receives a payload from the meter.
The content of the MQTT message will reflect the content of the message. Some meters are configured to send different content at different intervals.
Depending on the meter, JSON strings will be sent to the following topics:
Sends one unstructured (flat) JSON string each time the device receives a payload from the meter. Contains both measurement data and system data from the amsreader.
Content will vary depending on what the meter transmits.
{
"id" : "",
"name" : "",
"up" : 0,
"vcc" : 0.000,
"rssi": 0,
"temp": 0.00,
"version": ""
}
{
"id" : "", # WiFi MAC address
"name" : "", # MQTT Client ID
"up" : 0, # Uptime in seconds
"t" : 0, # Package timestamp in unixtime
"vcc" : 0.000, # ESP voltage
"rssi": 0, # WiFi RSSI
"temp": 0.00, # Temperature
"data" : { # Data extracted from MBUS datagram
"P" : 0 # Active power
},
"realtime" : { # Data from realtime calculator
"h" : 0.00, # Consumption this hour
"d" : 0.0, # Consumption total today
"t" : 0, # Current active month threshold
"x" : 0.00, # Maximum usage for a single hour this month,
"he" : 0.00, # Export this hour
"de" : 0.00 # Export total today
}
}
{
"id" : "", # WiFi MAC address
"name" : "", # MQTT Client ID
"up" : 0, # Uptime in seconds
"t" : 0, # Package timestamp in unixtime
"vcc" : 0.000, # ESP voltage
"rssi": 0, # WiFi RSSI
"temp": 0.00, # Temperature
"data" : { # Data extracted from MBUS datagram
"lv" : "", # List version
"id" : "", # Meter ID
"type" : "", # Meter model
"P" : 0, # Active import
"Q" : 0, # Reactive import
"PO" : 0, # Active export
"QO" : 0, # Reactive export
"I1" : 0.00, # L1 current
"I2" : 0.00, # L2 current
"I3" : 0.00, # L3 current
"U1" : 0.00, # L1 voltage
"U2" : 0.00, # L2 voltage
"U3" : 0.00 # L3 voltage
},
"realtime" : { # Data from realtime calculator
"h" : 0.00, # Consumption this hour
"d" : 0.0, # Consumption total today
"t" : 0, # Current active month threshold
"x" : 0.00, # Maximum usage for a single hour this month,
"he" : 0.00, # Export this hour
"de" : 0.00 # Export total today
}
}
{
"id" : "", # WiFi MAC address
"name" : "", # MQTT Client ID
"up" : 0, # Uptime in seconds
"t" : 0, # Package timestamp in unixtime
"vcc" : 0.000, # ESP voltage
"rssi": 0, # WiFi RSSI
"temp": 0.00, # Temperature
"data" : { # Data extracted from MBUS datagram
"lv" : "", # List version
"id" : "", # Meter ID
"type" : "", # Meter model
"P" : 0, # Active import
"Q" : 0, # Reactive import
"PO" : 0, # Active export
"QO" : 0, # Reactive export
"I1" : 0.00, # L1 current
"I2" : 0.00, # L2 current
"I3" : 0.00, # L3 current
"U1" : 0.00, # L1 voltage
"U2" : 0.00, # L2 voltage
"U3" : 0.00 # L3 voltage
"tPI" : 0.0, # Accumulated active import
"tPO" : 0.0, # Accumulated active export
"tQI" : 0.0, # Accumulated reactive import
"tQO" : 0.0, # Accumulated reactive export
"rtc" : 0 # Meter timestamp
},
"realtime" : { # Data from realtime calculator
"h" : 0.00, # Consumption this hour
"d" : 0.0, # Consumption total today
"t" : 0, # Current active month threshold
"x" : 0.00, # Maximum usage for a single hour this month,
"he" : 0.00, # Export this hour
"de" : 0.00 # Export total today
}
}
{
"id" : "", # WiFi MAC address
"name" : "", # MQTT Client ID
"up" : 0, # Uptime in seconds
"t" : 0, # Package timestamp in unixtime
"vcc" : 0.000, # ESP voltage
"rssi": 0, # WiFi RSSI
"temp": 0.00, # Temperature
"data" : { # Data extracted from MBUS datagram
"lv" : "", # List version
"id" : "", # Meter ID
"type" : "", # Meter model
"P" : 0, # Active import
"Q" : 0, # Reactive import
"PO" : 0, # Active export
"QO" : 0, # Reactive export
"I1" : 0.00, # L1 current
"I2" : 0.00, # L2 current
"I3" : 0.00, # L3 current
"U1" : 0.00, # L1 voltage
"U2" : 0.00, # L2 voltage
"U3" : 0.00 # L3 voltage
"PF" : 0.00, # Power factor
"PF1" : 0.00,# Power factor phase 1
"PF2" : 0.00,# Power factor phase 2
"PF3" : 0.00,# Power factor phase 3
"tPI" : 0.0, # Accumulated active import
"tPO" : 0.0, # Accumulated active export
"tQI" : 0.0, # Accumulated reactive import
"tQO" : 0.0, # Accumulated reactive export
"rtc" : 0 # Meter timestamp
},
"realtime" : { # Data from realtime calculator
"h" : 0.00, # Consumption this hour
"d" : 0.0, # Consumption total today
"t" : 0, # Current active month threshold
"x" : 0.00, # Maximum usage for a single hour this month,
"he" : 0.00, # Export this hour
"de" : 0.00 # Export total today
}
}
{
"id" : "B4:E6:2D:97:17:91", # WiFi MAC address
"prices" : {
"0" : 0.0000, # Price for current hour
"1" : 0.0000, # Price one hour from now
"2" : 0.0000, # Price two hour from now
"3" : 0.0000, # Price three hour from now
"4" : 0.0000, # Price four hour from now
"5" : 0.0000, # Price five hour from now
"6" : 0.0000, # Price six hour from now
"7" : 0.0000, # Price seven hour from now
"8" : 0.0000, # Price eight hour from now
"9" : 0.0000, # Price nine hour from now
"10" : 0.0000, # Price ten hour from now
"11" : 0.0000, # Price eleven hour from now
"min" : 0.0000, # Lowest known price ahead
"max" : 0.0000, # Highest known price ahead
"cheapest1hr" : "2022-01-01T00:00:00Z", # Timestamp for cheapest hour
"cheapest3hr" : "2022-01-01T00:00:00Z", # Timestamp for cheapest combined 3 hour period
"cheapest6hr" : "2022-01-01T00:00:00Z" # Timestamp for cheapest combined 6 hour period
}
}