WebThingsIO / zigbee-adapter

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

Separate Class property for contact sensor #321

Open supby opened 2 years ago

supby commented 2 years ago

PR contains:

supby commented 2 years ago

@dhylands @lightsofapollo @mrstegeman @flatsiedatsie could somebody take a look on the PR? :)

flatsiedatsie commented 2 years ago

I don't really work on this addon, I work on the Zigbee2MQTT one instead.

supby commented 2 years ago

I'm using this addon exactly with z2m to show data from mqtt.

flatsiedatsie commented 2 years ago

Sorry for the confusion: I'm talking about the Zigbee2MQTT addon (which comes with Z2M built-in, but can also be used with external Z2M).

I did take a quick look at your code and noticed that the first commit seems to change all the code (perhaps an indentation issue), which made it difficult to see what had changed there. Adding this 'reversability' feature seems to be the main change?

You also moved some code into separate files?

supby commented 1 year ago

@flatsiedatsie Sorry for so late answer :) Yes the PR introduces main two things:

  1. Structure code to the separate files
  2. Introduce new Meta property "ContactProperty" as reverse of OpenProperty. With OpenProperty aquara door sensors were open in closed (contact) state.

I tried to use https://github.com/kabbi/zigbee2mqtt-adapter adapter but seems it is to complex for my needs. I just need to interpret z2m messages to webthings. zigbee2mqtt-adapter didn't work for me.