Kleiner Nachtrag: Müsste eigentlich gehen. Siehe http://dresden-elektronik.github.io/deconz-rest-doc/websocket/
Cool.
Habe damit gerade mal rumgespielt.
- sowohl die Hue-Bridge als auch deCONZ liefern eine “config” Antwort
- sowohl die Hue-Bridge als auch deCONZ liefern eine “sensors” Antwort
Wäre es nicht als erster Schritt sinnvoll, die Sensor-Peers der Hue-Bridge/deCONZ abzufragen? Bei einer deCONZ-Bridge könnte man dann eine Websockets Verbindung aufbauen… Bei der Hue-Bridge müsste man sich dann was überlegen, wie das gehen kann. Eventuell durch pollen.
Hier sind meine Test-Sensoren:
{
"1":{"config":{"configured":true,"on":true,"sunriseoffset":30,"sunsetoffset":-30},"etag":"0ebca0cad6101b4eefc49fe43ea1be01","manufacturername":"Philips","modelid":"PHDL00","name":"Daylight","state":{"dark":false,"daylight":true,"lastupdated":"2019-03-03T11:46:35","status":170},"swversion":"1.0","type":"Daylight","uniqueid":"00:21:2e:ff:ff:02:46:62-01"},
"2":{"config":{"battery":null,"duration":122,"on":true,"reachable":false,"temperature":null},"ep":1,"etag":"abed6c9fe5622de3c3e2c30f7fe89d91","manufacturername":"LUMI","modelid":"lumi.sensor_motion.aq2","name":"Presence 2","state":{"lastupdated":"2019-03-01T21:01:21","presence":false},"type":"ZHAPresence","uniqueid":"00:15:8d:00:02:37:53:26-01-0406"},
"3":{"config":{"battery":null,"on":true,"reachable":false,"temperature":null,"tholddark":12000,"tholdoffset":7000},"ep":1,"etag":"abed6c9fe5622de3c3e2c30f7fe89d91","manufacturername":"LUMI","modelid":"lumi.sensor_motion.aq2","name":"LightLevel 3","state":{"dark":true,"daylight":false,"lastupdated":"2019-03-01T20:59:51","lightlevel":0,"lux":0},"type":"ZHALightLevel","uniqueid":"00:15:8d:00:02:37:53:26-01-0400"},
"4":{"config":{"battery":100,"on":true,"reachable":true,"temperature":2400},"ep":1,"etag":"41a902b9c168bc429743914d03768f50","manufacturername":"LUMI","mode":1,"modelid":"lumi.sensor_switch.aq2","name":"lumi.sensor_switch.aq2 4","state":{"buttonevent":1004,"lastupdated":"2019-03-01T21:09:08"},"swversion":"20161128","type":"ZHASwitch","uniqueid":"00:15:8d:00:02:15:ca:03-01-0006"},
"5":{"config":{"battery":100,"on":true,"reachable":true,"temperature":2600},"ep":1,"etag":"7bcf408328549ab4f6f41b780e6c84de","manufacturername":"LUMI","mode":1,"modelid":"lumi.sensor_switch.aq2","name":"lumi.sensor_switch.aq2 5","state":{"buttonevent":1004,"lastupdated":"2019-03-01T21:01:22"},"swversion":"20161128","type":"ZHASwitch","uniqueid":"00:15:8d:00:02:04:2c:27-01-0006"},
"6":{"config":{"duration":60,"on":true,"reachable":true},"etag":"2960e327b075644847fc34518c6bf96d","manufacturername":"Phoscon","modelid":"PHOSCON_VPIR","name":"VPIR y","state":{"lastupdated":"2019-03-01T21:02:22","presence":false},"swversion":"1.0","type":"CLIPPresence","uniqueid":"vpir-1551474114742"},
"7":{"config":{"on":true,"reachable":true},"etag":"2960e327b075644847fc34518c6bf96d","manufacturername":"Phoscon","modelid":"PHOSCON_FSM_STATE","name":"FSM_STATE y","state":{"lastupdated":"2019-03-01T21:02:22","status":0},"swversion":"1.0","type":"CLIPGenericStatus","uniqueid":"fsm-state-1551474114742"},
"8":{"config":{"battery":100,"on":true,"pending":[],"reachable":true,"sensitivity":11,"sensitivitymax":21,"temperature":2500},"ep":1,"etag":"c69f102b9fc5475c61fe32386ef4d4c0","manufacturername":"LUMI","mode":1,"modelid":"lumi.vibration.aq1","name":"lumi.vibration.aq1 8","state":{"buttonevent":1007,"lastupdated":"2019-03-03T14:39:09"},"swversion":"20180130","type":"ZHASwitch","uniqueid":"00:15:8d:00:02:a4:91:00-01-0101"}
}
Wie könnte ich denn mit Node-Blue einen Websocket-Request aufbauen?
Mit einer http-node geht es irgendwie nicht.
Müsste ich eine php-Funktion bauen, die eine websocket-Verbindung aufbaut und jede eingehende Nachricht an den output liefert?
Hallo @job,
sorry, dass ich diesen Post nicht früher beantworte . Ich bin mir nicht sicher, wie das gelöst werden kann. Es gibt auf jeden Fall WebSocket-Implementierungen in PHP. Nur falls diese Erweiterungen (wie z. B. events) benötigen, kann es sein, dass sie nicht funktionieren. Was aber ginge, wäre die Python-Node. Mit Python sollten WebSockets kein Problem sein.
Viele Grüße
Sathya
Kleiner Nachtrag noch: Adrian arbeitet gerade an einem Zigbee-Modul.
Gibt es Neuigkeiten zu dem Thema?
Hab bei mir derzeit deCONZ laufen, würde das ganze gerne mit homegear + node-blue betreiben.
Das Zigbeemodul sollte nutzbar sein. Es ist von @Adrian entwickelt und bereits in einigen Installationen im Einsatz.
Siehe auch: https://doc.homegear.eu/homegear-zigbee/
Sollte das auch mit dem “günstigen” China-Modul funktionieren?
Und, kann das Homegear-Gateway auch schon Zigbee? Bzw, macht das überhaupt Sinn, weil es ja für die CC2530-Module Routerfirmware gibt?
CC2530 should work, but not all firmwares available for it work ok, there are some for example that do not save settings so when unpowered they lose the network, also they enter network commissioning by themselves, which does not allow homegear to set everything ok for the network. Even those kind of work, but with some issues, so please avoid them.
The homegear gateway also has ZigBee implemented.
Great to hear, thank you adrian. We are talking about the CC2531, right?
Just mentioned the CC2530 as I’ve built a zigbee router with it and wanted to know if using the router or using the homegear-gateway is the right way?
I will check how this works after my vacation. Can you recommend a specific firmware?
As I’ve used zigbee2mqtt is this the correct one? https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip
Actually, 253X and even more. I tested it more with cc2538 connected to the PC, but I also tested with a cc2530 connected to a raspberry over serial.
Basically it should work with any TI solution that has a 3.0.X stack working on it, with some caveats (as the one described above about the firmware set to go into auto commissioning by itself).
For cc2538 we have our own firmware (one that works with an adapter from serial to usb), but for others is ‘trial and error’ with some available on the internet and reported to work.
Thank you. I will try and get back to you.
But is a standalone zigbee-router prefered over a homegear-gateway or vice versa?
I would advise homegear-gateway or the stick connected to where homegear is hosted, to a standard zigbee router. A standard zigbee router (if you mean just a router) is not very capable, homegear configures the stick as a ‘coordinator’ (which also includes zigbee router capabilities, or course).
That sounds great. I was talking about something like this in particular: https://www.zigbee2mqtt.io/how_tos/how_to_create_a_cc2530_router.html
That seems to be only for router capabilities (‘a router firmware’). I would advise having a coordinator instead. Coordinators also do routing and much more (but unlike routers, you can have only one / network).
Thanks again.
So, when using Zigbee you can only have one homegear-gateway?
I thought about placing homegear-gateways or zigbee-routers all over the house to have a decent coverage.
But maybe I misunderstand something…
The zstack can be configured to work in three ways:
- coordinator (this is what homegear connects to and what homegear/homegear-gateway will try to init). This one has routing capabilities but also many others, as security, managing nodes and so on. This is the one responsible with initializing the network, allowing devices joining in or making them leave the network. In principle you can have zigbee network without a coordinator, but I would advise against that.
- router. This one is capable of routing, as the name says, but it’s also misleading, in the sense that many devices out there are also routers, if they are connected to the main power (that is, they are not the battery/sleeping kind). You can of course have a device with only routing capabilities, I think that’s the case with the device from your link. It’s useful if you want coverage and you cannot or don’t want to install devices that do more than routing in that place. But that kind of device does only routing and nothing else (unless it’s also an end device and does whatever functionality has that specific device).
- end devices. Those are the ones that do not have routing capabilities. Besides the sleeping ones, there might be some powered from the grid that miss routing because they needed the memory for implementing something more complex… otherwise with zstack routing comes ‘for free’ and I don’t see a reason why one wouldn’t use it for a device, unless, of course, it’s battery powered and goes to sleep.
So, for a single zigbee network, you would use one coordinator connected to homegear (with or without homegear-gateway) and perhaps several routers such as yours (they are not connected to anything except the zigbee network, of course, so it’s of no use to install homegear-gateway there) for coverage, and of course, the zigbee devices. Typically you don’t need zigbee routers that have only that single functionality, since you may use zigbee devices that also have routing capabilities (smart plugs or something like that).
You may need more than one zigbee network, for example if you have a lot devices, in which case you could use more than one coordinator, one/homegear-gateway or even a couple (or more) connected directly to a single homegear host (but this scenario can rise some issues when pairing, as in the zwave case). Unless you have many zigbee devices, this is not a so typical case.
Thank you very much for that detailed explanation.
Hopefully I will have time to test as soon as I get back.
Cheers!
Please let me know of any issues you encounter.
Is that the case because you need to pair to a coordinator but can only apply the pairing command to the family?