Git Product home page Git Product logo

homebridge-z2m's Introduction

Homebridge x Zigbee2MQTT

homebridge-z2m

verified-by-homebridge NPM Latest version NPM Next/future version NPM Downloads GitHub Checks status

Expose your Zigbee devices to HomeKit with ease, by integrating 🐝 Zigbee2MQTT with 🏠 Homebridge (via an MQTT message broker).

This Homebridge plugin can be installed using npm install homebridge-z2m or via the Homebridge Config UI X plugin.

The bare minimum configuration for this plugin only has to contain the MQTT server information:

{
   "platform": "zigbee2mqtt",
   "mqtt": {
      "base_topic": "zigbee2mqtt",
      "server": "mqtt://localhost:1883"
   }
}

After adding this to your configuration and restarting Homebridge, it should automatically retrieve all the required information about the devices from Zigbee2MQTT (via the configured MQTT server).

For more information on installing, configuring and using the plugin, please check the documentation on the plugin website.

Need help?

Homebridge Discord

If you have a question or run into a problem, please ask a question in the #z2m channel on the Homebridge Discord. I also try to check the homebridge subreddit for Zigbee and Zigbee2MQTT every now and then (but you'll probably get a faster answer on Discord).

Contribute

This project is open to contributions. Please read the CONTRIBUTING.md file for more information.

homebridge-z2m's People

Contributors

augustskare avatar dependabot[bot] avatar github-actions[bot] avatar itavero avatar janikmu avatar jkimbo avatar jonathonlacher avatar lgtm-com[bot] avatar michaelkrog avatar night199uk avatar pierrepinon avatar zegl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homebridge-z2m's Issues

[Device] Support for climate devices (thermostats / radiator valves)

Given that several people are requesting support for climate devices, I decided to make one central issue to discuss the implementation and post updates.

Related issues on GitHub:

  • #32 Thermostat like the Eurotronics ones
  • #37 Immax 07703L Radiator valve
  • #39 Tuya Thermostat valve

It seems that these devices are best mapped as a Thermostat service. In #32, @sjorge shared the mapping he uses in node-red.

Implementing a Service Handler for climate devices will probably bring support for the following devices (and their white label variants) to this plugin:

[Device] Tuya Thermostat valve

Dear itavero,
First of all, I should thank you very much for your kind effort. I appretite your work. Is there any way to help you with new devices? you can not buy all of them, however we have some, is there any way to share the data of them with you, or help for coding? Or if you can invent the structure that any one can establish a connection and add new device, would be great. we have specefic type of zigbees and with your kind work, all of them could work.

my next offer is the pairing button and reset button. isn't better to add new button in homebridge to reset and/or pair new devices?

By the way, I have new Tuya thermostat that z2m recognize it as curtain :)

Improve documentation

Initially I started to put the keys that should work in the README, but given that this list is growing, I think it is becoming less convenient.

I think it should be a separate page, with the used keys listed per HomeKit service (and the characteristic they map too).

I want to help you :)

Hi man, I want to help you, (I was on my way to create this plugin then I found you already did it :D)

what do you want to improve in codebase / roadmap?

I will fix Typescript definition for sure for you :)

Let me know what do you think

Will there be support for vima smart door lock

Device description
Which device would you like to be supported in this plugin?

Supported in Zigbee2MQTT?
Is this device already supported by Zigbee2MQTT / zigbee-herdsman-converters?
If this is NOT the case, please add support for the device there first.
Read there manual on How to support new devices for more information.
If this is the case, please provide the version in which support is present/added.

Device model / Exposes information
Provide the device model (also known as exposes information) for this particular device, as published to zigbee2mqtt/bridge/devices by Zigbee2MQTT.

please put the device model JSON in this code block

Missing features/functionality
Please describe the features/functionality of this device that are currently not exposed to HomeKit via this plugin.

Suggested services and characteristics
For each of the missing features, please mention to which HomeKit Services and Characteristics it should be mapped.
The Homebridge Plugin Development documentation provides a nice overview of the standard HomeKit services and characteristics.
Note that some manufacturers also use custom services and characteristics (the Elgato Eve products for instance), which could also be mimicked if they have been reverse engineered.

[Device] Immax 07703L Radiator valve

Hey! Thanks for awesome project, first of all I would like to say I'm super newbie in this one. I just bought Raspberry Pi 4 B and https://slae.sh/projects/cc2652/ and I decided to play with it. I tried some Ikea bulb I found around and works fine (I had to post initial message manually to get recognized properly, but I know you are looking into it – not a big deal)

I would say I have capabilities to make this contribution on my own, but would be great if you/someone can guide me. How does it sound? Can we hop on call?


Device description
Which device would you like to be supported in this plugin?

Immax 07703L Radiator valve

Supported in zigbee2mqtt?

Device model / Exposes information

