Voy a intentar arreglármelas.
No hay pruebas en la PR, el tipo numérico ya está cubierto.
Voy a intentar arreglármelas.
No hay pruebas en la PR, el tipo numérico ya está cubierto.
Bueno, no veo cómo hacerlo (he mirado cómo se hace), pero no sé cómo spamear el servicio.
Además, según la salida de la lib (y si lo entiendo bien), ¿es la lib mqtt la que bloquea, no?
Bloqueado durante 36.14090771484375ms, la operación comenzó aquí: [
' 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)'
]
De todos modos, no entiendo muy bien el ciclo de vida aquí, ¿por qué hay una conexión cada vez que se publica un dispositivo?
Para saturar el servicio, llamas desde un test esta función con el objeto Z2M de tu Lixee TIC:
La prueba asociada:
En las pruebas, el dispositivo Z2M que se envía se parece a esto:
Intenta pillar el mismo mensaje Z2M para el Lixee TIC, crea un nuevo archivo JSON y crea una nueva prueba que envíe este JSON.
Luego es medir línea por línea para entender qué está pasando / qué es demasiado pesado de hacer.
Acabo de agregar mi dispositivo en los json y agregar esta prueba (peor que mejor)
it('BIG PAYLOAD', async () => {
// 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);
});
Esto arruina todas las pruebas. (descubrir y manejar mqtt)
En resumen, no es mi área. (muy frustrante, no entiendo nada)
En el código, voy a reemplazarlo por una comilla simple
Ah, pero espera, supongo que debería ser una cadena, así que puede ser normal.
¿Qué error tienes, por cierto?
Vaya, acabo de ver los otros tests son así
Un fracaso total, tengo la impresión de que las características se « desplazan » (GIST porque no pasa en el foro)
https://gist.github.com/VonOx/3408e88d231594fc530bdbabcbe5f71a#file-gistfile1-txt
Problema de tamaño de matriz, al parecer
Bueno, ¿cuál es el problema si eso es normal?
Si modificas la entrada de las pruebas, es normal que la salida sea diferente.
Al final, da igual que las pruebas pasen o no en el CI, la idea era tener esta prueba localmente para poder probar cómo reaccionaba la integración Z2M al recibir este gran payload, y entender qué parte del código crea estos bloqueos del bucle de eventos.
Aunque reconozco que es un enfoque en el que hay que tener un poco de conocimiento ![]()
Si ignoro las otras pruebas, no hay bloqueo en el gran payload
![]()
Donde se bloquea, no sé si esto ayuda (sin pila)
![]()
Nada más
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
}
]
}
]
O este, no sé cuál de los dos se usa
[
{
"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": "Interruptor inalámbrico MiJia",
"exposes": [
{
"access": 1,
"description": "Batería restante en %",
"name": "battery",
"property": "battery",
"type": "numeric",
"unit": "%",
"value_max": 100,
"value_min": 0
},
{
"access": 1,
"description": "Acción desencadenada (p. ej
¿Estás seguro de que son estos JSON?
Son JSON pequeños, y una simple prueba en tu máquina me da 0.1ms de tiempo de análisis para estos JSON, no creo que sean los JSON correctos ^^
Edito, voy a hacer push porque es demasiado largo para el foro
https://pastebin.com/ sinon !
Vaya, he creado una rama para el depuración
https://github.com/GladysAssistant/Gladys/compare/master...VonOx:Gladys:z2m-debug
¿Puedes copiar y pegar (en pastebin) un ejemplo de un gran cuerpo JSON de Zigbee2mqtt?
Si es información personal sensible, también puedes enviármelo por mensaje privado ![]()
Está ahí para el Lixee (nuevo estado)
De lo contrario, el dispositivo en sí para el descubrimiento ya está en GitHub
{
"date_code": "20220217",
"definition": {
"description": "Lixee ZLinky",
"exposes": [
{
"access": 1,
"description": "Número de serie",
"name": "ADSC",
"property": "meter_serial_number",
"type": "text"
},
{
"access": 1,
"description": "Nombre del calendario de precios del proveedor",
"name": "NGTF",
"property": "current_tarif",
"type": "text"
},
{
"access": 1,
"description": "Etiqueta del precio actual del proveedor",
"name": "LTARF",
"property": "current_price",
"type": "text"
},
{
"access": 1,
"description": "Número de índice de la tarifa actual",
"name": "NTARF",
"property": "current_index_tarif",
"type": "numeric"
},
{
"access": 1,
"description": "Versión del protocolo de teleinformación del cliente",
"name": "VTIC",
"property": "software_revision",
"type": "numeric"
},
{
"access": 1,
"description": "Fecha y hora actuales",
"name": "DATE",
"property": "current_date",
"type": "text"
},
{
"access": 1,
"description": "Energía activa total entregada",
"name": "EAST",
"property": "current_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 01)",
"name": "EASF01",
"property": "current_tier1_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 02)",
"name": "EASF02",
"property": "current_tier2_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 03)",
"name": "EASF03",
"property": "current_tier3_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 04)",
"name": "EASF04",
"property": "current_tier4_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 05)",
"name": "EASF05",
"property": "current_tier5_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 06)",
"name": "EASF06",
"property": "current_tier6_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 07)",
"name": "EASF07",
"property": "current_tier7_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 08)",
"name": "EASF08",
"property": "current_tier8_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 09)",
"name": "EASF09",
"property": "current_tier9_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa total entregada por el proveedor (índice 10)",
"name": "EASF10",
"property": "current_tier10_summ_delivered",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa retirada por el distribuidor (índice 01)",
"name": "EASD01",
"property": "active_enerfy_out_d01",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa retirada por el distribuidor (índice 02)",
"name": "EASD02",
"property": "active_enerfy_out_d02",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa retirada por el distribuidor (índice 03)",
"name": "EASD03",
"property": "active_enerfy_out_d03",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Energía activa retirada por el distribuidor (índice 04)",
"name": "EASD04",
"property": "active_enerfy_out_d04",
"type": "numeric",
"unit": "kWh"
},
{
"access": 1,
"description": "Corriente RMS",
"name": "IRMS1",
"property": "rms_current",
"type": "numeric",
"unit": "A"
},
{
"access": 1,
"description": "Voltaje RMS",
"name": "URMS1",
"property": "rms_voltage",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Potencia aparente de referencia",
"name": "PREF",
"property": "available_power",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Registro de estatutos",
"name": "STGE",
"property": "status_register",
"type": "text"
},
{
"access": 1,
"description": "Umbral de potencia aparente",
"name": "PCOUP",
"property": "power_threshold",
"type": "numeric",
"unit": "kVA"
},
{
"access": 1,
"description": "Punto actual de la curva de carga activa dibujada",
"name": "CCASN",
"property": "active_power",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Punto anterior de la curva de carga activa dibujada",
"name": "CCASN-1",
"property": "active_power_ph_b",
"type": "numeric",
"unit": "W"
},
{
"access": 1,
"description": "Voltaje RMS promedio (fase 1)",
"name": "UMOY1",
"property": "average_rms_voltage_meas_period",
"type": "numeric",
"unit": "V"
},
{
"access": 1,
"description": "Potencia aparente entregada inmediata",
"name": "SINSTS",
"property": "apparent_power",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Pico de potencia aparente entregada",
"name": "SMAXN",
"property": "active_power_max",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Potencia aparente máxima". draw-off n-1",
"name": "SMAXN-1",
"property": "drawn_v_a_max_n1",
"type": "numeric",
"unit": "VA"
},
{
"access": 1,
"description": "Mensaje corto",
"name": "MSG1",
"property": "message1",
"type": "text"
},
{
"access": 1,
"description": "Mensaje ultra-corto",
"name": "MSG2",
"property": "message2",
"type": "text"
},
{
"access": 1,
"description": "Número de PRM",
"name": "PRM",
"property": "site_id",
"type": "text"
},
{
"access": 1,
"description": "Punto móvil de inicio 1",
"name": "DPM1",
"property": "start_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Punto móvil de parada 1",
"name": "FPM1",
"property": "stop_mobile_point1",
"type": "numeric"
},
{
"access": 1,
"description": "Punto móvil de inicio 2",
"name": "DPM2",
"property": "start_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Punto móvil de parada 2",
"name": "FPM2",
"property": "stop_mobile_point2",
"type": "numeric"
},
{
"access": 1,
"description": "Punto móvil de inicio 3",
"name": "DPM3",
"property": "start_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"description": "Punto móvil de parada 3",
"name": "FPM3",
"property": "stop_mobile_point3",
"type": "numeric"
},
{
"access": 1,
"name": "RELAIS",
"property": "relais",
"type": "numeric"
},
{
"access": 1,
"description": "Número de día actual del calendario del proveedor",
"name": "NJOURF",
"property": "days_number_current_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Número de día siguiente del calendario del proveedor",
"name": "NJOURF+1",
"property": "days_number_next_calendar",
"type": "numeric"
},
{
"access": 1,
"description": "Perfil del próximo día del calendario del proveedor",
"name": "PJOURF+1",
"property": "days_profile_current_calendar",
"type": "text"
},
{
"access": 1,
"description": "Perfil del próximo día de check-in",
"name": "PPOINTE1",
"property": "days_profile_next_calendar",
"type": "text"
},
{
"access": 1,
"description": "Calidad del enlace (intensidad de la señal)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "ZLinky_TIC",
"options": [
{
"access": 2,
"description": "Este dispositivo no admite la notificación de mediciones eléctricas, por lo que se consulta en su lugar. El intervalo de consulta predeterminado es de 60 segundos, establezca -1 para desactivar.",
"name": "measurement_poll_interval",
"property": "measurement_poll_interval",
"type": "numeric",
"value_min": -1
},
{
"access": 2,
"description": "Contador con TIC en modo estándar o histórico. Puede requerir reinicio (predeterminado: auto)",
"name": "linky_mode",
"property": "linky_mode",
"type": "enum",
"values": ["auto", "historique", "standard"]
},
{
"access": 2,
"description": "Energía con fase única o trifásica. Puede requerir reinicio (predeterminado: auto)",
"name": "energy_phase",
"property": "energy_phase",
"type": "enum",
"values": ["auto", "single_phase", "three_phase"]
},
{
"access": 2,
"description": "Si produce energía de vuelta a la red (solo funciona cuando linky_mode: estándar, predeterminado: auto)",
"name": "production",
"property": "production",
"type": "enum",
"values": ["auto", "true", "false"]
},
{
"access": 2,
"description": "Anula el tarifario actual automático. Esta opción excluirá atributos innecesarios. Abra un problema para admitir más de ellos. Predeterminado: 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": "Número de dígitos después del punto decimal para kWh, entra en vigor en el próximo informe del dispositivo.",
"name": "kWh_precision",
"property": "kWh_precision",
"type": "numeric",
"value_max": 3,
"value_min": 0
},
{
"access": 2,
"description": "Durante la consulta, solicite múltiples exposiciones al Zlinky a la vez para reducir la sobrecarga de la red Zigbee. Demasiadas solicitudes a la vez podrían exceder el límite del dispositivo. Requiere reinicio de Z2M. Predeterminado: 1",
"name": "measurement_poll_chunk",
"property": "measurement_poll_chunk",
"type": "numeric",
"value_min": 1
},
{
"access": 2,
"description": "Lista de comandos TIC a exponer (separados por coma). Reconfigure el dispositivo después del cambio. 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"
}
Vale, en este caso no es el JSON.parse, es un JSON relativamente pequeño que no debería dar problemas.
Ahora hay que probar línea por línea qué es lo que tarda y qué es lo que bloquea.
Puedes añadir en el código:
console.time('nameOfMyTimer');
// El código aquí
console.timeEnd('nameOfMyTimer');
(puedes poner un nombre a cada paso)
Ejecuta individualmente la prueba handleMqttMessage y ves línea por línea qué es lo que más tarda.
Es tedioso, pero bueno, no hay realmente otro método para encontrar soluciones.
No es demasiado violento
2022-06-27T18:32:27+0200 <log> handleMqttMessage.js:22 (Zigbee2mqttManager.handleMqttMessage) Getting config devices from Zigbee2mqtt
Devices map: 0.264ms
Event: 4.241ms
handleMqttMessage: 7.189ms
Gladys bloqueado durante 28.98486499786377ms, operación iniciada aquí: []
EDICIÓN:
Otro con el parse (estaba en modo de batería eco en la prueba anterior)
2022-06-27T18:43:39+0200 <log> handleMqttMessage.js:22 (Zigbee2mqttManager.handleMqttMessage) Getting config devices from Zigbee2mqtt
JSONParse: 0.191ms
Devices map: 0.034ms
Event: 1.049ms
handleMqttMessage: 2.195ms