lopelex / harmony-websocket Goto Github PK
View Code? Open in Web Editor NEWWebsocket implementation for Harmony Hub
Home Page: https://github.com/lopelex/harmony-websocket
License: MIT License
Websocket implementation for Harmony Hub
Home Page: https://github.com/lopelex/harmony-websocket
License: MIT License
First off, thanks for creating this API. It's exactly what so many of us have been looking for, and I'm sure it will gain a lot of popularity very soon.
I'm wondering if a .off()
method would be helpful for a lot of people. It isn't always readily clear that doing .startActivity('1')
is the code that is necessary to turn off whatever activity is currently running.
Other than that, I like how it's very simple, modern, and straight-forward!
name: 'StatusCodeError',
statusCode: 417,
message: '417 - {"code":"417"}',
error: { code: '417' },
options:
{ url: 'http://10.11.99.17:8088',
method: 'POST',
timeout: 5000,
headers:
{ 'Content-type': 'application/json',
Accept: 'text/plain',
Origin: 'http//:localhost.nebula.myharmony.com' },
json: true,
body: { id: 0, cmd: 'connect.discoveryinfo?get', params: {} },
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
look at that eff'ed up localhost URL.
Originally posted by @stoneobscurity in #4 (comment)
I apologize in advance for adding this issue here but I could not find a way to create this issue under here
https://github.com/lopelex/node-red-contrib-harmony
The sendCommandsWithDelay does not seem to be implemented. Please advise.
Thanks, Stephan
Hi:
Setup:
Home Assistant on Pi4
Supervisor Version: 2020.12.7
Home Assistant OS 5.8
Trying to install the Nodes and get the following in the log:
2020-12-16T22:51:28.299Z Install : node-red-contrib-harmony-websocket 2.2.4
2020-12-16T22:51:30.901Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production [email protected]
2020-12-16T22:51:43.862Z [out]
2020-12-16T22:51:43.862Z [out] > [email protected] install /config/node-red/node_modules/bufferutil
2020-12-16T22:51:43.862Z [out] > node-gyp-build
2020-12-16T22:51:43.862Z [out]
2020-12-16T22:51:46.177Z [err] gyp
2020-12-16T22:51:46.178Z [err]
2020-12-16T22:51:46.178Z [err] ERR! build error
2020-12-16T22:51:46.179Z [err] gyp
2020-12-16T22:51:46.180Z [err] ERR! stack
2020-12-16T22:51:46.180Z [err] Error: not found: make
2020-12-16T22:51:46.180Z [err] gyp ERR!
2020-12-16T22:51:46.180Z [err] stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
2020-12-16T22:51:46.180Z [err] gyp ERR!
2020-12-16T22:51:46.180Z [err] stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
2020-12-16T22:51:46.180Z [err] gyp ERR!
2020-12-16T22:51:46.181Z [err] stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
2020-12-16T22:51:46.181Z [err] gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
2020-12-16T22:51:46.181Z [err] gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2020-12-16T22:51:46.181Z [err] gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2020-12-16T22:51:46.181Z [err] gyp
2020-12-16T22:51:46.182Z [err] ERR! stack at FSReqCallback.oncomplete (fs.js:168:21)
2020-12-16T22:51:46.183Z [err] gyp ERR! System Linux 5.4.79-v8
2020-12-16T22:51:46.183Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-12-16T22:51:46.183Z [err] gyp ERR! cwd /config/node-red/node_modules/bufferutil
2020-12-16T22:51:46.183Z [err] gyp ERR! node -v v12.18.4
2020-12-16T22:51:46.184Z [err] gyp ERR! node-gyp -v v5.1.0
2020-12-16T22:51:46.184Z [err] gyp ERR! not ok
2020-12-16T22:51:46.184Z [err]
2020-12-16T22:51:46.868Z [err] npm
2020-12-16T22:51:46.868Z [err] WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
2020-12-16T22:51:46.869Z [err]
2020-12-16T22:51:46.892Z [err] npm ERR!
2020-12-16T22:51:46.892Z [err] code ELIFECYCLE
2020-12-16T22:51:46.892Z [err] npm ERR!
2020-12-16T22:51:46.892Z [err] errno 1
2020-12-16T22:51:46.900Z [err] npm
2020-12-16T22:51:46.900Z [err] ERR! [email protected] install: node-gyp-build
2020-12-16T22:51:46.900Z [err] npm ERR! Exit status 1
2020-12-16T22:51:46.901Z [err] npm ERR!
2020-12-16T22:51:46.901Z [err] npm ERR! Failed at the [email protected] install script.
2020-12-16T22:51:46.901Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-12-16T22:51:46.923Z [err]
2020-12-16T22:51:46.923Z [err] npm ERR! A complete log of this run can be found in:
2020-12-16T22:51:46.923Z [err] npm ERR! /root/.npm/_logs/2020-12-16T22_51_46_911Z-debug.log
2020-12-16T22:51:46.954Z rc=1
Any help would be much appreciated
First thank you for this great work! 90% of my home automation relay on this npm (using node-red-contrib-harmony in node-red) and it's a life saver.
From time to time (I couldn't find any specific trigger) an exception is thrown and kills node-red completely:
Error: Can't send data because WebSocket is not opened. at exports.throwIf (/share/CACHEDEV1_DATA/homes/admin/.node-red/node_modules/harmony-websocket/node_modules/websocket-as-promised/dist/index.js:3470:11) at WebSocketAsPromised.send (/share/CACHEDEV1_DATA/homes/admin/.node-red/node_modules/harmony-websocket/node_modules/websocket-as-promised/dist/index.js:554:7) at Timeout._interval.setInterval [as _onTimeout] (/share/CACHEDEV1_DATA/homes/admin/.node-red/node_modules/harmony-websocket/lib/harmony-websocket.js:136:59) at ontimeout (timers.js:475:11) at tryOnTimeout (timers.js:310:5) at Timer.listOnTimeout (timers.js:270:5)
At first I thought that i used too many "Harmony-Observe" nodes since the harmony hub is really not that reliable and maybe too many open sockets start some snowball and crashes, but after re-design all my flows to use only one main "Harmony-Observe" node-red still crashes (at least once a day or two).
I am using node 8.9.4 and node-red 0.20.6 but on ARM system (Qnap TS-431p).
I don't care about the exception (and probably the Harmony hub is really not open) but since it kill node-red it's a bugger issue.
I wasn't sure if to open on node-red-contrib-harmony repo since the exception is more related to harmony-websocket but maybe node-red-contrib-harmony should handle the exception better so let me know if to move this to node-red-contrib-harmony repo.
What do you think?
Hi,
The latest hub update that was released yesterday broke the initial http request I think and we get a 417 http code .
I will check but just wanted you to know. I took a look at the headers of the app (since it was not updated) and noticed some difference but nothing very « important » except if they now analyse the referer (which would be not good ;) ) :
POST / HTTP/1.1
Host: 192.168.1.42:8088
Content-Type: application/json
Origin: http://sl.dhg.myharmony.com
Accept-Encoding: gzip, deflate
Connection: keep-alive
Accept: /
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57 HClient/5.6 (iOS,12.1.4,iPhone) Version/6.0 Safari/8536.25
Referer: http://sl.dhg.myharmony.com/mobile/2/production/_fr.mobile.html?is321&locale=fr-FR&clientId=Blabla&hubName=salon&sessionId=Blabla&lipClientId=Blabla&hubIP=192.168.1.42&settings&discoveryUrl=http://svcs.myharmony.com/Discovery/Discovery.svc&susChannel=Production
Content-Length: 69
Accept-Language: fr-fr
Hi, I have some unmet dependencies on some installations when I do a npm -list, I think that latest is not handled correctly if the dependency (very common for request) is referenced by another packet in npm directory. Som users are exepriencing strnage behaviors sometimes with network issues, and reinstalling seems to fix it most of the time. I am not really used to @latest syntax in package.json, do you have any idea if it could be a problem at all ?
+-- [email protected]
| +-- [email protected]
| | +-- UNMET DEPENDENCY request@latest
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected] deduped
| | +-- UNMET DEPENDENCY websocket@latest
| | `-- UNMET DEPENDENCY websocket-as-promised@latest
| +-- [email protected]
| | `-- [email protected]
| | `-- [email protected]
| +-- [email protected] invalid
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected] extraneous
| | +-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected] extraneous
| | `-- [email protected] extraneous
| +-- [email protected] extraneous
| `-- [email protected] extraneous
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.