"definition": {
      "description": "Radiator valve",
      "exposes": [
        {
          "access": 1,
          "description": "Indicates if the battery of this device is almost empty",
          "name": "battery_low",
          "property": "battery_low",
          "type": "binary",
          "value_off": false,
          "value_on": true
        },
        {
          "features": [
            {
              "access": 7,
              "description": "Enables/disables physical input on the device",
              "name": "state",
              "property": "child_lock",
              "type": "binary",
              "value_off": "UNLOCK",
              "value_on": "LOCK"
            }
          ],
          "type": "lock"
        },
        {
          "features": [
            {
              "access": 7,
              "description": "Temperature setpoint",
              "name": "current_heating_setpoint",
              "property": "current_heating_setpoint",
              "type": "numeric",
              "unit": "°C",
              "value_max": 35,
              "value_min": 5,
              "value_step": 0.5
            },
            {
              "access": 5,
              "description": "Current temperature measured on the device",
              "name": "local_temperature",
              "property": "local_temperature",
              "type": "numeric",
              "unit": "°C"
            },
            {
              "access": 7,
              "description": "Mode of this device",
              "name": "system_mode",
              "property": "system_mode",
              "type": "enum",
              "values": ["off", "heat", "auto"]
            },
            {
              "access": 5,
              "description": "The current running state",
              "name": "running_state",
              "property": "running_state",
              "type": "enum",
              "values": ["idle", "heat"]
            },
            {
              "access": 7,
              "description": "Away mode",
              "name": "away_mode",
              "property": "away_mode",
              "type": "binary",
              "value_off": "OFF",
              "value_on": "ON"
            }
          ],
          "type": "climate"
        },
        {
          "access": 1,
          "description": "Link quality (signal strength)",
          "name": "linkquality",
          "property": "linkquality",
          "type": "numeric",
          "unit": "lqi",
          "value_max": 255,
          "value_min": 0
        }
      ],
      "model": "07703L",
      "vendor": "Immax"
    },

Missing features/functionality

Everyting AFIK – it acts as unsupported device

Suggested services and characteristics

I don't have experiences with smart valves but I would expect:

  • Temperature
  • Valve

[Bug] Aqara Temperature and Humidity Sensor - "Not supported" on Homekit

Hi there,

I just got one of the Temperature sensors for my home and Homekit says that it's not supported.
https://www.aqara.com/us/temperature_humidity_sensor.html

Zigbee2MQTT: https://www.zigbee2mqtt.io/devices/WSDCGQ11LM.html

From zigbee2mqtt.service:
MQTT publish: topic 'zigbee2mqtt/Aqara TempHumidity Sensor', payload '{"battery":100,"humidity":47.95,"linkquality":39,"pressure":1003.9,"temperature":28.06,"voltage":3225}'

Is it possible to add this so that it shows on Homekit as Humidity, Pressure and Temperature?

Thanks for all that you do!

[Bug] TS0601: Duplicate service handler

I'm very happy with this plugin. Very helpful en useful.
Currently I'm using several radiator valves (like Tuya TS0601) with are reporting errors in the Homebridge Log.

Like:

[2/26/2021, 11:28:52 AM] [zigbee2mqtt] Restoring accessory: radiator Lieke (0x847127fffe11dc50)
[2/26/2021, 11:28:52 AM] [zigbee2mqtt] DUPLICATE SERVICE HANDLER with identifier 00000049-0000-1000-8000-0026BB765291 for accessory radiator Lieke. New one will not stored.
[2/26/2021, 11:28:52 AM] [zigbee2mqtt] DUPLICATE SERVICE HANDLER with identifier 00000049-0000-1000-8000-0026BB765291 for accessory radiator Lieke. New one will not stored.
[2/26/2021, 11:28:52 AM] [zigbee2mqtt] DUPLICATE SERVICE HANDLER with identifier 00000049-0000-1000-8000-0026BB765291 for accessory radiator Lieke. New one will not stored.
[2/26/2021, 11:28:52 AM] [zigbee2mqtt] Failed to setup switch for accessory radiator Lieke from expose "{"features":[{"access":3,"description":"Enables/disables physical input on the device","name":"state","property":"child_lock","type":"binary","value_off":"UNLOCK","value_on":"LOCK"}],"type":"lock"}": Error: Required "lock_state" property not found for Lock.

Can anyone help how to resolve this 'DUPLICATE SERVICE HANDLER'?
Where do I need to look?

Thanks!

[Device] Thermostat like the Eurotronics ones

Hi!

Great plugin -- really like. So far, I have manually all my zigbee stuff to homebridge, but that was buggy.

Would you mind adding support for thermostats (e.g. the Eurotronic ones)?

I am not sure what information you need -- in case it helps, I am adding some stuff:

A syslog snippet outlining the zigbee parameters of a thermostat:
Dec 20 00:04:50 troublemaker npm[7065]: Zigbee2MQTT:info 2020-12-20 00:04:50: MQTT publish: topic 'zigbee2mqtt/KuecheThermostat', payload '{"battery":0.5,"battery_low":0,"current_heating_setpoint":20,"eurotronic_error_status":0,"eurotronic_host_flags":{"boost":false,"child_protection":false,"mirror_display":false,"window_open":false},"eurotronic_system_mode":1,"linkquality":65,"local_temperature":21.5,"local_temperature_calibration":0,"occupied_heating_setpoint":20,"pi_heating_demand":2,"system_mode":"auto","unoccupied_heating_setpoint":10}'

... and apparently some JSON used to create this device in homebridge (using the homebridge MQTT plugin)

{"service_name":"Heizung","service":"Thermostat","CurrentHeatingCoolingState":1,"TargetHeatingCoolingState":{"validValues":[0,1]},"CurrentTemperature":"default","TargetTemperature":18,"TemperatureDisplayUnits":"default","name":"KuecheThermostat"}

(not sure if this is best practice ... did this one year ago without knowing of homebridge.io API docs)

Temperature wheel is not working properly

Describe the bug
The temperature wheel sticks to a certian spot when sliding to colder values.

Related devices
Only tested with IKEA light bulbs.

To Reproduce

  1. Change temperature value in homekit and have a look at homebridge log at the same time.
  2. Value 250 is almost 2/3 of the temperature wheel.
  3. when releasing the temperature wheel the dot will snap to a another point on the wheel

Expected behavior
The dot should not snap to a point when release

