[V4] Zigbee2mqtt Integration

So far I have been doing my PRs on the GitHub of @AlexTrovato since he is the one who started the developments on the Zigbee2mqtt service. He always has an open PR on the official GitHub for the service.
Should we continue this way?
@AlexTrovato, do you still want to work this way (do you still have time) or should I open a new PR on the Gladys GitHub?

Hi @Reno, it might be better if you create your own PR directly, you’re the one who took over all this work.

Hello hello,
What is the difference between Zigbee2mqtt and the ZiGate? :thinking:

The zigate can be used with zigbeemqtt:

  • zigate retrieves zigbee information
  • zigbeemqtt transmits this information via MQTT (a communication protocol)

Oh, I see, thank you for the explanation

To complete this post, here is the feedback received from the « supplier » of these modded chips:

"Hi,

thank you for your message. First of all I‘d like to tell you that I test the sticks before I ship them, so they work fine, but I cannot give any warranty.

I charge 31€ per CC2531 with antenna mod and case. If you need an additional router you can pick an additional CC2531 flashed as router for the same price.

I don’t have alu any more (and it’s not really aluminium, it had aluminum particles in it.) The substitute for the color alu is silver (J). Same price for all colors.

The cheapest shipping option within Europe without insurance and tracking is 5,5€ (letter, at your own risk). With tracking it is 9,9€"

That comes to 36€50 then. More expensive, but everything is done, and there is the little case in addition, very pretty.
I’m still hesitating, but I think I’m going to give in ^.^

@bobdivx integrate into Gladys or Zigbee2MQTT?

Where my question comes from, we don’t maintain zigbee2mqtt, you have to submit compatibility and above all you have to be able to flash the device with a zigbee2mqtt firmware.

The product in question is a CC2530 so maybe there is a way, but there is very little information. If I were you, I would forget it.

Hello @Reno!

I’m your PR on GitHub, is everything okay, or do you need help? :slight_smile:

Don’t hesitate, this PR is great and I think it will be a success when it’s available for the whole Gladys community!

I’m taking advantage of seeing @Reno online to ask you: will your current work allow you to solve the problem I’m encountering? My Xiaomi bulbs that I can’t integrate into Gladys even though they are well detected.

Hello everyone,

I admit that the period is a bit confusing and complex to manage…
On the code side, I just rebuilt a dev Rpi4 to be able to fully test what I code because WSL is great for development but for interaction with the hardware (USB dongle), I have to go to the target.
Additionally, I haven’t had much time over the past 15 days (municipal elections, lockdown, remote work, …).
I finished my test RPi last night and am therefore operational to continue the service more effectively. I think I will take this opportunity to do a tutorial on the dev RPi while it’s fresh…
I will get back to you if I have any issues, within the week.

@bobdivx, the Zigbee2mqtt service in Gladys depends on the project of the same name that we use as is. If the hardware you are talking about is not supported by this project, it will not work. You should then contact its community to see if developers can work on integrating this new hardware. As it is based on CC253x, it shouldn’t be too much of a problem for them.
Regarding your need to increase the range of Zigbee to use it throughout your (large) house, I think it would be better to take advantage of this to integrate it into Gladys in the form of Gladys slave machines that could be equipped with additional dongles. All this is planned by @pierre-gilles, if I am not mistaken, but will be part of the next phase of developments.
Also, due to the use of Docker containers for Zigbee2mqtt, I think it would be quite simple to implement it directly on another RPi than the one running Gladys without too many issues, just by pointing to the MQTT container used on the Gladys machine.
When I have finished the dev of the auto-launch of containers from Gladys, I will quickly check if it is feasible.

@guim31, hi, I had generated a new Docker image of the service some time ago and was waiting for your feedback on it.

Have you been able to test?
Do you still have the same problem with this version?

My goal is to test and make all the hardware that still has issues compatible. I will therefore look into your bulbs but I need feedback as I don’t have all the hardware at home.

My mistake, I didn’t understand ^^

I tested yesterday and I have exactly the same issue

Thanks for your response and the time you dedicate to this development :folded_hands:

You can’t test from your machine? :confused: From WSL, no way to access USB ports? While quickly searching the internet, I came across articles like:

I don’t know Windows at all, but in my opinion, it must be possible to use the hardware directly on your PC, because having to put the code on Pi to test, what a hassle! ^^

@pierre-gilles, indeed I’m struggling…

After your message, I thought maybe I missed something on Windows. So I tried again to find a way to see the dongles on Wsl but in vain…

So I switched back to Rpi but now, I have issues with node module installations.
Dongle detection was working fine but for the past 3 days, it’s impossible to detect one. I recreated the dev environment several times, but impossible to find my dongles… I even went back to older commits, on master and still no dongle…
This must therefore come from the npm install but I don’t know how to fix it.
If anyone has an idea, please don’t hesitate.

Problem solved! :v:

For information (this might help others), I got caught like a rookie… :woozy_face:

As I’m a PC developer (WSL), I run Gladys on my PC.
Then, to test USB dongle recognition, I switch to a development Raspberry Pi because it doesn’t work under WSL.
For this, I push from the PC to GitHub and pull from GitHub to the Rpi. Then, I connect to the Gladys instance of the Rpi from my PC’s browser.
As a result, on my Rpi, I get the base config of the project and notably the front/config.js.

So, for 3 days, I had the variable that defines the backend set to localhost (i.e., my PC as seen from the browser running on the PC) instead of the IP of my Rpi.
Thus, the front of the Rpi was communicating with the server (backend) of the PC, which was running and therefore could not see the dongles (that’s why I use the Rpi…).
3 nights before I figured it out.
What an idiot! :rage:

@Reno Great if you’ve solved your problem!

However, try to get in touch with someone who is a Windows developer to get this running on Windows, because clearly developing on Pi you will take months to progress… :slight_smile:

I’m a developer on Windows and Linux

Prerequisites for Windows

  • node lts
  • up-to-date npm => npm install npm @ latest -g
  • Required for gyp => npm install --global windows-build-tools
  • SQlite (SQLite Home Page)

Nothing else (you can also use WSL but it’s not necessary here)

I’m bringing the topic back up, is the integration frozen while waiting for the MQTT service to be more mature?

Is there a more mature MQTT service expected? It seems to me that zigbee2mqtt publishes and consumes its own topics, which is similar to the Tasmota module, and therefore outside the specific Gladys MQTT scope.

Correct, the topic seemed to be on standby, but it’s @Reno who took over the PR.