WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

Support even more multiple outlets #240

Closed mrsteakhouse closed 4 years ago

mrsteakhouse commented 4 years ago

Good day,

This is based on this PR: https://github.com/WebThingsIO/zigbee-adapter/pull/124 In regards to this issue https://github.com/WebThingsIO/zigbee-adapter/issues/236 i made some changes to additionally support multiple endpoints on a single device. Also many thanks to @dhylands for doing the hard work. Tested with my local Gateway setup and the Innr RC 110.

When setting the remote to scenes, the on/off button and +/- buttons work, however i did not manage to get the numbered buttons to work. Setting the slider to lights enables the numbered buttons to alter the codes for the top 3 buttons. Each now controls a different property with each on/off and level state. Anyways i'm very happy with the result.

I'm not very fluent with JS so please point out any bad parts.

The classifier log messages:

020-11-02 20:31:57.276 INFO   : zigbee-adapter: ---- Zigbee classifier -----
2020-11-02 20:31:57.276 INFO   : zigbee-adapter:                    modelId = RC 110
2020-11-02 20:31:57.277 INFO   : zigbee-adapter:         seMeteringEndpoint = undefined
2020-11-02 20:31:57.277 INFO   : zigbee-adapter:       haElectricalEndpoint = undefined
2020-11-02 20:31:57.283 INFO   : zigbee-adapter:     genBinaryInputEndpoint = undefined
2020-11-02 20:31:57.283 INFO   : zigbee-adapter:       genLevelCtrlEndpoint = undefined
2020-11-02 20:31:57.283 INFO   : zigbee-adapter: genLevelCtrlOutputEndpoint = [
2020-11-02 20:31:57.283 INFO   : zigbee-adapter:   1, 3, 4, 5,
2020-11-02 20:31:57.284 INFO   : zigbee-adapter:   6, 7, 8
2020-11-02 20:31:57.284 INFO   : zigbee-adapter: ]
2020-11-02 20:31:57.284 INFO   : zigbee-adapter:          genOnOffEndpoints = []
2020-11-02 20:31:57.285 INFO   : zigbee-adapter:     genOnOffOutputEndpoint = [
2020-11-02 20:31:57.285 INFO   : zigbee-adapter:   1, 3, 4, 5,
2020-11-02 20:31:57.285 INFO   : zigbee-adapter:   6, 7, 8
2020-11-02 20:31:57.285 INFO   : zigbee-adapter: ]
2020-11-02 20:31:57.286 INFO   : zigbee-adapter:     hvacFanControlEndpoint = undefined
2020-11-02 20:31:57.286 INFO   : zigbee-adapter:     hvacThermostatEndpoint = undefined
2020-11-02 20:31:57.286 INFO   : zigbee-adapter:           doorLockEndpoint = undefined
2020-11-02 20:31:57.286 INFO   : zigbee-adapter:     lightingContolEndpoint = undefined
2020-11-02 20:31:57.287 INFO   : zigbee-adapter:          colorCapabilities = undefined
2020-11-02 20:31:57.287 INFO   : zigbee-adapter:                  colorMode = undefined
2020-11-02 20:31:57.287 INFO   : zigbee-adapter:          lightLinkEndpoint = 2
2020-11-02 20:31:57.287 INFO   : zigbee-adapter: msOccupancySensingEndpoint = undefined
2020-11-02 20:31:57.288 INFO   : zigbee-adapter:      msTemperatureEndpoint = undefined
2020-11-02 20:31:57.288 INFO   : zigbee-adapter:        genPowerCfgEndpoint = undefined
2020-11-02 20:31:57.288 INFO   : zigbee-adapter:   genDeviceTempCfgEndpoint = undefined
2020-11-02 20:31:57.288 INFO   : zigbee-adapter:                   zoneType = undefined
2020-11-02 20:31:57.289 INFO   : zigbee-adapter: Processing endpoint 0 = 1
2020-11-02 20:31:57.289 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on0 EP:1 CL:0006
2020-11-02 20:31:57.289 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.289 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.290 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level0 EP:1 CL:0008
2020-11-02 20:31:57.294 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.294 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.295 INFO   : zigbee-adapter: Processing endpoint 1 = 3
2020-11-02 20:31:57.295 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on1 EP:3 CL:0006
2020-11-02 20:31:57.295 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.295 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.296 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level1 EP:3 CL:0008
2020-11-02 20:31:57.296 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.297 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.298 INFO   : zigbee-adapter: Processing endpoint 2 = 4
2020-11-02 20:31:57.298 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on2 EP:4 CL:0006
2020-11-02 20:31:57.299 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.299 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.300 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level2 EP:4 CL:0008
2020-11-02 20:31:57.300 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.301 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.302 INFO   : zigbee-adapter: Processing endpoint 3 = 5
2020-11-02 20:31:57.303 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on3 EP:5 CL:0006
2020-11-02 20:31:57.304 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.305 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.305 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level3 EP:5 CL:0008
2020-11-02 20:31:57.306 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.306 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.307 INFO   : zigbee-adapter: Processing endpoint 4 = 6
2020-11-02 20:31:57.308 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on4 EP:6 CL:0006
2020-11-02 20:31:57.308 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.309 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.309 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level4 EP:6 CL:0008
2020-11-02 20:31:57.310 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.310 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.311 INFO   : zigbee-adapter: Processing endpoint 5 = 7
2020-11-02 20:31:57.312 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on5 EP:7 CL:0006
2020-11-02 20:31:57.313 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.313 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.314 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level5 EP:7 CL:0008
2020-11-02 20:31:57.314 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.316 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.317 INFO   : zigbee-adapter: Processing endpoint 6 = 8
2020-11-02 20:31:57.319 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 on6 EP:8 CL:0006
2020-11-02 20:31:57.320 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.320 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: false
2020-11-02 20:31:57.321 INFO   : zigbee-adapter: addProperty: 00158d00017ced47 level6 EP:8 CL:0008
2020-11-02 20:31:57.322 INFO   : zigbee-adapter: addProperty:    fireAndForget: true bindNeeded: false configReportNeeded: false initialReadNeeded: false
2020-11-02 20:31:57.322 INFO   : zigbee-adapter: addProperty:   bindNeeded: true value: 0
2020-11-02 20:31:57.323 INFO   : zigbee-adapter: classify: Initialized as type: undefined name: zb-00158d00017ced47-button defaultName: zb-00158d00017ced47-undefined
mrstegeman commented 4 years ago

@mrsteakhouse just waiting on the one small spacing change.

chas-iot commented 4 years ago

Commit https://github.com/WebThingsIO/zigbee-adapter/commit/4518496ba207cd1649da8512e1c833693869e04e means that the adapter no longer crashes. However, the Tradfri remote control with deviceId = 0820 no longer has a scene property and the scene buttons do not work. Initial debugging indicates that

const genScenesOutputEndpoints =
            node.findZhaEndpointWithOutputClusterIdHex(
              CLUSTER_ID.GENSCENES_HEX);

results in null whereas previous to this PR it did return an end point. I accept that the physical device appears to be buggy as it does not initially report the Cluster Id for Scenes however later it sends messages to that Cluster Id. Which means that a good fix may be difficult. I will look into this as my other commitments allow.

chas-iot commented 4 years ago

@mrsteakhouse @mrstegeman see Zigbee adaptor crashing I'm suggesting that this PR be reverted until the collateral damage is resolved.