Versions used
Please provide the version of the following pieces of software:

  • plugin v1.1.1
  • homebridge v1.3.1-latest and 1.3.2-beta.0
  • Zigbee2MQTT 1.18.1
  • Homebridge Config UI X v4.39.1

[Bug] Setting OSRAM bulbs color does not work (color_hs / hue / saturation)

Hi,

I recently switched to Zigbee2mqtt and your homebridge plugin. I first have to say thank you for providing this plugin. Finally all the ikea switches get proper Homekit support and the OSRAM color temperature is finally working in HomeKit.

But I noticed one thing: I can't change the color of my RGB bulbs. I discovered that this is because homebridge-z2m is sending the message {"hue": 0, "saturation": 100} instead of "{color": {"hue": 0, "saturation": 100}}

Is this something, which is wrong in my configuration or is this a general problem?

Regards

Latest release is broken: Cannot find module 'hap-nodejs'

When updating to the latest release the plugin cannot be loaded because:

[7/5/2020, 1:41:59 PM] ====================
[7/5/2020, 1:41:59 PM] ERROR LOADING PLUGIN homebridge-z2m:
[7/5/2020, 1:41:59 PM] Error: Cannot find module 'hap-nodejs'
Require stack:
- /usr/local/lib/node_modules/homebridge-z2m/dist/customServices.js
- /usr/local/lib/node_modules/homebridge-z2m/dist/platformAccessory.js
- /usr/local/lib/node_modules/homebridge-z2m/dist/platform.js
- /usr/local/lib/node_modules/homebridge-z2m/dist/index.js
- /usr/local/lib/node_modules/homebridge/lib/plugin.js
- /usr/local/lib/node_modules/homebridge/lib/pluginManager.js
- /usr/local/lib/node_modules/homebridge/lib/api.js
- /usr/local/lib/node_modules/homebridge/lib/server.js
- /usr/local/lib/node_modules/homebridge/lib/cli.js
- /usr/local/lib/node_modules/homebridge/bin/homebridge
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-z2m/src/customServices.ts:1:1)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
[7/5/2020, 1:41:59 PM] ====================

Currently figuring out how to fix this.. 😥

[Feature] Exclude keys for a specific device

I have several xiaomi smart sockets model lumi.plug and this plugs also have temperature and now my temperature in room is based on lumi.sens and lumi.plug :/ and I don't want to exclude lumi.plug as I want to control it :)

maybe something that we can work on it as "first task" that I will help

Hue Dimmer Switch appears as a light bulb

Hi,
thanks for this software.
It seems that the Hue dimmer Switch gets recognized as a light bulb which is not correct.
Not sure whether you can fix this or if its an Issue with home kit

Improve SonarCloud integration

It appears that there's still something wrong with the SonarCloud integration in the GitHub workflow.
Probably need to do a different kind of checkout for these builds:

Could not find ref 'master' in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.

Shallow clone detected during the analysis. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.

[Device] vima smart lock

Device description
Which device would you like to be supported in this plugin?

Supported in Zigbee2MQTT?
Is this device already supported by Zigbee2MQTT / zigbee-herdsman-converters?
If this is NOT the case, please add support for the device there first.
Read there manual on How to support new devices for more information.
If this is the case, please provide the version in which support is present/added.

Device model / Exposes information
Provide the device model (also known as exposes information) for this particular device, as published to zigbee2mqtt/bridge/devices by Zigbee2MQTT.

please put the device model JSON in this code block

Missing features/functionality
Please describe the features/functionality of this device that are currently not exposed to HomeKit via this plugin.

Suggested services and characteristics
For each of the missing features, please mention to which HomeKit Services and Characteristics it should be mapped.
The Homebridge Plugin Development documentation provides a nice overview of the standard HomeKit services and characteristics.
Note that some manufacturers also use custom services and characteristics (the Elgato Eve products for instance), which could also be mimicked if they have been reverse engineered.

[Feature] Expose power, voltage, current to Xiaomi SP-EUC01

It would be great to get power consumption support for the Xiaomi SP-EUC01

Currently, only Switch and Temperature are exposed: https://z2m.dev/devices/xiaomi/sp-euc01.html

The device exposes switch (state), power, energy, temperature, voltage, current, linkquality
https://www.zigbee2mqtt.io/devices/SP-EUC01.html

I use a TP-LINK HS110 to monitor the power consumption of the laundry machine. I have an automation set-up for the TP-LINK Outlet that monitors the watt usage and I'd love to get rid of the Kasa ecosystem

https://i.imgur.com/AasYYiW.png

[Feature] IKEA Switches show as “Not Supported"

Problem description
Ikea wireless "dimmer" switches present as "not supported" in the home app.
Device: https://www.ikea.com/gb/en/p/tradfri-wireless-dimmer-white-00468432/

Suggested solution
Present this as a programable stateless switch.

Describe alternatives you've considered
The Zigbee-NT plugin presents these as stateless swtiches.
Home assistant presents these as "sensors" (which ends up causing issues getting them to work)
The MQTT Thing plugin offers programable stateless switch options.

Additional context
Expected Behaviour: https://imgur.com/a/YGoxKUP

Are you willing to contribute to this feature?
Yes - can supply MQTT data, test etc but don't have the programming skills to implement a solution.

[Bug] Lonsonho Tuya 2 gang dimmer not working as expected

Describe the bug
Recently got a Lonsonho QS-Zigbee-D02-TRIAC-2C-LN, which is a 2 gang dimmer.
This exposes 2 "endpoints" meaning that there are two additional topics, one for each connection (l1 and l2).

Current behavior
After some fiddling around I ended up with 3 services in HomeKit: one that controls the brightness of one of the lights and two that control the state of one of the lights (but these do not really seem to work).

