-
Notifications
You must be signed in to change notification settings - Fork 508
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
Gateway Cascade #287
Comments
yes deconz tries to discover other gateway in the same network. The reason behind this is a feature called gateway cascades which allows for example forward a switch event to another gatway. I can can add a commandline switch to disable it. Or at least prevent the debug output 🙂 |
LOL. I'd rather they take the hint that the usernames aren't configured.
Or... (if I may suggest a crazy idea ;-) you could document the feature? Seriously, this could be very useful to break a larger ZigBee network into two to reduce the polling time. I assume the cascading gateways are supposed to run at different ZigBee network channels and PAN IDs? Would they forward CLIP events as well? |
The implementation hasn't been touched in a while and is fairly basic to forward only group/scene commands. If I recall correctly the periodic polling is to check if the other gateway(s) are reachable, regardless of a configured username. There is a hidden page in the webapp:
Totally agree, documentation in general is currently a real pain point and one of the next bigger tasks in early 2018.
That's exactly what it is used for, we have larger projects with > 500 nodes where multiple gateways and their devices are connected by this feature. Every gateway has its own ZigBee network settings they are sometimes not even in radio signal range but only connected by IP/LAN.
You can see current state in the here: |
OK, after some experimentation and code reading, I managed to setup:
I had to create the username on the remote gateway manually. After that, it retrieved the
That looks promising, however, in the log of the remote gateway, I see
Now that's interesting: outgoing, deCONZ forwards ZigBee group commands, but incoming, it expects an API call with JSON? That's not going to work - there's no API equivalent for the Toggle command (0x02) of the OnOff cluster (0x0006). When issuing
and the remote gateway:
Bingo! |
Plugged in my Hue bridge. It's discovered as a gateway by deCONZ. Hacked the deCONZ database to provide a valid Hue bridge username (the Hue API no longer allows to specify a username when creating a user) and it seems to work - at least the groups from the Hue bridge are retrieved and group commands are forwarded:
Of course this will break on API incompatibilities for scenes (see #29), but otherwise I see a lot of possibilities.
|
OK, I moved two of my Living Room lights to the Hue bridge, and setup the cascade from the Hue dimmer switch group on the deCONZ gateway to the Hue bridge. Had to patch gateway.cpp, since the Hue dimmer sends Off with effect (0x40) instead of plain Off (0x00). While doing that, fixed the invalid cascade of Toggle. See PR #338. When switching the lights on with the Hue dimmer switch or through the API, the delay as hardly noticeable, comparable to switching the lights on through a rule on the gateway. When switching the lights off, the delay is somewhat more noticeable. I grouped four lights connected by deCONZ and exposed through homebridge-hue and two lights exposed by the Hue bridge in one HomeKit group. When toggling the HomeKit group, all six lights react simultaneously. |
My gateway rules control the lights through scene recall and off commands. Both are now cascaded to the Hue bridge in full. I map the deCONZ scene
The Hue dimmer switch in direct mode is now fully functional as well, controlling four lights connected to the deCONZ gateway and two connected to the Hue bridge. On, Off, DimUp, DimDown are all cascaded to the Hue bridge and work with very acceptable response times. Note that you need Support for the IKEA remote in direct mode is harder. There's no equivalent for Toggle in the REST API. Either we need to add that (but that will work only for deCONZ), or check the value of |
I've got two Pi-s, one production and one test, both with a RaspBee running deCONZ and homebridge-hue on the same (wired) subnet. This afternoon I upgraded both to v2.04.91. Since then, I'm seeing some disturbing log messages that I haven't seen before. On my production Pi:
and
These message have been appearing every 10 seconds.
Same on my test pi:
I don't have these usernames configured anywhere. I double-checked that no rules are owned by these users, and that no schedule command contains these.
Apart from the deCONZ webapp and homebridge-hue I don't use any deCONZ clients. I wanted to double-checked using
netstat
that there's no weird connections to the port (80) where the webapp runs, but it would seem that the two deCONZ instances keep a connection to each other. Indeed, the messages on the production Pi stop, when quitting deCONZ on the test Pi, and resume when starting deCONZ on the test Pi.What is happening here?!
The text was updated successfully, but these errors were encountered: