Comments (6)
Currently, the websocket only issues events for sensors, see issue #32.
from deconz-rest-plugin.
Thank you very much ! Get gray hair in the meantime.
When can we expect to have websockets also for switches / lights ? Do you know this ?
from deconz-rest-plugin.
Just forget something. Do you have some example script how to use this websocket (beside that only sensors at the moment available)
from deconz-rest-plugin.
I use a very basic NodeJS script on my MacBook, just to monitor what events are being published:
#!/usr/local/bin/node
'use strict';
const WebSocket = require('ws');
const host = '192.168.xxx.xxx';
const port = 443;
const ws = new WebSocket('ws://' + host + ':' + port);
ws.on('open', function open() {
});
ws.on('message', function message(data, flags) {
const date = String(new Date()).substring(0, 24);
console.log(date + ": " + data);
});
NodeJS doesn't seem to come with a native web sockets implementation, so you need to npm install ws
in the directory where you place the script. Note that node
installs under /usr/bin
on the Raspberry Pi, so you might need to change the first line.
To install NodeJS (incl. npm
) on macOS, just download and run the installer (I'm using the 6.10.3 LTS version). For the Raspberry Pi, follow these steps (I'm using the 6_x version).
from deconz-rest-plugin.
PS. The script was inspired by the API documentation.
from deconz-rest-plugin.
from deconz-rest-plugin.
Related Issues (20)
- Human Presence Detector - ZY-M100-S - not working properly HOT 5
- IKEA Parasoll sensor not functioning in Domoticz after loading via the DDF HOT 1
- Aqara Smart Plug with deconz reports jumping energy metering HOT 2
- deconz V2.25.3 - Signify LTW012 show ON (in phoscon) even though it is OFF HOT 30
- Tuya Smoke Detector YG400A - DDF needed HOT 10
- Namron 4512762 HOT 2
- Namron 4512763 HOT 3
- Namron 4512764 HOT 3
- Paulmann 500.67 RGB Remotecontroller HOT 2
- DDF for Tuya TRS MOES (_TZE200_rtrmfadk) HOT 2
- tuya zignee smoke detector TS0601 (_TZE200_rccxox8p) HOT 4
- LIDL smart plug: no update on consumption value (hg08673.json)
- Tuya Vibration Sensor Realtime Monitor HOT 1
- Tuya Scene Switch TS0044 TZ3000_a4xycprs HOT 7
- Thermor 286045 HOT 2
- lumi.sensor_wleak.aq1 reports false state on reboot HOT 1
- New attached TRADFRI on/off button switch 1002 switches all lights at once HOT 4
- Sonoff ZBDongle-E (Router Firmware) HOT 1
- Müller-Licht bulbs create a group 240
- _TZE204_sxm7l9xa doesn't show targetdistance HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deconz-rest-plugin.