Expected behavior
One on/off + brightness control for each light/endpoint.

MQTT messages
On each topic (l1 and l2), a stateandbrightness` property is available.

Versions used

  • This plugin 0.0.9

[Feature] Choose different services than default

Hey,

Thanks for the awesome plugin!

It would be super cool if services would be able to change in the plugin config. in my case, using occupancy sensors instead of motion sensor does not represent well my home so I would love to change occupancy to motion sensors in HomeKit.

I also thought it would be nice to have it dynamically available for all sorts of properties and services.
for example, possible changes users would might like to use:
occupancy -> contact sensor
switch -> lock (I connected a normal switch that control a dry relay of a gate lock for example)
switch -> valve

and i'm sure there are many other changes users would want to make, mostly with boolean state like true/false or on/off

Thanks in advanced

Battery level 0% in Home application[Bug]

I have successfully integrated a Heimann smoke sensor with zigbee2mqtt and this package in my homebridge. The Heimann smoke sensor is a supported device in the zigbee2mqtt database. However, I found that the battery level was shown as 0% in my Apple Home app. As this sensor does actually report its battery level I decided to have a look at the zigbee2mqtt log to check the name of the parameter. I found that this sensor reports its battery level with 'battery_level' instead of 'battery'. Is this why I cannot read out the battery level? And; how can I fix this?

I am currently using the latest version of homebridge, homebridge-z2m, and zigbee2mqtt.

Getting started using an IKEA outlet?

Please forgive me for filing this, I just am unable to figure out how to get started using your library which seems awesome!

Setup
I'm running on zigbee2mqtt 1.16.2 through docker. Previously I had a working setup using deCONZ + Homebridge Hue, but I wanted to mix it up again since it seems like z2m has evolved very nicely over the past year.

I'm on a fresh setup and just added a single IKEA control outlet (E1603/E1702) to z2m. It sets up successfully:

zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:11: Device '0x000d6ffffe7cb852' joined
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:11: Starting interview of '0x000d6ffffe7cb852'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:11: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0x000d6ffffe7cb852"},"type":"device_connected"}'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:11: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x000d6ffffe7cb852"},"type":"pairing"}'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:26: Successfully interviewed '0x000d6ffffe7cb852', device has successfully been paired
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:26: Device '0x000d6ffffe7cb852' is supported, identified as: IKEA TRADFRI control outlet (E1603/E1702)
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:26: Configuring '0x000d6ffffe7cb852'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:26: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"TRADFRI control outlet","friendly_name":"0x000d6ffffe7cb852","model":"E1603/E1702","supported":true,"vendor":"IKEA"},"type":"pairing"}'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:25:26: Successfully configured '0x000d6ffffe7cb852'
zigbee2mqtt    | Zigbee2MQTT:info  2020-12-05 11:26:08: MQTT publish: topic 'zigbee2mqtt/bridge/config/devices', payload '[{"dateCode":"0x26660700","friendly_name":"Coordinator","ieeeAddr":"0x00212effff054339","lastSeen":1607196368683,"networkAddress":0,"softwareBuildID":"ConBee2/RaspBee2","type":"Coordinator"},{"dateCode":"20180528","description":"TRADFRI control outlet","friendly_name":"0x000d6ffffe7cb852","hardwareVersion":1,"ieeeAddr":"0x000d6ffffe7cb852","lastSeen":1607196326506,"manufacturerID":4476,"manufacturerName":"IKEA of Sweden","model":"E1603/E1702","modelID":"TRADFRI control outlet","networkAddress":6447,"powerSource":"Mains (single phase)","softwareBuildID":"1.4.020","type":"Router","vendor":"IKEA"}]'

Based on the instructions in the readme, I gathered the device identifier and put it into my homebridge config as a device:

{
    "mqtt": {
        "base_topic": "zigbee2mqtt",
        "server": "<server>",
        "user": "<username>",
        "password": "<password>",
        "reject_unauthorized": false,
        "keepalive": 60,
        "version": 4
    },
    "devices": [
        {
            "id": "0x000d6ffffe7cb852"
        }
    ],
    "platform": "zigbee2mqtt"
}

I checked the homebridge logs for homebridge-z2m, and found a few logs:

[12/5/2020, 11:26:08 AM] [zigbee2mqtt] Connected to MQTT server
[12/5/2020, 11:26:08 AM] [zigbee2mqtt] New accessory: 0x000d6ffffe7cb852
[12/5/2020, 11:26:08 AM] [zigbee2mqtt] Publish to 'zigbee2mqtt/0x000d6ffffe7cb852/get': '{}'

However, the outlet doesn't show up in homebridge as a device. I tried restarting it a few times to no avail.

I feel like I'm probably missing something. I'm unsure whether I need to somehow fill in the capabilities of the device in my config? Or how I might even do that. Maybe I'm missing something obvious in the documentation, and if so please feel free to tell me to RTFM. 😄

Versions used

  • This plugin: v0.0.10
  • Homebridge: v1.2.3
  • Zigbee2mqtt: v1.16.2
  • Homebridge Config UI X: v4.35.0

[Bug] Message to get topic is empty

As indicated in #19, the message sent to the get topic of each device is not valid.
It should contain all the keys we want to retrieve data for.

This means that each ServiceWrapper should somehow expose which keys it uses to determine the state, so we can include each of those in this "query" message.
I'm not yet sure how this will go into the interface (also see #18 as this will probably be taken into account there).

Missing states

Xiaomi wall double switch lumi.ctrl_ln2.aq1 sending state_left and state_right wich missing in z2m so it showing only temperature
Screenshot 2020-07-02 at 14 27 41

[Bug] Is it normal that zigbee2mqtt is not working after using this plugin?

Describe the bug
I am very new to Zigbee2mqtt and I found that after using this plugin, the zigbee2mqtt log never logged further more when checking this command

cat /opt/zigbee2mqtt/data/log/2021-02-21.18-05-28/log.txt

I tried this command

cd /opt/zigbee2mqtt && npm start

and it returns error with

Zigbee2MQTT:error 2021-02-21 20:14:32: Error while starting zigbee-herdsman Zigbee2MQTT:error 2021-02-21 20:14:32: Failed to start zigbee Zigbee2MQTT:error 2021-02-21 20:14:32: Exiting... Zigbee2MQTT:error 2021-02-21 20:14:32: Error: Error while opening serialport 'Error: Error Resource temporarily unavailable Cannot lock port' at Znp.<anonymous> (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:136:32)

After searching on the internet, I found that this error occurs when another program is already using (and thus locking) the adapter. So is it because homebridge-z2m is running that the zigbee2mqtt doesn't seem to be running anymore?

If that is the case, will I still be able to add the zigbee device the way instructed in zigbee2mqtt? Or this plugin should be conflicting with zigbee2mqtt at all?

This might be a noob question but I'm so sorry since I'm very new to Zigbee2mqtt.

Thanks in advance.

Honor zigbee2mqtt device availability

Problem:
Some Zigbee devices are at risk of losing power at the mains, and not by telling the device to turn on or off. Think of a bulb in a light fixture controlled by a wall switch.

If I turn that wall switch off, there's no outward indication that the Zigbee device is having an issue, it just never responds to commands.

Since most MQTT commands are one-way, I can send all the commands to the device I want through Homekit (and thus through Homebridge -> homebridge-z2m), and the status in Homekit will happily change to whatever I tell it... however, nothing happens at the device, of course, because there's no two way communication from the Zigbee device.

Suggested solution:
There's a feature in zigbee2mqtt called "availability" (https://www.zigbee2mqtt.io/information/availability.html). When enabled, it will "ping" a Zigbee device to determine if it's responding to commands or not. If the device doesn't respond, it can mark the device properly as "offline" in Homekit until one of those pings succeeds (or a command is sent again).

Describe alternatives you've considered
Not really sure this applies -- I think it's a limitation of homebridge-z2m currently not looking for it. I'll admit I'm not an expert in MQTT plumbing, but I suspect this to be the case.

From zigbee2mqtt logs:

debug 2021-01-07 18:00:55: Received Zigbee message from 'Sengled Test Bulb', type 'readResponse', cluster 'genBasic', data '{"zclVersion":1}' from endpoint 1 with groupID null
debug 2021-01-07 18:00:55: Successfully pinged 'Sengled Test Bulb'

To this end, I would assume there's a way for homebridge-z2m to be able to pick up on these messages as well, and impact the state of the end device.

Additional context
n/a

Are you willing to contribute to this feature?
If I can. I'm no developer but I can more or less tell what code is doing. Though I don't have a lot of experience in Javascript (mostly python).

[Bug] crashes on start TypeError: devices.forEach is not a function

*Describe the bug
did a fresh install of the plugin,configureed it, restart homebridge and gets an error in the log which crashes homebridge as a whole.

To Reproduce
Steps to reproduce the behavior:

  1. Go to ' plugin->install '
  2. fil in settings
  3. rstart home bridge
  4. See error

Expected behavior
expect the plugin to work or at least give some pointers one what went wrong.

MQTT messages
If possible, please provide the following messages:

  • The device identification from zigbee2mqtt/bridge/config/devices
  • Status update from zigbee2mqtt/[FRIENDLY_NAME]
  • Messages published by this plugin that might be to your issue (can also be seen in the homebridge logs)

Versions used
Please provide the version of the following pieces of software:

  • This plugin 0.0.6
  • Homebridge 1.2.3
  • Zigbee2mqtt
  • Homebridge Config UI X (if applicable)
  {
            "mqtt": {
                "base_topic": "zigbee2mqtt",
                "server": "mqtt://192.168.1.25:1883",
                "user": "user",
                "password": "password",
                "client_id": "",
                "reject_unauthorized": false,
                "keepalive": 60,
                "version": 3
            },
            "platform": "zigbee2mqtt"
        }

`9/30/2020, 10:06:02 AM] Homebridge v1.2.3 is running on port 52624.

