I’ll try to manage.
No test on the PR — the numeric type is already covered.
I’ll try to manage.
No test on the PR — the numeric type is already covered.
Well, I don’t see how to do it (I looked at how it was done) but I don’t know how to spam the service.
Also, based on the library output (if I understand correctly), it’s the MQTT library that’s blocking, right?
Blocked for 36.14090771484375ms, operation started here: [
' at Socket.connect (net.js:970:7)',
' at Object.connect (net.js:201:17)',
' at Object.streamBuilder (/src/server/services/zigbee2mqtt/node_modules/mqtt/lib/connect/tcp.js:18:14)',
' at MqttClient.wrapper [as streamBuilder] (/src/server/services/zigbee2mqtt/node_modules/mqtt/lib/connect/index.js:154:36)',
' at MqttClient._setupStream (/src/server/services/zigbee2mqtt/node_modules/mqtt/lib/client.js:298:22)',
' at new MqttClient (/src/server/services/zigbee2mqtt/node_modules/mqtt/lib/client.js:277:8)',
' at Object.connect (/src/server/services/zigbee2mqtt/node_modules/mqtt/lib/connect/index.js:156:16)',
' at Zigbee2mqttManager.connect (/src/server/services/zigbee2mqtt/lib/connect.js:16:40)',
' at Zigbee2mqttManager.init (/src/server/services/zigbee2mqtt/lib/init.js:88:18)',
' at async Object.start (/src/server/services/zigbee2mqtt/index.js:17:5)',
' at async Service.start (/src/server/lib/service/service.start.js:33:7)'
]
Also, I don’t really understand the lifecycle here — why is there a connect for each device publish?
To spam the service, you call this function from a test with the Z2M object of your Lixee TIC:
The associated test:
In the tests, the Z2M device that is sent looks like this:
Try to grab the same Z2M message for the Lixee TIC, create a new JSON file and create a new test that sends this JSON.
Then it’s a line-by-line analysis to understand what’s happening / what is too heavy to do.
I just added my device in the json and added this test (probably did more harm than good)
it('BIG PAYLOAD', async () =\u003e {
// PREPARE
stateManagerGetStub = sinon.stub();
stateManagerGetStub.onFirstCall().returns(null);
zigbee2mqttManager.gladys.stateManager.get = stateManagerGetStub;
// EXECUTE
await zigbee2mqttManager.handleMqttMessage('zigbee2mqtt/0x00158d0005d29aa0', `{"active_enerfy_out_d01":8015,"active_enerfy_out_d02":10819,"active_enerfy_out_d03":4081,"active_enerfy_out_d04":5549,"active_power":1126,"active_power_max":2360,"active_power_ph_b":464,"apparent_power":415,"available_power":6,"average_rms_voltage_meas_period":233,"current_date":"E220524164514","current_index_tarif":2,"current_price":"HEURE PLEINE","current_summ_delivered":28947,"current_tarif":"H PLEINE/CREUSE","current_tier10_summ_delivered":0,"current_tier1_summ_delivered":12307,"current_tier2_summ_delivered":16640,"current_tier3_summ_delivered":0,"current_tier4_summ_delivered":0,"current_tier5_summ_delivered":0,"current_tier6_summ_delivered":0,"current_tier7_summ_delivered":0,"current_tier8_summ_delivered":0,"current_tier9_summ_delivered":0,"device":{"applicationVersion":4,"dateCode":"20220217","friendlyName":"Lixee TIC","hardwareVersion":1,"ieeeAddr":"0x00158d0005d29aa0","manufacturerID":4151,"manufacturerName":"LiXee","model":"ZLinky_TIC","networkAddress":32871,"powerSource":"Mains (single phase)","softwareBuildID":"4000-0005","stackVersion":2,"type":"Router","zclVersion":3},"drawn_v_a_max_n1":2940,"last_seen":"2022-06-24T15:33:28+00:00","linkquality":78,"message1":"PAS DE MESSAGE","message2":"","meter_serial_number":"811775803140","power_threshold":6,"relais":1,"rms_current":2,"rms_voltage":231,"site_id":"XXXXXX","software_revision":2,"status_register":"003A4401","update":{"state":"idle"},"update_available":false}`);
// ASSERT
assert.calledOnce(gladys.event.emit);
});
It messes up all the tests. ( discover and handlemqtt )
Anyway it’s not my area. ( very frustrating I don’t understand anything )
In the code, I will replace it with a single quote.
Ah, but wait, it’s actually supposed to be a string, I guess, so that might be normal.
What error are you getting otherwise?
Yeah I just checked the other tests, they’re like that
Complete failure, I feel like the features are « shifted » (GIST because it doesn’t pass on the forum)
https://gist.github.com/VonOx/3408e88d231594fc530bdbabcbe5f71a#file-gistfile1-txt
Problem with array size apparently
So if that’s normal, what’s the problem?
If you modify the test input, it’s normal for the output to be different.
Anyway, we don’t really care whether the tests pass or not on the CI; the idea was just to have that test locally to be able to test how the Z2M integration reacted when receiving that big payload, and to
If I ignore the other tests no blocking on the large payload
![]()
Where it’s blocking, I don’t know if this helps ( no stack )
![]()
Nothing else
Le Lixee en +
[
{
"external_id": "zigbee2mqtt:0x00158d00033e88d5",
"features": [
{
"category": "battery",
"external_id": "zigbee2mqtt:0x00158d00033e88d5:battery:integer:battery",
"has_feedback": false,
"max": 100,
"min": 0,
"name": "Battery",
"read_only": true,
"selector": "zigbee2mqtt-0x00158d00033e88d5-battery-integer-battery",
"type": "integer",
"unit": "percent"
},
{
"category": "button",
"external_id": "zigbee2mqtt:0x00158d00033e88d5:button:click:action",
"has_feedback": false,
"max": 7,
"min": 0,
"name": "Action",
"read_only": true,
"selector": "zigbee2mqtt-0x00158d00033e88d5-button-click-action",
"type": "click",
"unit": null
},
{
"category": "switch",
"external_id": "zigbee2mqtt:0x00158d00033e88d5:switch:voltage:voltage",
"has_feedback": false,
"max": 10000,
"min": 0,
"name": "Voltage",
"read_only": true,
"selector": "zigbee2mqtt-0x00158d00033e88d5-switch-voltage-voltage",
"type": "voltage",
"unit": "millivolt"
}
],
"model": "WXKG01LM",
"name": "0x00158d00033e88d5",
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee",
"should_poll": false
},
{
"name": "0x00158d0004019127",
"model": "WXKG11LM",
"external_id": "zigbee2mqtt:0x00158d0004019127",
"features": [
{
"name": "Battery",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 100,
"category": "battery",
"type": "integer",
"unit": "percent",
"external_id": "zigbee2mqtt:0x00158d0004019127:battery:integer:battery",
"selector": "zigbee2mqtt-0x00158d0004019127-battery-integer-battery"
},
{
"name": "Voltage",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 10000,
"category": "switch",
"type": "voltage",
"unit": "millivolt",
"external_id": "zigbee2mqtt:0x00158d0004019127:switch:voltage:voltage",
"selector": "zigbee2mqtt-0x00158d0004019127-switch-voltage-voltage"
}
],
"should_poll": false,
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee"
},
{
"name": "0x00158d00045b2740",
"model": "WSDCGQ11LM",
"external_id": "zigbee2mqtt:0x00158d00045b2740",
"features": [
{
"name": "Battery",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 100,
"category": "battery",
"type": "integer",
"unit": "percent",
"external_id": "zigbee2mqtt:0x00158d00045b2740:battery:integer:battery",
"selector": "zigbee2mqtt-0x00158d00045b2740-battery-integer-battery"
},
{
"name": "Temperature",
"read_only": true,
"has_feedback": false,
"min": -100,
"max": 150,
"category": "temperature-sensor",
"type": "decimal",
"unit": "celsius",
"external_id": "zigbee2mqtt:0x00158d00045b2740:temperature-sensor:decimal:temperature",
"selector": "zigbee2mqtt-0x00158d00045b2740-temperature-sensor-decimal-temperature"
},
{
"name": "Humidity",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 100,
"category": "humidity-sensor",
"type": "decimal",
"unit": "percent",
"external_id": "zigbee2mqtt:0x00158d00045b2740:humidity-sensor:decimal:humidity",
"selector": "zigbee2mqtt-0x00158d00045b2740-humidity-sensor-decimal-humidity"
},
{
"name": "Alarm",
"read_only": false,
"has_feedback": true,
"min": 0,
"max": 1,
"category": "siren",
"type": "binary",
"unit": null,
"external_id": "zigbee2mqtt:0x00158d00045b2740:siren:binary:alarm",
"selector": "zigbee2mqtt-0x00158d00045b2740-siren-binary-alarm"
},
{
"name": "Pressure",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 10000,
"category": "pressure-sensor",
"type": "decimal",
"unit": "hPa",
"external_id": "zigbee2mqtt:0x00158d00045b2740:pressure-sensor:decimal:pressure",
"selector": "zigbee2mqtt-0x00158d00045b2740-pressure-sensor-decimal-pressure"
},
{
"name": "Voltage",
"read_only": true,
"has_feedback": false,
"min": 0,
"max": 10000,
"category": "switch",
"type": "voltage",
"unit": "millivolt",
"external_id": "zigbee2mqtt:0x00158d00045b2740:switch:voltage:voltage",
"selector": "zigbee2mqtt-0x00158d00045b2740-switch-voltage-voltage"
}
],
"should_poll": false,
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee"
},
{
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee",
"name": "0x00158d0005d29aa0",
"model": "ZLinky_TIC",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0",
"should_poll": false,
"features": [
{
"name": "Numéro tarif",
"selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif",
"category": "energy-sensor",
"type": "index",
"read_only": true,
"has_feedback": false,
"unit": "kilowatt-hour",
"min": 0,
"max": 10000
},
{
"name": "Puissance apprente",
"selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power",
"category": "energy-sensor",
"type": "power",
"read_only": true,
"has_feedback": false,
"unit": "volt-ampere",
"min": 0,
"max": 10000
},
{
"name": "Index Total",
"selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered",
"category": "energy-sensor",
"type": "index",
"read_only": true,
"has_feedback": false,
"unit": "kilowatt-hour",
"min": 0,
"max": 1000000
},
{
"name": "Heures creuses",
"selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered",
"category": "energy-sensor",
"type": "index",
"read_only": true,
"has_feedback": false,
"unit": "kilowatt-hour",
"min": 0,
"max": 1000000
},
{
"name": "Heures pleines",
"selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered",
"external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered",
"category": "energy-sensor",
"type": "index",
"read_only": true,
"has_feedback": false,
"unit": "kilowatt-hour",
"min": 0,
"max": 1000000
}
]
}
]
Ou celui ci je ne sais pas trop lequel est utilisé
[
{
"definition": null,
"endpoints": {
"1": {
"bindings": [],
"clusters": {
"input": ["genBasic", "genTime", "genOta"],
"output": ["genPowerCfg", "genPollCtrl", "ssIasZone"]
},
"configured_reportings": []
},
"242": {
"bindings": [],
"clusters": {
"input": [],
"output": ["greenPower"]
},
"configured_reportings": []
}
},
"friendly_name": "Coordinator",
"ieee_address": "0x00212effff06ddd8",
"interview_completed": true,
"interviewing": false,
"network_address": 0,
"supported": false,
"type": "Coordinator"
},
{
"definition": {
"description": "MiJia wireless switch",
"exposes": [
{
"access": 1,
"description": "Remaining battery in %",
"name": "battery",
"property": "battery",
"type": "numeric",
"unit": "%",
"value_max": 100,
"value_min": 0
},
{
"access": 1,
"description": "Triggered action (e.g. a button click)",
"name": "action",
"property": "action",
"type": "enum",
"values": ["single", "double", "triple", "quadruple", "hold", "release", "many"]
},
{
"access": 1,
"description": "Voltage of the battery in millivolts",
"name": "voltage",
"property": "voltage",
"type": "numeric",
"unit": "mV"
},
{
"access": 1,
"description": "Link quality (signal strength)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "WXKG01LM",
"supports_ota": false,
"vendor": "Xiaomi"
},
"endpoints": {
"1": {
"bindings": [],
"clusters": {
"input": [],
"output": []
},
"configured_reportings": []
}
},
"friendly_name": "0x00158d00033e88d5",
"ieee_address": "0x00158d00033e88d5",
"interview_completed": true,
"interviewing": false,
"manufacturer": "LUMI",
"model_id": "lumi.sensor_switch",
"network_address": 44173,
"power_source": "Battery",
"supported": true,
"type": "EndDevice"
},
{
"date_code": "20180525",
"definition": {
"description": "Aqara wireless switch",
"exposes": [
{
"access": 1,
"description": "Remaining battery in %",
"name": "battery",
"property": "battery",
"type": "numeric",
"unit": "%",
"value_max": 100,
"value_min": 0
},
{
"access": 1,
"description": "Voltage of the battery in millivolts",
"name": "voltage",
"property": "voltage",
"type": "numeric",
"unit": "mV"
},
{
"access": 1,
"description": "Link quality (signal strength)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "WXKG11LM",
"supports_ota": false,
"vendor": "Xiaomi"
},
"endpoints": {
"1": {
"bindings": [],
"clusters": {
"input": ["genBasic", "genMultistateInput", "genIdentify"],
"output": ["genBasic"]
},
"configured_reportings": []
}
},
"friendly_name": "0x00158d0004019127",
"ieee_address": "0x00158d0004019127",
"interview_completed": true,
"interviewing": false,
"manufacturer": "LUMI",
"model_id": "lumi.remote.b1acn01",
"network_address": 47250,
"power_source": "Battery",
"software_build_id": "3000-0001",
"supported": true,
"type": "EndDevice"
},
{
"date_code": "20220217",
"definition": {
"description": "Lixee ZLinky",
"exposes": [
{
"access": 1,
"description": "Serial Number",
"name": "ADSC",
"property": "meter_serial_number",
"type": "text"
},
{
"access": 1,
"description": "Supplier pricing schedule name",
"name": "NGTF",
"property": "current_tarif",
"type": "text"
},
{
"access": 1,
"description": "Current supplier price label",
"name": "LTARF",
"property": "current_price",
"type": "text"
},
{
"access": 1,
"description": "Current tariff index number",
"name": "NTARF",
"property": "current_index_tarif",
"type": "numeric"
},
{
"access": 1,
"description": "Customer tele-information protocol version",
"name": "VTIC",
"property": "software_revision",
"type": "numeric"
},
{
"access": 1,
"description": "Current date and time",
"name": "DATE",
"property": "current_date",
"type": "text"
},
{
"access": 1,
"description": "Total active power delivered",
"name": "EAST",
"property": "current_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 01)",
"name": "EASF01",
"property": "current_tier1_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 02)",
"name": "EASF02",
"property": "current_tier2_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 03)",
"name": "EASF03",
"property": "current_tier3_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 04)",
"name": "EASF04",
"property": "current_tier4_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 05)",
"name": "EASF05",
"property": "current_tier5_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 06)",
"name": "EASF06",
"property": "current_tier6_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 07)",
"name": "EASF07",
"property": "current_tier7_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 08)",
"name": "EASF08",
"property": "current_tier8_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 09)",
"name": "EASF09",
"property": "current_tier9_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 10)",
"name": "EASF10",
"property": "current_tier10_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 01)",
"name": "EASD01",
"property": "active_enerfy_out_d01",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 02)",
"name": "EASD02",
"property": "active_enerfy_out_d02",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 03)",
"name": "EASD03",
"property": "active_enerfy_out_d03",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 04)",
"name": "EASD04",
"property": "active_enerfy_out_d04",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "RMS current",
"name": "IRMS1",
"property": "rms_current",
"type": "numeric",
"unit": "A"
},
{
"access": 1,
"description": "RMS voltage",
"name": "URMS1",
"property": "rms_voltage",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Apparent power of reference",
"name": "PREF",
"property": "available_power",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Register of Statutes",
"name": "STGE",
"property": "status_register",
"type": "text"
},
{
"access": 1,
"description": "Apparent power threshold",
"name": "PCOUP",
"property": "power_threshold",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Current point of the active load curve drawn",
"name": "CCASN",
"property": "active_power",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Previous point of the active load curve drawn",
"name": "CCASN-1",
"property": "active_power_ph_b",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Average RMS voltage (phase 1)",
"name": "UMOY1",
"property": "average_rms_voltage_meas_period",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Immediate apparent power delivered",
"name": "SINSTS",
"property": "apparent_power",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Apparent power delivered peak",
"name": "SMAXN",
"property": "active_power_max",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Apparent power max. draw-off n-1",
"name": "SMAXN-1",
"property": "drawn_v_a_max_n1",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Message short",
"name": "MSG1",
"property": "message1",
"type": "text"
},
{
"access": 1,
"description": "Message ultra-short",
"name": "MSG2",
"property": "message2",
"type": "text"
},
{
"access": 1,
"description": "PRM number",
"name": "PRM",
"property": "site_id",
"type": "text"
},
{
"access": 1,
"description": "Start mobile point 1",
"name": "DPM1",
"property": "start_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 1",
"name": "FPM1",
"property": "stop_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Start mobile point 2",
"name": "DPM2",
"property": "start_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 2",
"name": "FPM2",
"property": "stop_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Start mobile point 3",
"name": "DPM3",
"property": "start_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 3",
"name": "FPM3",
"property": "stop_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"name": "RELAIS",
"property": "relais",
"type": "numeric"
},
{
"access": 1,
"description": "Current day number supplier calendar",
"name": "NJOURF",
"property": "days_number_current_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Next day number supplier calendar",
"name": "NJOURF+1",
"property": "days_number_next_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Profile of the next supplier calendar day",
"name": "PJOURF+1",
"property": "days_profile_current_calendar",
"type": "text"
},
{
"access": 1,
"description": "Profile of the next check-in day",
"name": "PPOINTE1",
"property": "days_profile_next_calendar",
"type": "text"
},
{
"access": 1,
"description": "Link quality (signal strength)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "ZLinky_TIC",
"supports_ota": true,
"vendor": "LiXee"
},
"endpoints": {
"1": {
"bindings": [
{
"cluster": "haElectricalMeasurement",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "seMetering",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "haMeterIdentification",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "liXeePrivate",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
}
],
"clusters": {
"input": [
"genBasic",
"genIdentify",
"seMetering",
"haElectricalMeasurement",
"haMeterIdentification",
"liXeePrivate"
],
"output": ["genOta"]
},
"configured_reportings": [
{
"attribute": "currentSummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier1SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier2SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier3SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "rmsCurrent",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePower",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePowerPhB",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "apparentPower",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePowerMax",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
}
],
"scenes": []
},
"242": {
"bindings": [],
"clusters": { "input": ["greenPower"], "output": ["greenPower"] },
"configured_reportings": [],
"scenes": []
}
},
"friendly_name": "0x00158d0005d29aa0",
"ieee_address": "0x00158d0005d29aa0",
"interview_completed": true,
"interviewing": false,
"manufacturer": "LiXee",
"model_id": "ZLinky_TIC",
"network_address": 32871,
"power_source": "Mains (single phase)",
"software_build_id": "4000-0005",
"supported": true,
"type": "Router"
}
]
Are you sure these are the JSONs?
They’re small JSONs, and a simple test on your side gives me 0.1 ms of parsing time for these JSONs, it’s not the right JSON in my opinion ^^
Edit I’m going to push because it’s too long for the forum
https://pastebin.com/ otherwise!
Here, I made a branch for debugging
https://github.com/GladysAssistant/Gladys/compare/master...VonOx:Gladys:z2m-debug
Can you copy-paste (to Pastebin) an example of a large JSON body coming from Zigbee2mqtt?
If it’s sensitive personal data, you can also send it to me via DM ![]()
Il est là pour le Lixee ( new state )
Sinon le device en lui même pour le discover est déjà sur github
{
"date_code": "20220217",
"definition": {
"description": "Lixee ZLinky",
"exposes": [
{
"access": 1,
"description": "Serial Number",
"name": "ADSC",
"property": "meter_serial_number",
"type": "text"
},
{
"access": 1,
"description": "Supplier pricing schedule name",
"name": "NGTF",
"property": "current_tarif",
"type": "text"
},
{
"access": 1,
"description": "Current supplier price label",
"name": "LTARF",
"property": "current_price",
"type": "text"
},
{
"access": 1,
"description": "Current tariff index number",
"name": "NTARF",
"property": "current_index_tarif",
"type": "numeric"
},
{
"access": 1,
"description": "Customer tele-information protocol version",
"name": "VTIC",
"property": "software_revision",
"type": "numeric"
},
{
"access": 1,
"description": "Current date and time",
"name": "DATE",
"property": "current_date",
"type": "text"
},
{
"access": 1,
"description": "Total active power delivered",
"name": "EAST",
"property": "current_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 01)",
"name": "EASF01",
"property": "current_tier1_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 02)",
"name": "EASF02",
"property": "current_tier2_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 03)",
"name": "EASF03",
"property": "current_tier3_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 04)",
"name": "EASF04",
"property": "current_tier4_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 05)",
"name": "EASF05",
"property": "current_tier5_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 06)",
"name": "EASF06",
"property": "current_tier6_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 07)",
"name": "EASF07",
"property": "current_tier7_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 08)",
"name": "EASF08",
"property": "current_tier8_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 09)",
"name": "EASF09",
"property": "current_tier9_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Total provider active power delivered (index 10)",
"name": "EASF10",
"property": "current_tier10_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 01)",
"name": "EASD01",
"property": "active_enerfy_out_d01",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 02)",
"name": "EASD02",
"property": "active_enerfy_out_d02",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 03)",
"name": "EASD03",
"property": "active_enerfy_out_d03",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Active energy withdrawn Distributor (index 04)",
"name": "EASD04",
"property": "active_enerfy_out_d04",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "RMS current",
"name": "IRMS1",
"property": "rms_current",
"type": "numeric",
"unit": "A"
},
{
"access": 1,
"description": "RMS voltage",
"name": "URMS1",
"property": "rms_voltage",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Apparent power of reference",
"name": "PREF",
"property": "available_power",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Register of Statutes",
"name": "STGE",
"property": "status_register",
"type": "text"
},
{
"access": 1,
"description": "Apparent power threshold",
"name": "PCOUP",
"property": "power_threshold",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Current point of the active load curve drawn",
"name": "CCASN",
"property": "active_power",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Previous point of the active load curve drawn",
"name": "CCASN-1",
"property": "active_power_ph_b",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Average RMS voltage (phase 1)",
"name": "UMOY1",
"property": "average_rms_voltage_meas_period",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Immediate apparent power delivered",
"name": "SINSTS",
"property": "apparent_power",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Apparent power delivered peak",
"name": "SMAXN",
"property": "active_power_max",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Apparent power max. draw-off n-1",
"name": "SMAXN-1",
"property": "drawn_v_a_max_n1",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Message short",
"name": "MSG1",
"property": "message1",
"type": "text"
},
{
"access": 1,
"description": "Message ultra-short",
"name": "MSG2",
"property": "message2",
"type": "text"
},
{
"access": 1,
"description": "PRM number",
"name": "PRM",
"property": "site_id",
"type": "text"
},
{
"access": 1,
"description": "Start mobile point 1",
"name": "DPM1",
"property": "start_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 1",
"name": "FPM1",
"property": "stop_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Start mobile point 2",
"name": "DPM2",
"property": "start_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 2",
"name": "FPM2",
"property": "stop_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Start mobile point 3",
"name": "DPM3",
"property": "start_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"description": "Stop mobile point 3",
"name": "FPM3",
"property": "stop_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"name": "RELAIS",
"property": "relais",
"type": "numeric"
},
{
"access": 1,
"description": "Current day number supplier calendar",
"name": "NJOURF",
"property": "days_number_current_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Next day number supplier calendar",
"name": "NJOURF+1",
"property": "days_number_next_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Profile of the next supplier calendar day",
"name": "PJOURF+1",
"property": "days_profile_current_calendar",
"type": "text"
},
{
"access": 1,
"description": "Profile of the next check-in day",
"name": "PPOINTE1",
"property": "days_profile_next_calendar",
"type": "text"
},
{
"access": 1,
"description": "Link quality (signal strength)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "ZLinky_TIC",
"options": [
{
"access": 2,
"description": "This device does not support reporting electric measurements so it is polled instead. The default poll interval is 60 seconds, set to -1 to disable.",
"name": "measurement_poll_interval",
"property": "measurement_poll_interval",
"type": "numeric",
"value_min": -1
},
{
"access": 2,
"description": "Counter with TIC in mode standard or historique. May require restart (default: auto)",
"name": "linky_mode",
"property": "linky_mode",
"type": "enum",
"values": ["auto", "historique", "standard"]
},
{
"access": 2,
"description": "Power with single or three phase. May require restart (default: auto)",
"name": "energy_phase",
"property": "energy_phase",
"type": "enum",
"values": ["auto", "single_phase", "three_phase"]
},
{
"access": 2,
"description": "If you produce energy back to the grid (works ONLY when linky_mode: standard, default: auto)",
"name": "production",
"property": "production",
"type": "enum",
"values": ["auto", "true", "false"]
},
{
"access": 2,
"description": "Overrides the automatic current tarif. This option will exclude unnecesary attributes. Open a issue to support more of them. Default: auto",
"name": "tarif",
"property": "tarif",
"type": "enum",
"values": [
"Historique - BASE",
"Historique - HCHP",
"Historique - EJP",
"Historique - BBR",
"Standard - Sem WE Mercredi",
"Standard - Heure Pleine Heure Creuse",
"auto"
]
},
{
"access": 2,
"description": "Number of digits after decimal point for kWh, takes into effect on next report of device.",
"name": "kWh_precision",
"property": "kWh_precision",
"type": "numeric",
"value_max": 3,
"value_min": 0
},
{
"access": 2,
"description": "During the poll, request multiple exposes to the Zlinky at once for reducing Zigbee network overload. Too much request at once could exceed device limit. Requieres Z2M restart. Default: 1",
"name": "measurement_poll_chunk",
"property": "measurement_poll_chunk",
"type": "numeric",
"value_min": 1
},
{
"access": 2,
"description": "List of TIC commands to be exposed (separated by comma). Reconfigure device after change. Default: all",
"name": "tic_command_whitelist",
"property": "tic_command_whitelist",
"type": "text"
}
],
"supports_ota": true,
"vendor": "LiXee"
},
"endpoints": {
"1": {
"bindings": [
{
"cluster": "haElectricalMeasurement",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "seMetering",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "haMeterIdentification",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
},
{
"cluster": "liXeePrivate",
"target": {
"endpoint": 1,
"ieee_address": "0x00124b0021b95104",
"type": "endpoint"
}
}
],
"clusters": {
"input": [
"genBasic",
"genIdentify",
"seMetering",
"haElectricalMeasurement",
"haMeterIdentification",
"liXeePrivate"
],
"output": ["genOta"]
},
"configured_reportings": [
{
"attribute": "currentSummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier1SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier2SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "currentTier3SummDelivered",
"cluster": "seMetering",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 100
},
{
"attribute": "rmsCurrent",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePower",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePowerPhB",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "apparentPower",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
},
{
"attribute": "activePowerMax",
"cluster": "haElectricalMeasurement",
"maximum_report_interval": 900,
"minimum_report_interval": 60,
"reportable_change": 1
}
],
"scenes": []
},
"242": {
"bindings": [],
"clusters": { "input": ["greenPower"], "output": ["greenPower"] },
"configured_reportings": [],
"scenes": []
}
},
"friendly_name": "Lixee TIC",
"ieee_address": "0x00158d0005d29aa0",
"interview_completed": true,
"interviewing": false,
"manufacturer": "LiXee",
"model_id": "ZLinky_TIC\u0000",
"network_address": 32871,
"power_source": "Mains (single phase)",
"software_build_id": "4000-0005",
"supported": true,
"type": "Router"
}
Ok, in that case it’s not JSON.parse, it’s a relatively small JSON that shouldn’t cause problems.
Now you need to test line by line what takes time and what blocks.
You can add to the code:
console.time('nameOfMyTimer');
// Code here
console.timeEnd('nameOfMyTimer');
(you can give a name to each step)
You run the handleMqttMessage test individually and see, line by line, what takes the most time.
It’s tedious, but there isn’t really any other way to find solutions!
It’s not too bad
2022-06-27T18:32:27+0200 \u003clog\u003e handleMqttMessage.js:22 (Zigbee2mqttManager.handleMqttMessage) Getting config devices from Zigbee2mqtt
Devices map: 0.264ms
Event: 4.241ms
handleMqttMessage: 7.189ms
Gladys Blocked for 28.98486499786377ms, operation started here: []
EDIT:
A second one with the parse (I was on battery in eco mode during the previous test)
2022-06-27T18:43:39+0200 \u003clog\u003e handleMqttMessage.js:22 (Zigbee2mqttManager.handleMqttMessage) Getting config devices from Zigbee2mqtt
JSONParse: 0.191ms
Devices map: 0.034ms
Event: 1.049ms
handleMqttMessage: 2.195ms