fbacker / broadlink-mqtt-bridge

Bridge Broadlink RM Devices with MQTT and API for e.g. OpenHAB
41 stars 14 forks source link

API action to rescan devices #11

Closed raufis27 closed 5 years ago

raufis27 commented 5 years ago

Could you please add api action to rescan devices ? Or auto rescan ?

There is a problem with broadlink devices, RM3, that they don't "like" static ip address. DHCP reservation also doesn't work, because device expects new address after every reboot/reconnect to wifi.

Thank you!

fbacker commented 5 years ago

The rescan exists in the GUI. I've also now added /api/devices/discover to rescan thru API.

raufis27 commented 5 years ago

Thank you! Discovery API helps with automation process.

raufis27 commented 5 years ago

I couldn't run update, because of package-lock.json:

error: Your local changes to the following files would be overwritten by merge: package-lock.json Please commit your changes or stash them before you merge.

I do have local.json

I backed up package-lock.json and did update as root:

`Upgrade ... Updating 3bd52b9..f4b094c Fast-forward README.md | 6 +++++ index.js | 9 +++++-- package-lock.json | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------- package.json | 12 ++++----- yarn.lock | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------- 5 files changed, 205 insertions(+), 248 deletions(-) Upgrade Done! Unhandled rejection Error: Command failed: /usr/bin/git clone --depth=1 -q -b patch-1 https://github.com/KaloNikolov/broadlinkjs-rm.git /root/.npm/_cacache/tmp/git-clone-c5ccdd76s) fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-c5ccdd76': Permission denied

at ChildProcess.exithandler (child_process.js:281:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Socket.stream.socket.on (internal/child_process.js:336:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:561:12)

npm WARN broadlink-mqtt-bridge@1.0.0 No repository field.

FIXED with sudo npm i -f

fbacker commented 5 years ago

@raufis27 looks like some other file might be changed than local? Maybe you opened another file on the disk. I've changed to the update runs with reset instead of pull. Hopefully this will fix upgrade issue. Please let me know if problem still exists.