[9/30/2020, 10:06:02 AM] [zigbee2mqtt] Connected to MQTT server

[9/30/2020, 10:06:06 AM] TypeError: devices.forEach is not a function

at Zigbee2mqttPlatform.handleReceivedDevices (/homebridge/node_modules/homebridge-z2m/src/platform.ts:125:13)


at Zigbee2mqttPlatform.onMessage (/homebridge/node_modules/homebridge-z2m/src/platform.ts:103:12)


at MqttClient.emit (events.js:315:20)


at MqttClient._handlePublish (/homebridge/node_modules/homebridge-z2m/node_modules/mqtt/lib/client.js:1271:12)


at MqttClient._handlePacket (/homebridge/node_modules/homebridge-z2m/node_modules/mqtt/lib/client.js:410:12)


at work (/homebridge/node_modules/homebridge-z2m/node_modules/mqtt/lib/client.js:321:12)


at processTicksAndRejections (internal/process/task_queues.js:79:11)`

Danalock V3 lock state wrong

Hi

Danalock v3 keeps telling it's unlocked, even though it's locked in z2m. In the home app it's saying it's locking

[Feature] Catch more log details from zigbee2mqtt + device recognition improvement

Hi @itavero
First of all, congrats for the plugin, it works stable (which is highly appreciated) and very good. I hope not to disturb you but I have a couple of needs that perhaps are already solved, if this is the case: sorry. I am new using zigbee2mqtt + homebridge-z2m but I have quite experience (as user) using deconz + homebridge-hue. I was happy with raspbee II but I wanted to sold myself a cc2538 in a rpi shield and check how was it. Anyway, I am telling this just to tell you a couple of aspects that I found very useful when I was using the deconz + hb hue combination.

Problem description

  1. I miss seeing more mqtt info in the homebridge.log, for example, in hb hue plugin, when I "manually" switch off or on a plug, it is shown in the log while hb z2m only shows if the action is done via homekit. Is there perhaps a deeper level that I don't know how to activate it?

  2. One of the things I like more in zigbee2mqtt vs deconz is the autojoin of the devices. I wanted to test it with the most automatic for the user perspective or experience, it is true then in homekit the device would appear with the "ugly :)" IEEE name but it can be easily renamed there. I found then that mqtt shows the kind of device, but then when I first restart hb z2m, the plugin also detects and pulls the device but -as first- unrecognized. I have then to configure something like the Friendly name and after a bit then homekit detects the kind of device. Is there any step or something to improve this?

Suggested solution
For issue #1. Catch and show more coming from the mqtt.
For #2. Perhaps to check some other parts of the mqtt to detect which kind of device is before showing it as unknown?

Describe alternatives you've considered
I don't want to turnback to deconz and hb hue, I consider both excellent products but I feel I can understand and learn more with zigbee2mqtt and hb z2m.

Additional context
For the second issue described, here are the logs. In zigbee2mqtt it shows the kind of device while in hb z2m log the get comes null.
zigbee2mqtt
info 2021-01-30 10:16:08: Device '0x588e81fffef787f5' is supported, identified as: Lidl Livarno Lux smart LED light strip 2.5m (HG06104A)
info 2021-01-30 14:43:03: 0x588e81fffef787f5 (0x588e81fffef787f5): HG06104A - Lidl Livarno Lux smart LED light strip 2.5m (Router)

homebridge-z2m
[1/30/2021, 18:28:00] [zigbee2mqtt] Publish to 'zigbee2mqtt/0x588e81fffef787f5/get': '{}'
[1/30/2021, 18:28:00] [zigbee2mqtt] Publish to 'zigbee2mqtt/bridge/config/devices/get': ''

Are you willing to contribute to this feature?
Yes, but as an advance user and I dont know to code this plugin... of course any I can do, I will try.

Thanks
Best Regards
Ware

[Feature] Support for motion_sensitivity and occupancy_timeout using Eve characteristics

After #18 is finished (or during #18), it would be possible to expose the motion_sensitivity and occupancy_timeout properties via the same characteristics as used by the Elgato Eve Motion Sensor (as described in this gist).

Service - Characteristic UUID R W Type Description
Sensitivity E863F120-079E-48FF-8F27-9C2605A29F52 x x UInt8 0 = high, 4 = medium, 7 = low. Set in Eve.app
Duration E863F12D-079E-48FF-8F27-9C2605A29F52 x x UInt16 Persistence of motion indication in seconds. Set in Eve.app

The Sensitivity characteristics may also apply to the sensitivity property.

⚠️ Strange fork: homebridge-snoopy

I've just noticed that it someone forked my package and published it as homebridge-snoopy to NPM.
Please do NOT use this package, as I do not know what the state of this fork is or how it is any different than this repository.

I'm not even sure how published it and what their intentions are.

[Bug] Unable to create supported accessory (aqara temp)

Describe the bug
Seems to be unable to create valid accessories. Acessories pop up in homekit but are marked as Not supported

Homebridge output

[10/18/2020, 5:04:29 PM] [zigbee2mqtt] Connecting to MQTT server at mqtt://localhost:1883
[10/18/2020, 5:04:29 PM] [zigbee2mqtt] Restoring accessory: temp/storage
[10/18/2020, 5:04:29 PM] [zigbee2mqtt] Publish to 'zigbee2mqtt/0x00158d000540e656/get': ''
[10/18/2020, 5:04:29 PM] [zigbee2mqtt] Publish to 'zigbee2mqtt/bridge/config/devices/get': ''

This [10/18/2020, 5:04:29 PM] [zigbee2mqtt] Publish to 'zigbee2mqtt/0x00158d000540e656/get': '' seems invalid do not now if thats related. But sending empty string to device/get generates error in Zigbee2Mqtt

From zigbee2mqtt output

Zigbee2MQTT:error 2020-10-18 16:04:29: Invalid JSON '', skipping...

Expected behavior

Expecting it to create a valid accessory (in this case a aqara temp sensor)

MQTT messages

  • The device identification from zigbee2mqtt/bridge/config/devices
{"dateCode":"20191205","description":"Aqara temperature, humidity and pressure sensor","friendly_name":"temp/storage","hardwareVersion":30,"ieeeAddr":"0x00158d000540e656","lastSeen":1603036668625,"manufacturerID":4151,"manufacturerName":"LUMI","model":"WSDCGQ11LM","modelID":"lumi.weather","networkAddress":11072,"powerSource":"Battery","softwareBuildID":"3000-0001","type":"EndDevice","vendor":"Xiaomi"}

Versions used
Please provide the version of the following pieces of software:

  • This plugin 0.0.7
  • Homebridge 1.2.3
  • Zigbee2mqtt 1.15.0
  • Homebridge Config UI X 4.29.0

Vima smart door lock

Device description
Which device would you like to be supported in this plugin?

Supported in Zigbee2MQTT?
Is this device already supported by Zigbee2MQTT / zigbee-herdsman-converters?No
If this is NOT the case, please add support for the device there first.
Read there manual on How to support new devices for more information.
If this is the case, please provide the version in which support is present/added.

Device model / Exposes information
Provide the device model (also known as exposes information) for this particular device, as published to zigbee2mqtt/bridge/devices by Zigbee2MQTT.

please put the device model JSON in this code block

Missing features/functionality
Please describe the features/functionality of this device that are currently not exposed to HomeKit via this plugin.

Suggested services and characteristics
For each of the missing features, please mention to which HomeKit Services and Characteristics it should be mapped.
The Homebridge Plugin Development documentation provides a nice overview of the standard HomeKit services and characteristics.
Note that some manufacturers also use custom services and characteristics (the Elgato Eve products for instance), which could also be mimicked if they have been reverse engineered.

[Bug] Water leak sensor appearing twice after update

Describe the bug
In v0.0.9 support for Gas detection sensors was added (gas). Because there doesn't seem to be a service/characteristic predefined in HomeKit for these kind of sensors, it is exposed as a "Leak Sensor" (just like a real water leak sensor).
For this part of the code changed, which results in there being two waterleak sensors after updating to v0.0.9.

A workaround would be to throw away all the existing accessories, but I'd rather not do that and it should be rather easy to fix.

To Reproduce
Steps to reproduce the behavior:

  1. Install v0.0.8 and add a waterleak sensor.
  2. Upgrade to v0.0.9.

Expected behavior
Single water leak sensor accessory would be shown instead of two.

Versions used

  • This plugin: 0.0.9

Multiple messages are being sent [Bug]

Describe the bug
When I trigger an action for some reason this plugin publishes two messages to the MQTT broker. Sometimes this is fine but sometimes this causes automations to fire twice or weird things to show up in the home app. One of these weird things is when changing my radiator valve from HEAT to anything else it will get stuck in a weird loop where it will randomly publish messages and flick between states until you leave it alone for a bit and try again.

Related devices
Switches
Radiator Valves

To Reproduce

  1. Change the state of a device in the Home App
  2. Look at the logs on Homebridge and you will see two publish messages
  3. Look at the zigbee2mqtt logs on and you will see two or more messages being received an it responding for each message

Expected behavior
only one message to be sent for one action in the Home App

MQTT messages
[2/10/2021, 12:58:24] [zigbee2mqtt] Publish to 'zigbee2mqtt/xxxxx/set': '{"state_right":"OFF"}'
[2/10/2021, 12:58:26] [zigbee2mqtt] Publish to 'zigbee2mqtt/xxxxx/set': '{"state_right":"OFF"}'

Versions used
Please provide the version of the following pieces of software:

  • This plugin - 1.1.1
  • Homebridge - 1.2.5
  • Zigbee2MQTT (can be found in MQTT topic zigbee2mqtt/bridge/info) - 1.17.0
  • Homebridge Config UI X (if applicable) - 4.38.0

Manage FW updates via HomeKit

As mentioned in the README:

  • "virtual" switch to enable/disable permit_join (and also have it automatically turn off when a timer elapses or a device is paired).
  • When update_available is set to true, provide a switch service to start the FW update via HomeKit (and maybe see if it is possible to provide feedback on the progress somehow). I might add this to each device individually, or maybe generate one virtual device that acts as a binary sensor (so that you can also get some kind of notification when an update is available) and add multiple switches to that.

HOOBS issue [Bug]

The plugin doesn't start, The Error message is:
The requested platform "zigbee2mqtt" was not registered by any plugin. Your config.json is requesting the platform "zigbee2mqtt" which has not been published by any installed plugins.

I've found a related issue here stating that a simple fix is changing
api.registerPlatform(PLATFORM_NAME, ScreenLogicPlatform)
to
api.registerPlatform("homebridge-z2m", PLATFORM_NAME, ScreenLogicPlatform)

Versions used

  • This plugin: 0.0.5
  • Homebridge - HOOBS - 3.2.6
  • Zigbee2mqtt - 1.14.1
  • Homebridge Config UI X (if applicable)

Name does not update in homebridge

Hi

I don't know if the problem is in this plugin.

The problem is that if I have homebridge running while adding a new item in z2m, the friendly name does not update in homebridge and in the Home app.

As you can see in the screenshots, I have added a bulb in my daughters room. After inclusion, I have changed the name in z2m, but as homebridge was running while including the bulb, the IEEE address was used as the name. As you can see in homebridge, the name is indeed changed, but not used. Even if I manually change the name in homebridge, it does not change in the Home app and the only way to make it change (except to manually change it) is to reset homebridge or make sure homebridge is not running while including devices.

Skærmbillede 2021-02-23 kl  13 00 34
Skærmbillede 2021-02-23 kl  13 00 16
Skærmbillede 2021-02-23 kl  13 10 07

[Bug] Phillips Hue E27 cannot change color

Describe the bug
In Apple Home (and Homebridge UI) I cannot change the color of my Phillips Hue E27 (white and color ambiance). The only option I have is to change the brightness of the lamp, so the color wheel doesn't show up at all in Home. Tho it is possible for me to change the color via the Phillips Hue Bluetooth app (I know it probably doesn't matter, but I thought I'd add it).

To Reproduce

  1. Figure out the friendly name and add it to the plugin config.
  2. Restart Homebridge
  3. Try to change the color -> Color wheel doesn't show up (Home/ homebridge)

Expected behavior
Color wheel showing up to change the color of the bulb.

MQTT messages

  • The device identification from zigbee2mqtt/bridge/config/devices -> Is it the friendly name? Then it's zigbee2mqtt/0x0017880108ac9e9e
  • Status update from zigbee2mqtt/0x0017880108ac9e9e:
    MQTT publish: topic 'zigbee2mqtt/0x0017880108ac9e9e', payload '{"brightness":254,"linkquality":36,"state":"OFF","update_available":false}'

Versions used

  • Z2M v0.0.10
  • Homebridge v1.1.6
  • Zigbee2mqtt 1.16.1
  • homebridge-config-ui-x v4.32.0

[Feature request] Kwikset Convert Lock

Problem description
Kwikset convert pairs but can not be controlled

Suggested solution
Would like for the lock to work properly

Partial Log:

{"ieeeAddr":"0x002446fffd033c48","type":"EndDevice","networkAddress":64587,"model":"66492-001","vendor":"Kwikset","description":"Home connect smart lock conversion kit","friendly_name":"XXX","manufacturerID":4242,"manufacturerName":"Kwikset","powerSource":"Battery","modelID":"SMARTCODE_CONVERT_GEN1","hardwareVersion":3,"lastSeen":1594565932326}]}
{"state":"LOCK","lock_state":"locked","linkquality":178}
error 2020-07-12 10:06:47: Publish 'set' 'state' to 'XXX' failed: 'Error: Cluster 'closuresDoorLock' has no command 'onDoor'

error 2020-07-12 10:06:52: Publish 'set' 'state' to 'XXX' failed: 'Error: Cluster 'closuresDoorLock' has no command 'offDoor'

Homebridge Log:

[7/12/2020, 10:28:56 AM] [zigbee2mqtt] Publish to 'zigbee2mqtt/XXX/set': '{"state":"ON"}'
[7/12/2020, 10:29:10 AM] [zigbee2mqtt] Publish to 'zigbee2mqtt/XXX/set': '{"state":"OFF"}'

Zigbee devices.js

// Kwikset
    {
        zigbeeModel: ['SMARTCODE_CONVERT_GEN1'],
        model: '66492-001',
        vendor: 'Kwikset',
        description: 'Home connect smart lock conversion kit',
        supports: 'lock/unlock, battery',
        fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery],
        toZigbee: [tz.generic_lock],
        meta: {configureKey: 3},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(2);
            await bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
            await configureReporting.lockState(endpoint);
            await configureReporting.batteryPercentageRemaining(endpoint);
        },

Are you willing to contribute to this feature?
Yes, but not sure what I can contribute as I am fairly new to this, especially Zigbee.

[Bug] Ikea/Hue Remote: Failed to process MQTT message

Describe the bug
A clear and concise description of what the bug is.
image

To Reproduce
Hue Dimmer Remote + IKEA Puck + IKEA On/Off Remotes paired via zigbee2mqtt.
It is discovered:
image
However on button presses it produces an error.

I've tried switching MQTT version to 3,4,5 and get the same error. Is exposing Remotes currently working? I thought i read in #2 that it was supported in the release.

Am running homebridge config UI.

[Feature] Light sensor illuminance (not illuminance_lux)

Problem description
I bought a mijia light sensor which I hoped to do some automations with.
After pairing it, I found it only outputs battery sensors and illuminance. Not illuminance_lux, this prevents it from showing up in home bridge.

Suggested solution
Add an illuminance support for more light sensor device options

Are you willing to contribute to this feature?
Yes

Support for push buttons

Currently there's no support for push buttons (a.k.a. Stateless Programmable Switch), mainly due to two reasons:

  • HomeKit expects a fixed set of interactions that should be possible with such a switch (Short Press, Long Press and Double Press). Not all devices seem to have this option and the way to detect it based on the MQTT messages isn't uniform.
  • It's pretty much impossible to know which values can be published for click upfront. It differs a lot between different devices.

The first point can probably be resolved for most push buttons by implementing certain interactions in the plug-in (for instance, detect a double press based on the time between messages). However, with one of the remotes I have, I already saw values for the click property that I might not be able to map to this service (the particular remote had an option to change the brightness of a lamp by holding down a button).

The second point might be (partly) resolved by abusing the Home Assistant discovery messages that zigbee2mqtt.

All in all, these devices require some more thought to integrate 🤓

Get this plugin Verified

This plugin is currently not listed as a Verified plugin in Homebridge.
On Reddit and Discord, I've seen people be a bit confused/afraid when it comes to "unverified" plugins (even though they might be perfectly okay).
I must admit that I myself also tend to choose a "verified" plugin if I have to choose between that and an "unverified" one.

The plugin must meet the following requirements in order to be verified:

  • The plugin must successfully install.
  • The plugin must implement the Homebridge Plugin Settings GUI.
  • The plugin must not start unless it is configured. (Implemented a DynamicPlatformPluginand have a small helper in index.ts just like the verified homebridge-ring plugin)
  • The plugin must not execute postinstall scripts that modify the users system in any way.
  • The plugin must not contain any analytics or calls that enable the plugin developer to track you.
  • The plugin must not throw unhandled exceptions, the plugin must catch and log it's own errors. ➡️ Changed in 5cd9b1a
  • The plugin must be published to npm and the source code available on GitHub.
    • A GitHub release - with patch notes - should be created for every new version of your plugin. ➡️ Added release-it configuration in 8abcf01 and used it for a couple of pre-releases now. Seems to work as expected.
  • The plugin must run on all supported LTS versions of Node.js, at the time of writing this is Node.js v10, v12 and v14. (GitHub checks run npm run build and npm run test on node 10.x, 12.x, 13.x and 14.x)
  • The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
  • If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory. (not applicable)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.