Comments (1)
More confusing things while looking into this, I tried generated the payload in zhc to see if I could at least get the write to work without messing with herdsman yet.
+ const cluster = Zcl.Utils.getCluster('manuSpecificUbisysDeviceSetup');
+ const attributes = {'inputActions': {elementType: 'octetStr', elements: resultingInputActions}};
+ const payload: {attrId: number; dataType: number; attrData: number| string | boolean}[] = [];
+ for (const [nameOrID, value] of Object.entries(attributes)) {
+ if (cluster.hasAttribute(nameOrID)) {
+ const attribute = cluster.getAttribute(nameOrID);
+ payload.push({attrId: attribute.ID, attrData: value, dataType: attribute.type});
+ } else if (!isNaN(Number(nameOrID))){
+ // NOTE: tsc trisp here, but we take the prev branch
+ //payload.push({attrId: Number(nameOrID), attrData: value.value, dataType: value.type});
+ } else {
+ throw new Error(`Unknown attribute '${nameOrID}', specify either an existing attribute or a number`);
+ }
+ }
+
+ await devMgmtEp.writeStructured(
+ 'manuSpecificUbisysDeviceSetup',
+ payload,
+ manufacturerOptions.ubisysNull,
+ );
+ /*
await devMgmtEp.write(
'manuSpecificUbisysDeviceSetup',
{'inputActions': {elementType: 'octetStr', elements: resultingInputActions}},
manufacturerOptions.ubisysNull,
);
+ */
TSC is very much not happy with this:
src/devices/ubisys.ts:517:65 - error TS2322: Type '{ elementType: string; elements: unknown[]; }' is not assignable to type 'string | number | boolean'.
517 payload.push({attrId: attribute.ID, attrData: value, dataType: attribute.type});
~~~~~~~~
src/devices/ubisys.ts:513:71
513 const payload: {attrId: number; dataType: number; attrData: number| string | boolean}[] = [];
~~~~~~~~
The expected type comes from property 'attrData' which is declared here on type '{ attrId: number; dataType: number; attrData: string | number | boolean; }'
Found 1 error in src/devices/ubisys.ts:517
Which leaves me very confused as the original write passes {'inputActions': {elementType: 'octetStr', elements: resultingInputActions}},
as attributes param to endpoint.write()
and that somehow does work but the code I added was copied from that function 😕
Edit 1:
I think we somehow end up here:
zigbee-herdsman/src/zcl/buffaloZcl.ts
Lines 160 to 167 in 487996a
Which would make sense given this attribute is an array (ZCL data type 0x48) of raw binary data (ZCL data type 0x41).
Somehow for the endpoint.write()
we bypass a tsc check somewhere allowing us to get here which in my hacked attempt to generate the payload in ZHC we hit.
Edit 2:
Completely manually massaging the ZclPayload:
await devMgmtEp.writeStructured(
'manuSpecificUbisysDeviceSetup',
[{attrId: 0x0001, selector: {}, dataType: Zcl.DataType.array, elementData: {elementType: 'octetStr', elements: resultingInputActions}}],
manufacturerOptions.ubisysNull,
);
Seems to work
from zigbee-herdsman.
Related Issues (20)
- Ember driver : Error while parsing received frame, status=NO_RX_SPACE. HOT 1
- Ember driver: SET "APS_UNICAST_MESSAGE_COUNT" TO "32" with status=ERROR_OUT_OF_MEMORY. HOT 1
- State of ZiGate support HOT 17
- [Cluster Type] Align cluster definition for 'name' attribute HOT 1
- zigbee2mqtt<->EZSP incompatible with latest Gecko SDK v4.4.0.0 (EmberZNet 7.4.0.0) firmware build HOT 23
- Waitress timer is being set at the wrong time HOT 16
- Make waitress timeout configurable HOT 1
- Lower bound of "turnsOffAtBrightness1" ignored by "brightness_move" & "brightness_step" commands HOT 1
- Issue with serialport v12 and node > v20.2.0 HOT 1
- Get strange error in latest z2m with the latest zigbee-herdsman HOT 6
- [Task] ZCL definition update HOT 4
- Z2M 1.35.2 stops with "Adapter disconnected, stopping" after few minutes of uptime (Sonoff-E / EZSP v12 / FW 7.3.2.0 build 212) HOT 3
- Load additional manufacturer-specific clusters from device converter HOT 4
- [Proposal] Removal of "forever" Permit Join HOT 11
- Adapters hardware flow control issues HOT 30
- Ikea Motion Sensor E1525/E1745 not updating properly HOT 6
- proposal: deprecation of legacy clicks HOT 1
- Move special readResponse out of zhc/src/index.ts (fixes legrand pairing issues) HOT 8
- Changes to payload when sending zclData to a device breaks iobroker.zigbee function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zigbee-herdsman.