Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'includes') #23335

Open
janivr opened this issue Jul 13, 2024 · 12 comments
Labels
problem Something isn't working

Comments

@janivr
Copy link

janivr commented Jul 13, 2024

What happened?

"z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'includes')"
Suddenly, my device stopped working and I get this error for any action on the device.

`const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
//const extend = require('zigbee-herdsman-converters/lib/extend');
const modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
// Since a lot of TuYa devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: 'TS0601',
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
manufacturerName: '_TZE200_7a5ob7xq',
},
],
//zigbeeModel: ['TS0601'],
model: 'TS0601_new',
vendor: 'Tuya',
description: 'Uri Curtain Switch plus Lights', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
//extend: [],
//fromZigbee: [fz.ignore_basic_report, fz.tuya_switch],
//toZigbee: [tz.tuya_switch_state],
fromZigbee: [tuya.fz.datapoints], // We will add this later
toZigbee: [tuya.fz.datapoints], // Should be empty, unless device can be controlled (e.g. lights, switches).
//fromZigbee: [tuya.fzDataPoints],
//toZigbee: [tuya.tzDataPoints],
onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
configure: tuya.configureMagicPacket,
exposes: [
// Here you should put all functionality that your device exposes
e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET)
],

meta: {
    // All datapoints go in here
    tuyaDatapoints: [
    ],
},

//meta: {multiEndpoint: true},
//exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
//        e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
//        e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),
//        e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET)], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
//endpoint: (device) => {
//        // Endpoint selection is made in tuya_switch_state
//        return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1};
//    },

};

module.exports = definition;

`

What did you expect to happen?

my device will work, all 4 actions.

How to reproduce it (minimal and precise)

happens all time

Zigbee2MQTT version

1.39.0

Adapter firmware version

20220219

Adapter

sonoff

Setup

home assistant

Debug log

[2024-07-13 14:39:45] debug: z2m:mqtt: Received MQTT message on 'zigbee2mqtt/0x04cd15fffefb6680/set' with data '{"state_l1":"ON"}'
[2024-07-13 14:39:45] error: z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'includes')
[2024-07-13 14:39:45] debug: z2m: TypeError: Cannot read properties of undefined (reading 'includes')
at /app/lib/extension/publish.ts:232:60
at Array.find ()
at Publish.onMQTTMessage (/app/lib/extension/publish.ts:232:42)
at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:23)
at EventEmitter.emit (node:events:529:35)
at EventBus.emitMQTTMessage (/app/lib/eventBus.ts:115:22)
at MQTT.onMessage (/app/lib/mqtt.ts:147:27)
at WebSocket. (/app/lib/extension/frontend.ts:138:27)
at WebSocket.emit (node:events:517:28)
at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:1211:20)
[2024-07-13 14:39:46] debug: zh:zstack:unpi:parser: <-- [254,25,68,129,0,0,10,0,69,194,1,1,0,43,0,43,147,114,0,0,5,0,246,0,7,0,69,194,29,222]

@janivr janivr added the problem Something isn't working label Jul 13, 2024
@janivr
Copy link
Author

janivr commented Aug 1, 2024

Hello,
When will I get an answer or help?
Thanks

@janivr
Copy link
Author

janivr commented Aug 4, 2024

Still Exists

@janivr
Copy link
Author

janivr commented Aug 5, 2024

Please help

@mremedi2023
Copy link

Same here

@KoKolaj
Copy link

KoKolaj commented Sep 2, 2024

After today's update - 1.40.0-1

[2024-09-02 17:36:39] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:36:49] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:37:00] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:37:27] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:37:39] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:38:06] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:38:21] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:38:33] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:39:03] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-02 17:39:19] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')

@janivr
Copy link
Author

janivr commented Sep 2, 2024 via email

@hoskerism
Copy link

Same here. Every device reporting:
EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')

Started after upgrading yesterday.

@maddoglee
Copy link

I get this error as well

@rafapoch
Copy link

rafapoch commented Sep 3, 2024

running version 1.40.0 getting the same issue

@Domochip
Copy link

Domochip commented Sep 3, 2024

Having the same error using ZDMS16-1 from Avatto (I've just received it and pair it)

I can control the brightness and the on/off successfully but get the error message for every action done

z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')

Here is my z2m relevant infos:
Zigbee2MQTT version: 1.40.0 commit: 6fa1dab
Coordinator type: zStack3x0
Coordinator revision: 20240315

more details with debug log level:

[2024-09-03 12:49:41] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/dimmer1', payload '{"brightness":152,"countdown":null,"linkquality":131,"max_brightness":255,"min_brightness":1,"power_on_behavior":"previous","state":"OFF","switch_type":"toggle"}'
[2024-09-03 12:49:41] error: 	z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-03 12:49:41] debug: 	z2m: TypeError: Cannot read properties of undefined (reading 'some')
    at /app/lib/extension/publish.ts:326:95
    at Array.some (<anonymous>)
    at /app/lib/extension/publish.ts:326:77
    at Array.some (<anonymous>)
    at Publish.onMQTTMessage (/app/lib/extension/publish.ts:326:61)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:17)

@KoKolaj
Copy link

KoKolaj commented Sep 3, 2024

#23821

@silkyclouds
Copy link

yep, same here

[2024-09-05 21:17:51] error: z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')
[2024-09-05 21:17:51] error: z2m: EventBus error 'Publish/mqttMessage': Cannot read properties of undefined (reading 'some')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants