Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
120 passing (1m)
8 failing
1) zigbee2mqtt getDiscoveredDevices
get discovered devices:
AssertionError: expected [ Array(3) ] to deeply equal [ Array(4) ]
+ expected - actual
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee"
"should_poll": false
}
{
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740"
"features": [
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif"
+ "category": "battery"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:battery:integer:battery"
"has_feedback": false
- "max": 10000
+ "max": 100
"min": 0
- "name": "Current index tarif"
+ "name": "Battery"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif"
- "type": "index"
- "unit": [null]
+ "selector": "zigbee2mqtt-0x00158d00045b2740-battery-integer-battery"
+ "type": "integer"
+ "unit": "percent"
}
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered"
+ "category": "temperature-sensor"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:temperature-sensor:decimal:temperature"
"has_feedback": false
- "max": 1000000
- "min": 0
- "name": "Current summ delivered"
+ "max": 150
+ "min": -100
+ "name": "Temperature"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered"
- "type": "index"
- "unit": "kilowatt-hour"
+ "selector": "zigbee2mqtt-0x00158d00045b2740-temperature-sensor-decimal-temperature"
+ "type": "decimal"
+ "unit": "celsius"
}
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered"
+ "category": "humidity-sensor"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:humidity-sensor:decimal:humidity"
"has_feedback": false
- "max": 1000000
+ "max": 100
"min": 0
- "name": "Current tier1 summ delivered"
+ "name": "Humidity"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered" - "type": "index"
- "unit": "kilowatt-hour"
+ "selector": "zigbee2mqtt-0x00158d00045b2740-humidity-sensor-decimal-humidity"
+ "type": "decimal"
+ "unit": "percent"
}
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered"
- "has_feedback": false
- "max": 1000000
+ "category": "siren"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:siren:binary:alarm"
+ "has_feedback": true
+ "max": 1
"min": 0
- "name": "Current tier2 summ delivered"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered" - "type": "index"
- "unit": "kilowatt-hour"
+ "name": "Alarm"
+ "read_only": false
+ "selector": "zigbee2mqtt-0x00158d00045b2740-siren-binary-alarm"
+ "type": "binary"
+ "unit": [null]
}
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier7_summ_delivered"
+ "category": "pressure-sensor"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:pressure-sensor:decimal:pressure"
"has_feedback": false
- "max": 1000000
+ "max": 10000
"min": 0
- "name": "Current tier7 summ delivered"
+ "name": "Pressure"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier7-summ-delivered" - "type": "index"
- "unit": "kilowatt-hour"
+ "selector": "zigbee2mqtt-0x00158d00045b2740-pressure-sensor-decimal-pressure"
+ "type": "decimal"
+ "unit": "hPa"
}
{
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier8_summ_delivered"
+ "category": "switch"
+ "external_id": "zigbee2mqtt:0x00158d00045b2740:switch:voltage:voltage"
"has_feedback": false
- "max": 1000000
+ "max": 10000
"min": 0
- "name": "Current tier8 summ delivered"
+ "name": "Voltage"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier8-summ-delivered" - "type": "index"
- "unit": "kilowatt-hour"
+ "selector": "zigbee2mqtt-0x00158d00045b2740-switch-voltage-voltage"
+ "type": "voltage"
+ "unit": "millivolt"
}
+ ]
+ "model": "WSDCGQ11LM"
+ "name": "0x00158d00045b2740"
+ "service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee"
+ "should_poll": false
+ }
+ {
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0"
+ "features": [
{
"category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier9_summ_delivered"
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif"
"has_feedback": false
- "max": 1000000
+ "max": 10000
"min": 0
- "name": "Current tier9 summ delivered"
+ "name": "Numéro tarif"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier9-summ-delivered" + "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif"
"type": "index"
"unit": "kilowatt-hour"
}
{
"category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier10_summ_delivered"
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power"
"has_feedback": false
- "max": 1000000
+ "max": 10000
"min": 0
- "name": "Current tier10 summ delivered"
+ "name": "Puissance apprente"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier10-summ-delivered"
- "type": "index"
- "unit": "kilowatt-hour"
+ "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power"
+ "type": "power"
+ "unit": "volt-ampere"
}
{
"category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d01"
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered"
"has_feedback": false
"max": 1000000
"min": 0
- "name": "Active enerfy out d01"
+ "name": "Index Total"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d01"
+ "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered"
"type": "index"
"unit": "kilowatt-hour"
}
{
"category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d02"
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered"
"has_feedback": false
"max": 1000000
"min": 0
- "name": "Active enerfy out d02"
+ "name": "Heures creuses"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d02"
+ "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered" "type": "index"
"unit": "kilowatt-hour"
}
{
"category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d03"
+ "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered"
"has_feedback": false
"max": 1000000
"min": 0
- "name": "Active enerfy out d03"
+ "name": "Heures pleines"
"read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d03"
+ "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered" "type": "index"
"unit": "kilowatt-hour"
}
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d04"
- "has_feedback": false
- "max": 1000000
- "min": 0
- "name": "Active enerfy out d04"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d04"
- "type": "index"
- "unit": "kilowatt-hour"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:rms_current"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Rms current"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-rms-current"
- "type": "current"
- "unit": "ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:voltage:rms_voltage"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Rms voltage"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-voltage-rms-voltage"
- "type": "voltage"
- "unit": "volt"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:available_power"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Available power"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-available-power"
- "type": "current"
- "unit": "kilovolt-ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:power_threshold"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Power threshold"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-power-threshold"
- "type": "current"
- "unit": "kilovolt-ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Active power"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power"
- "type": "power"
- "unit": "watt"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power_ph_b"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Active power ph b"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power-ph-b"
- "type": "power"
- "unit": "watt"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:voltage:average_rms_voltage_meas_period"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Average rms voltage meas period"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-voltage-average-rms-voltage-meas-period"
- "type": "voltage"
- "unit": "volt"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Apparent power"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power"
- "type": "power"
- "unit": "volt-ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power_max"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Active power max"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power-max"
- "type": "power"
- "unit": "volt-ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:drawn_v_a_max_n1"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Drawn v a max n1"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-drawn-v-a-max-n1"
- "type": "power"
- "unit": "volt-ampere"
- }
- {
- "category": "energy-sensor"
- "external_id": "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:binary:relais"
- "has_feedback": false
- "max": 10000
- "min": 0
- "name": "Relais"
- "read_only": true
- "selector": "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-binary-relais"
- "type": "binary"
- "unit": [null]
- }
]
"model": "ZLinky_TIC"
"name": "0x00158d0005d29aa0"
"service_id": "f87b7af2-ca8e-44fc-b754-444354b42fee"
at Context.<anonymous> (test/services/zigbee2mqtt/lib/getDiscoveredDevices.test.js:52:26)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
2) zigbee2mqtt handleMqttMessage
it should receive devices:
AssertError: expected emit to be called with arguments
Call 1:
websocket.send-all
{ type: "zigbee2mqtt.status-change" } {
payload: [{
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,
updatable: true
}, {
external_id: "zigbee2mqtt:0x00158d0004019127",
features: [{
category: "battery",
external_id: "zigbee2mqtt:0x00158d0004019127:battery:integer:battery",
has_feedback: false,
max: 100,
min: 0,
name: "Battery",
read_only: true,
selector: "zigbee2mqtt-0x00158d0004019127-battery-integer-battery",
type: "integer",
unit: "percent"
}, {
category: "switch",
external_id: "zigbee2mqtt:0x00158d0004019127:switch:voltage:voltage",
has_feedback: false,
max: 10000,
min: 0,
name: "Voltage",
read_only: true,
selector: "zigbee2mqtt-0x00158d0004019127-switch-voltage-voltage",
type: "voltage",
unit: "millivolt"
}],
model: "WXKG11LM",
name: "0x00158d0004019127",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}, {
external_id: "zigbee2mqtt:0x00158d00045b2740",
features: [{
category: "battery",
external_id: "zigbee2mqtt:0x00158d00045b2740:battery:integer:battery",
has_feedback: false,
max: 100,
min: 0,
name: "Battery",
read_only: true,
selector: "zigbee2mqtt-0x00158d00045b2740-battery-integer-battery",
type: "integer",
unit: "percent"
}, {
category: "temperature-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:temperature-sensor:decimal:temperature",
has_feedback: false,
max: 150,
min: -100,
name: "Temperature",
read_only: true,
selector: "zigbee2mqtt-0x00158d00045b2740-temperature-sensor-decimal-temperature",
type: "decimal",
unit: "celsius"
}, {
category: "humidity-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:humidity-sensor:decimal:humidity",
has_feedback: false,
max: 100,
min: 0,
name: "Humidity",
read_only: true,
selector: "zigbee2mqtt-0x00158d00045b2740-humidity-sensor-decimal-humidity",
type: "decimal",
unit: "percent"
}, {
category: "siren",
external_id: "zigbee2mqtt:0x00158d00045b2740:siren:binary:alarm",
has_feedback: true,
max: 1,
min: 0,
name: "Alarm",
read_only: false,
selector: "zigbee2mqtt-0x00158d00045b2740-siren-binary-alarm",
type: "binary",
unit: null
}, {
category: "pressure-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:pressure-sensor:decimal:pressure",
has_feedback: false,
max: 10000,
min: 0,
name: "Pressure",
read_only: true,
selector: "zigbee2mqtt-0x00158d00045b2740-pressure-sensor-decimal-pressure",
type: "decimal",
unit: "hPa"
}, {
category: "switch",
external_id: "zigbee2mqtt:0x00158d00045b2740:switch:voltage:voltage",
has_feedback: false,
max: 10000,
min: 0,
name: "Voltage",
read_only: true,
selector: "zigbee2mqtt-0x00158d00045b2740-switch-voltage-voltage",
type: "voltage",
unit: "millivolt"
}],
model: "WSDCGQ11LM",
name: "0x00158d00045b2740",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}, {
external_id: "zigbee2mqtt:0x00158d0005d29aa0",
features: [{
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif",
has_feedback: false,
max: 10000,
min: 0,
name: "Numéro tarif",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power",
has_feedback: false,
max: 10000,
min: 0,
name: "Puissance apprente",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power",
type: "power",
unit: "volt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Index Total",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Heures creuses",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Heures pleines",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}],
model: "ZLinky_TIC",
name: "0x00158d0005d29aa0",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}],
type: "zigbee2mqtt.discover"
}
Call 2:
websocket.send-all
{
payload: [{
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,
updatable: true
}, {
external_id: "zigbee2mqtt:0x00158d0004019127",
features: [{
category: "battery",
external_id: "zigbee2mqtt:0x00158d0004019127:battery:integer:battery",
has_feedback: false,
max: 100,
min: 0,
name: "Battery",
read_only: true,
selector: "zigbee2mqtt-0x00158d0004019127-battery-integer-battery",
type: "integer",
unit: "percent"
}, {
category: "switch",
external_id: "zigbee2mqtt:0x00158d0004019127:switch:voltage:voltage",
has_feedback: false,
max: 10000,
min: 0,
name: "Voltage",
read_only: true,
selector: "zigbee2mqtt-0x00158d0004019127-switch-voltage-voltage",
type: "voltage",
unit: "millivolt"
}],
model: "WXKG11LM",
name: "0x00158d0004019127",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}, {
external_id: "zigbee2mqtt:0x00158d0005d29aa0",
external_id: "zigbee2mqtt:0x00158d00045b2740",
features: [{
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif",
category: "battery",
external_id: "zigbee2mqtt:0x00158d00045b2740:battery:integer:battery",
has_feedback: false,
max: 10000,
max: 100,
min: 0,
name: "Current index tarif",
name: "Battery",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif",
type: "index",
unit: null
selector: "zigbee2mqtt-0x00158d00045b2740-battery-integer-battery",
type: "integer",
unit: "percent"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered",
category: "temperature-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:temperature-sensor:decimal:temperature",
has_feedback: false,
max: 1000000,
min: 0,
name: "Current summ delivered",
max: 150,
min: -100,
name: "Temperature",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered",
type: "index",
unit: "kilowatt-hour"
selector: "zigbee2mqtt-0x00158d00045b2740-temperature-sensor-decimal-temperature",
type: "decimal",
unit: "celsius"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered",
category: "humidity-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:humidity-sensor:decimal:humidity",
has_feedback: false,
max: 1000000,
max: 100,
min: 0,
name: "Current tier1 summ delivered",
name: "Humidity",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered",
type: "index",
unit: "kilowatt-hour"
selector: "zigbee2mqtt-0x00158d00045b2740-humidity-sensor-decimal-humidity",
type: "decimal",
unit: "percent"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered",
has_feedback: false,
max: 1000000,
category: "siren",
external_id: "zigbee2mqtt:0x00158d00045b2740:siren:binary:alarm",
has_feedback: true,
max: 1,
min: 0,
name: "Current tier2 summ delivered",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered",
type: "index",
unit: "kilowatt-hour"
name: "Alarm",
read_only: false,
selector: "zigbee2mqtt-0x00158d00045b2740-siren-binary-alarm",
type: "binary",
unit: null
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier7_summ_delivered",
category: "pressure-sensor",
external_id: "zigbee2mqtt:0x00158d00045b2740:pressure-sensor:decimal:pressure",
has_feedback: false,
max: 1000000,
max: 10000,
min: 0,
name: "Current tier7 summ delivered",
name: "Pressure",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier7-summ-delivered",
type: "index",
unit: "kilowatt-hour"
selector: "zigbee2mqtt-0x00158d00045b2740-pressure-sensor-decimal-pressure",
type: "decimal",
unit: "hPa"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier8_summ_delivered",
category: "switch",
external_id: "zigbee2mqtt:0x00158d00045b2740:switch:voltage:voltage",
has_feedback: false,
max: 1000000,
max: 10000,
min: 0,
name: "Current tier8 summ delivered",
name: "Voltage",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier8-summ-delivered",
type: "index",
unit: "kilowatt-hour"
selector: "zigbee2mqtt-0x00158d00045b2740-switch-voltage-voltage",
type: "voltage",
unit: "millivolt"
}],
model: "WSDCGQ11LM",
name: "0x00158d00045b2740",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}, {
external_id: "zigbee2mqtt:0x00158d0005d29aa0",
features: [{
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier9_summ_delivered",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_index_tarif",
has_feedback: false,
max: 1000000,
max: 10000,
min: 0,
name: "Current tier9 summ delivered",
name: "Numéro tarif",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier9-summ-delivered",
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-index-tarif",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier10_summ_delivered",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power",
has_feedback: false,
max: 1000000,
max: 10000,
min: 0,
name: "Current tier10 summ delivered",
name: "Puissance apprente",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier10-summ-delivered",
type: "index",
unit: "kilowatt-hour"
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power",
type: "power",
unit: "volt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d01",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Active enerfy out d01",
name: "Index Total",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d01",
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d02",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier1_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Active enerfy out d02",
name: "Heures creuses",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d02",
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier1-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d03",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:current_tier2_summ_delivered",
has_feedback: false,
max: 1000000,
min: 0,
name: "Active enerfy out d03",
name: "Heures pleines",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d03",
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-current-tier2-summ-delivered",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:index:active_enerfy_out_d04",
has_feedback: false,
max: 1000000,
min: 0,
name: "Active enerfy out d04",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-index-active-enerfy-out-d04",
type: "index",
unit: "kilowatt-hour"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:rms_current",
has_feedback: false,
max: 10000,
min: 0,
name: "Rms current",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-rms-current",
type: "current",
unit: "ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:voltage:rms_voltage",
has_feedback: false,
max: 10000,
min: 0,
name: "Rms voltage",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-voltage-rms-voltage",
type: "voltage",
unit: "volt"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:available_power",
has_feedback: false,
max: 10000,
min: 0,
name: "Available power",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-available-power",
type: "current",
unit: "kilovolt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:current:power_threshold",
has_feedback: false,
max: 10000,
min: 0,
name: "Power threshold",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-current-power-threshold",
type: "current",
unit: "kilovolt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power",
has_feedback: false,
max: 10000,
min: 0,
name: "Active power",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power",
type: "power",
unit: "watt"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power_ph_b",
has_feedback: false,
max: 10000,
min: 0,
name: "Active power ph b",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power-ph-b",
type: "power",
unit: "watt"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:voltage:average_rms_voltage_meas_period",
has_feedback: false,
max: 10000,
min: 0,
name: "Average rms voltage meas period",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-voltage-average-rms-voltage-meas-period",
type: "voltage",
unit: "volt"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:apparent_power",
has_feedback: false,
max: 10000,
min: 0,
name: "Apparent power",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-apparent-power",
type: "power",
unit: "volt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:active_power_max",
has_feedback: false,
max: 10000,
min: 0,
name: "Active power max",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-active-power-max",
type: "power",
unit: "volt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:power:drawn_v_a_max_n1",
has_feedback: false,
max: 10000,
min: 0,
name: "Drawn v a max n1",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-power-drawn-v-a-max-n1",
type: "power",
unit: "volt-ampere"
}, {
category: "energy-sensor",
external_id: "zigbee2mqtt:0x00158d0005d29aa0:energy-sensor:binary:relais",
has_feedback: false,
max: 10000,
min: 0,
name: "Relais",
read_only: true,
selector: "zigbee2mqtt-0x00158d0005d29aa0-energy-sensor-binary-relais",
type: "binary",
unit: null
}],
model: "ZLinky_TIC",
name: "0x00158d0005d29aa0",
service_id: "f87b7af2-ca8e-44fc-b754-444354b42fee",
should_poll: false
}],
type: "zigbee2mqtt.discover"
}
at Object.fail (node_modules/sinon/lib/sinon/assert.js:106:21)
at failAssertion (node_modules/sinon/lib/sinon/assert.js:65:16)
at Object.assert.<computed> [as calledWith] (node_modules/sinon/lib/sinon/assert.js:91:13)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/handleMqttMessage.test.js:58:12)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
3) zigbee2mqtt handleMqttMessage
SPAM TEST:
expected emit to be called once but was called thrice
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67287,
Symbol(trigger_async_id_symbol): 67285,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (/home/vonox/repos/GladysFork/server/services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67293,
Symbol(trigger_async_id_symbol): 67290,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (/home/vonox/repos/GladysFork/server/services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67297,
Symbol(trigger_async_id_symbol): 67296,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (/home/vonox/repos/GladysFork/server/services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
AssertError: expected emit to be called once but was called thrice
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67287,
Symbol(trigger_async_id_symbol): 67285,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67293,
Symbol(trigger_async_id_symbol): 67290,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
emit(websocket.send-all, { type: "zigbee2mqtt.status-change" }) => [Promise] {
Symbol(async_id_symbol): 67297,
Symbol(trigger_async_id_symbol): 67296,
Symbol(destroyed): { destroyed: false }
} at Zigbee2mqttManager.handleMqttMessage (services/zigbee2mqtt/lib/handleMqttMessage.js:15:21)
at Object.fail (node_modules/sinon/lib/sinon/assert.js:106:21)
at failAssertion (node_modules/sinon/lib/sinon/assert.js:65:16)
at Object.assert.<computed> [as calledOnce] (node_modules/sinon/lib/sinon/assert.js:91:13)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/handleMqttMessage.test.js:199:12)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
4) zigbee2mqtt readValue
should throw an error, mapping not found:
AssertionError: expected 'Zigbee2mqqt expose not found on device "0x00158d00045b2740" with property "alarm".' to equal 'Zigbee2mqqt don\'t handle value "ON" for property "alarm".'
+ expected - actual
-Zigbee2mqqt expose not found on device "0x00158d00045b2740" with property "alarm".
+Zigbee2mqqt don't handle value "ON" for property "alarm".
at Context.<anonymous> (test/services/zigbee2mqtt/lib/readValue.test.js:37:14)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
5) zigbee2mqtt readValue
should return binary 1:
Error: Zigbee2mqqt expose not found on device "0x00158d00045b2740" with property "alarm".
at Zigbee2mqttManager.readValue (services/zigbee2mqtt/lib/readValue.js:16:11)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/readValue.test.js:42:46)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
6) zigbee2mqtt readValue
should return binary 0:
Error: Zigbee2mqqt expose not found on device "0x00158d00045b2740" with property "alarm".
at Zigbee2mqttManager.readValue (services/zigbee2mqtt/lib/readValue.js:16:11)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/readValue.test.js:47:46)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
7) zigbee2mqtt setValue
set value good topic ON:
Error: Zigbee2mqtt expose not found: "zigbee2mqtt:0x00158d00045b2740:switch:binary:alarm" with property "alarm"
at Zigbee2mqttManager.setValue (services/zigbee2mqtt/lib/setValue.js:38:11)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/setValue.test.js:112:37)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
8) zigbee2mqtt setValue
set value good topic OFF:
Error: Zigbee2mqtt expose not found: "zigbee2mqtt:0x00158d00045b2740:switch:binary:alarm" with property "alarm"
at Zigbee2mqttManager.setValue (services/zigbee2mqtt/lib/setValue.js:38:11)
at Context.<anonymous> (test/services/zigbee2mqtt/lib/setValue.test.js:117:37)
at processImmediate (internal/timers.js:464:21)
at process.callbackTrampoline (internal/async_hooks.js:130:17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment