Skip to content

Message formats

Gunnar Skjold edited this page Jul 22, 2022 · 19 revisions

JSON payload sent to MQTT

List 1

{
    "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
    }
}

List 2

{
    "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
    }
}

List 3

{
    "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
    }
}

List 4

{
    "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
    }
}

Prices

{
    "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
    }
}

http://<ams_hostname>/data.json

{
    "im" : 0,            # Maximum power consuption (calculated from fuse size)
    "om" : 0,            # Maximum power production
    "mf" : 0,            # Main fuse size
    "i" : 0,             # Active import
    "e" : 0,             # Active export
    "ri" : 0,            # Reactive import
    "re" : 0,            # Reactive export
    "ic" : 0.0,          # Accumulated import
    "ec" : 0.0,          # Accumulated export
    "ric" : 0.0,         # Accumulated reactive import
    "rec" : 0.0,         # Accumulated reactive export
    "u1" : 0.0,          # L1 voltage
    "u2" : 0.0,          # L2 voltate
    "u3" : 0.0,          # L3 voltage
    "i1" : 0.00,         # L1 current
    "i2" : 0.00,         # L2 current
    "i3" : 0.00,         # L3 current
    "f" : 0.00,          # Power factor
    "f1" : 0.00,         # L1 power factor
    "f2" : 0.00,         # L2 power factor
    "f3" : 0.00,         # L3 power factor
    "v" : 0.00,          # ESP voltage
    "r" : 0,             # WiFi RSSI
    "t" : 0.0,           # Temperature
    "u" : 0,             # Uptime in seconds
    "m" : 0,             # Free memory in bytes
    "em" : 0,            # ESP status
    "hm" : 0,            # HAN status
    "wm" : 0,            # WiFi status
    "mm" : 0,            # MQTT status
    "me" : 0,            # Last MQTT error
    "p" : 0.00,          # Current hour price,
    "c" : 0,             # Internal clock
    "mt" : 0,            # Meter type
    "ds" : 0,            # Distribution system
    "ea" : {             # Energy accounting
        "x" : 0.0,       # Max average of configured amount of hours
        "t" : 0,         # Current active month threshold
        "h" : {          # Real time calculation this hour
            "u" : 0.00,  # Consumption
            "c" : 0.00   # Cost
        },
        "d" : {          # Real time calculation today
            "u" : 0.00,  # Consumption
            "c" : 0.00   # Cost
        },
        "m" : {          # Real time calculation this month
            "u" : 0.00,  # Consumption
            "c" : 0.00   # Cost
        }
    },
    "c" : 0              # Clock
}