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

MOSZB-140 : Add configurable occupancy endpoints #4731

Closed
wants to merge 5 commits into from

Conversation

sjorge
Copy link
Sponsor Contributor

@sjorge sjorge commented Oct 2, 2022

No description provided.

e.g. the MOSZB-140 has 35 as the default endpoint, most of the config on genBasic, genPowerCfg and ssIasZone are there.
Additionally it uses seperate endpoints for temperature and illumance (40 and 39). It also has 3 (!!) msOccupancySensing endpoints (34, 40, 41), for those we do want to provide a suffix to the property name.

For those we don't really need a suffix for the propery name, having `{default: 35, 'logic_a': 34, 'logic_b': 40, 'logic_c': 41}` mostly works but tempeature now has _undefined appended.
With this change, instead of appending undefined, we just return the original proporty.
@sjorge

This comment was marked as resolved.

@sjorge

This comment was marked as resolved.

@sjorge
Copy link
Sponsor Contributor Author

sjorge commented Oct 2, 2022

Hitting a new problem:

Zigbee2MQTT:error 2022-10-02 16:54:50: Failed to configure '0x0015bc001a0238ec', attempt 1 (Error: Read 0x0015bc001a0238ec/34 msOccupancySensing(["develcoArmThresholdMinTemperature"], {"sendWhen":"active","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4117,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.checkStatus (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:317:28)
    at Endpoint.read (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:480:22)
    at Object.configure (/Users/sjorge/Documents/repos/zigbee-herdsman-converters/devices/develco.js:593:17)
    at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:115:13))

https://www.develcoproducts.com/media/1697/moszb-130-14x-technical-manual-motion-sensor-040721.pdf
image

https://github.com/Koenkk/zigbee-herdsman/blob/371a58547499e0acb5ec475549fb81c9d59ebcb3/src/zcl/definition/cluster.ts#L2560-L2562

I'm sure I added them correctly to herdsman, I also tried reading them without the manufactureCode set but same result as with it set.

@Koenkk
Copy link
Owner

Koenkk commented Oct 3, 2022

It looks good indeed, but maybe we are missing something. Can you make a sniff of just the read request?

@sjorge
Copy link
Sponsor Contributor Author

sjorge commented Oct 4, 2022

It looks good indeed, but maybe we are missing something. Can you make a sniff of just the read request?

Sure, I'll try to grab it this week, busy week ahead so might be in the weekend.

@sjorge
Copy link
Sponsor Contributor Author

sjorge commented Oct 4, 2022

My development coordinator, so not the same key as my production one.

cc:7c:3d:c3:4d:66:28:11:53:dc:54:6c:db:9a:aa:07

This one is it joining without the reading the troublesome attributes:
join_moszb140.pcapng.zip

Here is a read to one of the troublesome attributes: (zbee_nwk.src == 0xad2f || zbee_nwk.dst == 0xad2f)
read_msOccupancySensing.develcoTargetLevel.zip

I did 2 reads, one with specifying the manufacturerCode and one without, I used 2 test converters for this so I can just share the exact code:

        test: {
            key: ['test'],
            convertSet: async (entity, key, value, meta) => {
            },
            convertGet: async (entity, key, meta) => {
                await entity.read('msOccupancySensing', ['develcoTargetLevel'], manufacturerOptions);
            },
        },
        test2: {
            key: ['test2'],
            convertSet: async (entity, key, value, meta) => {
            },
            convertGet: async (entity, key, meta) => {
                await entity.read('msOccupancySensing', ['develcoTargetLevel']);
            },
        },

@Koenkk
Copy link
Owner

Koenkk commented Oct 5, 2022

Everything looks correct to me; the cluster 0x0406, manufcode 0x1015 and attribute 0xfc02. So it looks their docs are either not correct or maybe there are multiple revisions/fws for this device.

@sjorge
Copy link
Sponsor Contributor Author

sjorge commented Oct 5, 2022 via email

sjorge added a commit to sjorge/zigbee-herdsman-converters that referenced this pull request Oct 5, 2022
There was a issue were configure kept failing due to timeouts on reading these.
As show in Koenkk#4731 the tech manual might not be 100%
 accurate. So putting them in a try/catch should at least let the configuration continue settings up everything else.
@sjorge
Copy link
Sponsor Contributor Author

sjorge commented Oct 5, 2022

Closed in favor of #4741, will re-open if I do somehow end up hearing back from develco on this.

@sjorge sjorge closed this Oct 5, 2022
sjorge added a commit to sjorge/zigbee-herdsman-converters that referenced this pull request Oct 5, 2022
There was a issue were configure kept failing due to timeouts on reading these.
As show in Koenkk#4731 the tech manual might not be 100%
 accurate. So putting them in a try/catch should at least let the configuration continue settings up everything else.
Koenkk pushed a commit that referenced this pull request Oct 5, 2022
* utils: postfixWithEndpointName should handle "undefined" better

e.g. the MOSZB-140 has 35 as the default endpoint, most of the config on genBasic, genPowerCfg and ssIasZone are there.
Additionally it uses seperate endpoints for temperature and illumance (40 and 39). It also has 3 (!!) msOccupancySensing endpoints (34, 40, 41), for those we do want to provide a suffix to the property name.

For those we don't really need a suffix for the propery name, having `{default: 35, 'logic_a': 34, 'logic_b': 40, 'logic_c': 41}` mostly works but tempeature now has _undefined appended.
With this change, instead of appending undefined, we just return the original proporty.

* MOSZB-140: cleanup

- drop read of batteryVoltage, reporting configuration does this
- update reporting settings to match with the suggestions from develco
  (esp illumantion was very spanny and battery draining with the defaults)

* MOSZB-140: try/catch on read of develcoAlarmOffDelay/develcoLedControl

There was a issue were configure kept failing due to timeouts on reading these.
As show in #4731 the tech manual might not be 100%
 accurate. So putting them in a try/catch should at least let the configuration continue settings up everything else.
Mephistofeles pushed a commit to Mephistofeles/zigbee-herdsman-converters that referenced this pull request Dec 13, 2022
* utils: postfixWithEndpointName should handle "undefined" better

e.g. the MOSZB-140 has 35 as the default endpoint, most of the config on genBasic, genPowerCfg and ssIasZone are there.
Additionally it uses seperate endpoints for temperature and illumance (40 and 39). It also has 3 (!!) msOccupancySensing endpoints (34, 40, 41), for those we do want to provide a suffix to the property name.

For those we don't really need a suffix for the propery name, having `{default: 35, 'logic_a': 34, 'logic_b': 40, 'logic_c': 41}` mostly works but tempeature now has _undefined appended.
With this change, instead of appending undefined, we just return the original proporty.

* MOSZB-140: cleanup

- drop read of batteryVoltage, reporting configuration does this
- update reporting settings to match with the suggestions from develco
  (esp illumantion was very spanny and battery draining with the defaults)

* MOSZB-140: try/catch on read of develcoAlarmOffDelay/develcoLedControl

There was a issue were configure kept failing due to timeouts on reading these.
As show in Koenkk#4731 the tech manual might not be 100%
 accurate. So putting them in a try/catch should at least let the configuration continue settings up everything else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants