Coder Social home page Coder Social logo

broadlink-mqtt-bridge's Introduction

Yet another MQTT - Broadlink Bridge

This one is built specifically with OpenHAB on a Raspberry PI in mind. However it can be used in other scenarios installation outside RPI. It's possible to run this with e.g. Home Assistant.

More information

Read the wiki https://github.com/fbacker/broadlink-mqtt-bridge/wiki

It has a Admin GUI for helping record IR / RF signals. You will be able with the filetree see all recorded actions, delete actions and if a disclamation mark occures, this means that the action is a duplicate of another (has same binary content).

admin gui

Requirements Home Assistant

  • Node > 8
  • MQTT Broker
  • Broadlink device e.g. RM 3 PRO

Requirements OpenHAB

  • Node > 8 (installed on RPI OpenHAB)
  • MQTT (mosquitto in OpenHAB)
  • Broadlink device e.g. RM 3 PRO

Breaking Changes v2 -> v3 (buffer to base64)

WARNING: upgrade is changed. Please read the installation page

Commands are saved as base64 files to make it easier to copy from/to other systems.

As for now if the new base64 (.txt) file isn't found it will try to run the (.bin) file instead. This can be changed in future releases so make sure to upgrade your commands and don't delete the old files until you are sure that they work.

To migrate existing commands run npm run convert in the service folder. This will create base64 files of all existing bin files (nothing is deleted).

You can se on the icons what is 'old file -> disclaimer (marked file)' and 'new base64 file .> bolt'. admin gui

Breaking Changes v1 -> v2 OpenHAB

If previously been using this service and upgrading you'll need to migrate OpenHAB way of handling things.

Binding MQTT 1.x (legacy) doesn't work. Please use the updated way of handling MQTT messages with OpenHAB. View wiki for examples. There's also example of how to downgrade to latest release of version 1.

broadlink-mqtt-bridge's People

Contributors

dafritz84 avatar dependabot[bot] avatar dhmdmdhm avatar elduderinos avatar fbacker avatar sapkra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

broadlink-mqtt-bridge's Issues

NODE_ENV value of 'production' did not match any deployment config file names

I have setup a new Raspberry Pi 4 with openhab 2.5.9 as per instructions from github. also installed Mosquitto.
openhab is working correctly and Mosquitto aswell.
I have installed broadlink-mqtt-bridge as per instruction. (New Install)
Server starts then stops .
I have created the local.json file as in previous installation on RPI 3 and restored commands folder from backup.
Previous version of broadlink-mqtt-bridge on RPI 3 has been working.
I have also setup a fresh install of openhab 2.5.9 on new RPI 3 and still get same errors accross both platforms

The Broadlink controls 30% of home automation. TV, Roller Blinds, Air Con, Heating.
Since this upgrade no Broadlink control.

Below is screen capture of install and error on sudo service broadlinkbridge status

[06:40:26] openhabian@openhab:~$ sudo bash -c "$(curl -sL https://raw.githubusercontent.com/fbacker/broadlink-mqtt-bridge/master/installers/raspberry.sh)"


| _ "\ /" \ / " \ /""\ |" "|" | |" \ (" |" |/"| / ")
(. |) :|: |// ____ \ / \ (. ___ :|| | || ||.\ \ (: |/ /
|: /|_____/ / / ) :/' /\ \ |: \ ) ||: | |: ||: . \ | __/
(| _ \ // (: (
/ /// ' \ (| (\ ||\ |_ |. ||. \ . (// _
|: |) :|: __ \ / / \ |: :( _|: \ /\ || \ \ |: | \
(
___/|| _)"(/ _(/ _(_|_|_(__| _)

Version 2.4.0

Installing helper tools ...
Check current Node installation ...
Node currently installed. Checking version number.
Minimum Node version: v10.13.0
Installed Node version: v12.18.4
No Node.js upgrade necessary.
Check current NPM installation ...
NPM currently installed. Checking version number.
Minimum NPM version: 6.4.1
Installed NPM version: 6.14.6
No NPM upgrade necessary.
Cloning ...
Cloning into 'broadlink-mqtt-bridge'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 37 (delta 1), reused 33 (delta 0), pack-reused 0
Unpacking objects: 100% (37/37), done.
Cloning Done!
Upgrade ...
HEAD is now at 80c6390 upgrade installer version
rm: cannot remove './node_modules': No such file or directory
Already up to date.
Upgrade Done!
Install packages
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: this library is no longer supported
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN [email protected] No repository field.

added 325 packages from 213 contributors and audited 574 packages in 72.061s

6 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Dependencies installation Done!
Update System Services
Broadlink rebooted and ready!
[06:42:59] openhabian@openhab:~$

broadlinkbridge.service - Broadlink MQTT Bridge
Loaded: loaded (/etc/systemd/system/broadlinkbridge.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2020-09-24 07:19:36 AEST; 5s ago
Main PID: 6874 (node)
Tasks: 23 (limit: 1551)
CGroup: /system.slice/broadlinkbridge.service
├─6874 npm
├─6885 sh -c node -r esm index.js
└─6886 node -r esm index.js

Sep 24 07:19:36 openhab systemd[1]: Started Broadlink MQTT Bridge.
Sep 24 07:19:38 openhab npm[6874]: > [email protected] production /srv/openhab2-conf/broadlink-mqtt-bridge
Sep 24 07:19:38 openhab npm[6874]: > node -r esm index.js
Sep 24 07:19:39 openhab npm[6874]: WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
Sep 24 07:19:39 openhab npm[6874]: WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Sep 24 07:19:40 openhab npm[6874]: LOGLEVEL: info

[07:20:32] openhabian@openhab:~$ sudo service broadlinkbridge status
● broadlinkbridge.service - Broadlink MQTT Bridge
Loaded: loaded (/etc/systemd/system/broadlinkbridge.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2020-09-24 07:20:30 AEST; 4s ago
Main PID: 7016 (node)
Tasks: 23 (limit: 1551)
CGroup: /system.slice/broadlinkbridge.service
├─7016 npm
├─7030 sh -c node -r esm index.js
└─7031 node -r esm index.js

Sep 24 07:20:30 openhab systemd[1]: Started Broadlink MQTT Bridge.
Sep 24 07:20:32 openhab npm[7016]: > [email protected] production /srv/openhab2-conf/broadlink-mqtt-bridge
Sep 24 07:20:32 openhab npm[7016]: > node -r esm index.js
Sep 24 07:20:34 openhab npm[7016]: WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
Sep 24 07:20:34 openhab npm[7016]: WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Sep 24 07:20:34 openhab npm[7016]: LOGLEVEL: info
[07:20:35] openhabian@openhab:$ sudo service broadlinkbridge status
● broadlinkbridge.service - Broadlink MQTT Bridge
Loaded: loaded (/etc/systemd/system/broadlinkbridge.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2020-09-24 07:20:38 AEST; 3s ago
Process: 7016 ExecStart=/usr/bin/npm run production (code=exited, status=1/FAILURE)
Main PID: 7016 (code=exited, status=1/FAILURE)
[07:20:42] openhabian@openhab:
$

I keep checking sudo service broadlinkbridge status
And it appears it keeps restarting and eventually goes dead.

I have re built both Raspberry Pi 3 and 4 several times and can not figure out the problem

Rm mini3

Le rm mini3 est reconnu mais impossible de lui faire envoyer des commandes. Pas de voyant s'allume pour confirmer l'envoi de la commande. Aucun problème avec le rm pro 3
Comment procéder ?

Latest update broke lot of things

Let me reopen the problem.
In fact I could update to the latest version without issues, but it broke everything.
Now I cannot control anymore from openhab
I always get the error:

[info]: 	Prepare topic: broadlink/light/nec, message: power_on_preset:780f774e7d2a 
[warn]: 	Failed to find file: /srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec/power_on_preset:780f774e7d2a.bin

when I ask to play the message on the particular device it actually binds the device to the filename, so it couldn't find it.

moreover now in the UI, the topic is always wrong. If I click to the message to send it creates the topic like this:
Topic* broadlink/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec
Message* power_on_preset
Device ************ (not shown but the id is correct)

If I play from the UI I get this error:

[info]: 	Prepare topic: broadlink/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec, message: power_on_preset 
[warn]: 	Failed to find file: /srv/openhab2-conf/broadlink-mqtt-bridge/commands/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec/power_on_preset.bin 

The topic should be: broadlink/light/nec

Please can you help fix this problem?
Another thing, is it possible to rescan the devices automatically every time the raspberry pi reboots?

Originally posted by @combatistor in #27 (comment)

Device scan - only 2 devices at a time

I have 3 broad link devices - two are RM mini and one is Pro Plus. The only two devices are discovered after scan. Just after service restart I see both RM mini then when manually run scan I see one RM mini and Pro Plus. It acts as if only two devices can be active at the same time - any ideas ?

MQTT Error 5

Hello fbacker,
I installed your MQTT bridge yesterday.
Installation went fine, just had to change the port because grafana is using the port 3000, too.

I just have one problem, I keep getting this error in the gui:

MQTT Closed MQTT Error { "code": 5 }

my conf is like this:

{ "mqtt": { "host": "192.168.0.2", "port": 1883, "protocol": "mqtt", "subscribeBasePath": "broadlink", "user": "testeduser", "pwd": "testedpassword" }, "recording": { "timeout": { "ir": 30, "rf": 30 }, "path": null }, "gui": { "port": 3001 } }

Credentials were tested with mqtt fx, all other mqtt stuff is working. mqtt broker is running on the same pi, i tried it with 127.0.0.1 too.
Is there anything I did wrong?

TypeError: log is not a function

I have installed using the manual method on https://github.com/fbacker/broadlink-mqtt-bridge/wiki/Installation.

The only difference is that I do not have the /srv/ directory, so I installed in my home directory to prevent requiring elevated user credentials.

On running npm run production I get the following output in the console:

pi@raspberrypi:~/broadlink-mqtt-bridge $ npm run production

> [email protected] production /home/pi/broadlink-mqtt-bridge
> node -r esm index.js

LOGLEVEL: info
2020-04-27 19:35:57 [info]: 	Starting Broadlink MQTT NodeJS Application 
(node:29037) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at /home/pi/broadlink-mqtt-bridge/src/actions/files.js:131:25
(node:29037) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29037) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeError: log is not a function
    at Broadlink.addDevice (/home/pi/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:219:7)
    at Broadlink.onMessage (/home/pi/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:185:10)
    at Socket.emit (events.js:310:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at UDP.onMessage [as onmessage] (dgram.js:924:8)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] production: `node -r esm index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-04-27T19_35_58_283Z-debug.log

The log file mentioned at the end of the error above shows as below:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/bin/npm', 'run', 'production' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle [email protected]~preproduction: [email protected]
6 info lifecycle [email protected]~production: [email protected]
7 verbose lifecycle [email protected]~production: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~production: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/broadlink-mqtt-bridge/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle [email protected]~production: CWD: /home/pi/broadlink-mqtt-bridge
10 silly lifecycle [email protected]~production: Args: [ '-c', 'node -r esm index.js' ]
11 silly lifecycle [email protected]~production: Returned: code: 1  signal: null
12 info lifecycle [email protected]~production: Failed to exec production script
13 verbose stack Error: [email protected] production: `node -r esm index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/pi/broadlink-mqtt-bridge
16 verbose Linux 4.19.66-v7+
17 verbose argv "/usr/local/bin/node" "/usr/bin/npm" "run" "production"
18 verbose node v12.16.2
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] production: `node -r esm index.js`
22 error Exit status 1
23 error Failed at the [email protected] production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

For info, I'm trying to connect to an RM4C Mini.

Broadlink device is not recognized

A device broadlink rm3 mini is present in network and is found by bridge. But it's type and ID aren't recognized and are set as undefined, which makes it's usage absolutely impossible.
Service restart, device restart and rescan gives no results.
Used the latest bridge version from github. Openhabian on Rpi3B.
Screen of web page:
Screenshot 2019-12-17 at 18 46 56

Recording

Hi I just got the MQTT Broadlink update to V2, and honstly I preffer the last version the V1, how can I install it back?
and if it's impossible to get V1 how do I record IR Code on the new V2?

Thank you.

Record IR do not work for electra AC remote

2018-10-11 13:50:12 [info]: Web User want action {
"action": "recordir",
"topic": "broadlink2/broadlink/tv/samsung/power222"
}
2018-10-11 13:50:12 [debug]: prepareAction {
"action": "recordir",
"topic": "broadlink2/broadlink/tv/samsung/power222",
"origin": "web"
}
2018-10-11 13:50:12 [debug]: deviceEnterLearningIR
2018-10-11 13:50:12 [info]: recordIR: Press an IR signal
2018-10-11 13:50:13 [info]: recordIR: Timeout in 30
2018-10-11 13:50:14 [info]: recordIR: Timeout in 29
2018-10-11 13:50:15 [info]: recordIR: Timeout in 28
2018-10-11 13:50:16 [info]: recordIR: Timeout in 27
2018-10-11 13:50:16 [debug]: Broadlink IR RAW
/etc/openhab2/scripts/broadlink-mqtt-bridge/index.js:460
device.emitter.off("rawData", callback);
^

TypeError: device.emitter.off is not a function
at Device.callback (/etc/openhab2/scripts/broadlink-mqtt-bridge/index.js:460:22)
at emitOne (events.js:116:13)
at Device.emit (events.js:211:7)
at Device.onPayloadReceived (/etc/openhab2/scripts/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:389:14)
at Socket.socket.on (/etc/openhab2/scripts/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:274:14)
at emitTwo (events.js:126:13)
at Socket.emit (events.js:214:7)

Not able to build project with `npm install`

This project is of great interest to me however, I'm not able to run npm install on the project.

Node version :- v10.16.0
NPM version :- v6.9.0

Running npm install in verbose mode I get this error :-

npm verb stack TypeError: err.code.match is not a function npm verb stack at BB.try.catch.err (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/with-tarball-stream.js:110:55) npm verb stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23) npm verb stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31) npm verb stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18) npm verb stack at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10) npm verb stack at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:690:18) npm verb stack at _drainQueueStep (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12) npm verb stack at _drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9) npm verb stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5) npm verb stack at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14) npm verb stack at runCallback (timers.js:794:20) npm verb stack at tryOnImmediate (timers.js:752:5) npm verb stack at processImmediate [as _immediateCallback] (timers.js:729:5)

NODE_ENV value of 'production' did not match any deployment config file names.

Hello I just installed the broadlink-mqtt-bridge, but the service doesn't start.

I saw in the service status this message:

sudo service broadlinkbridge status -l
● broadlinkbridge.service - Broadlink MQTT Bridge
   Loaded: loaded (/etc/systemd/system/broadlinkbridge.service; disabled)
   Active: active (running) since jue 2020-07-02 21:21:06 CEST; 11s ago
 Main PID: 31187 (npm)
   CGroup: /system.slice/broadlinkbridge.service
           ├─31187 npm
           ├─31201 sh -c node -r esm index.js
           └─31202 node -r esm index.js

jul 02 21:21:06 PI_314 systemd[1]: Stopping Broadlink MQTT Bridge...
jul 02 21:21:06 PI_314 systemd[1]: Starting Broadlink MQTT Bridge...
jul 02 21:21:06 PI_314 systemd[1]: Started Broadlink MQTT Bridge.
jul 02 21:21:09 PI_314 npm[31187]: > [email protected] production /srv/openhab2-conf/broadlink-mqtt-bridge
jul 02 21:21:09 PI_314 npm[31187]: > node -r esm index.js
jul 02 21:21:15 PI_314 npm[31187]: WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
jul 02 21:21:15 PI_314 npm[31187]: WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
jul 02 21:21:15 PI_314 npm[31187]: LOGLEVEL: debug

I saw the wiki with the strict mode and I didn't find what the problem is.

I saw syslog and and it takes me to npm logs.

The npm log, which is repeating three times per minute, includes the next content:

cat 2020-07-02T19_26_40_646Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'production' ]
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ] 
5 info lifecycle [email protected]~preproduction: [email protected] 
6 info lifecycle [email protected]~production: [email protected] 
7 verbose lifecycle [email protected]~production: unsafe-perm in lifecycle true 
8 verbose lifecycle [email protected]~production: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
9 verbose lifecycle [email protected]~production: CWD: /srv/openhab2-conf/broadlink-mqtt-bridge 
10 silly lifecycle [email protected]~production: Args: [ '-c', 'node -r esm index.js' ] 
11 silly lifecycle [email protected]~production: Returned: code: 1  signal: null 
12 info lifecycle [email protected]~production: Failed to exec production script 
13 verbose stack Error: [email protected] production: `node -r esm index.js` 
13 verbose stack Exit status 1 
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 
13 verbose stack     at EventEmitter.emit (events.js:198:13) 
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 
13 verbose stack     at ChildProcess.emit (events.js:198:13) 
13 verbose stack     at maybeClose (internal/child_process.js:982:16) 
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 
14 verbose pkgid [email protected] 
15 verbose cwd /srv/openhab2-conf/broadlink-mqtt-bridge 
16 verbose Linux 4.9.35-v7+ 
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "production" 
18 verbose node v10.21.0 
19 verbose npm  v6.14.4 
20 error code ELIFECYCLE 
21 error errno 1 
22 error [email protected] production: `node -r esm index.js` 
22 error Exit status 1 
23 error Failed at the [email protected] production script. 
23 error This is probably not a problem with npm. There is likely additional logging output above. 
24 verbose exit [ 1, true ] 

I'm running openhab2 and mosquitto in a RPI 3b+.

Thanks for your attention.

New RM mini 3 Version with id 0x27de

Hi, I just bought a new RM mini 3. It was not discovered by broadlinkbridge:

[Info] We've discovered an unknown Broadlink device. This likely won't cause any issues.

Please raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: "27de". The device is connected to your network with the IP address "192.168.2.112".

I added it to broadlinkjs-rm/index.js line 11 as
rmDeviceTypes[parseInt(0x27de, 16)] = 'Broadlink RM Mini 3 v2';

After this it was discovered. Please add the new device type in the repo.

Support for MQTT login

Hi,

I am trying to config. this with a MQTT login. The usual mqtt login format is username:password@. But this doesn't seems to work. It fail to connect to the MQTT server (both MQTT log and the bridge log confirm this) The bridge is in a docker and so is the MQTT broker. There are other devices connected to the broker and working.

Any idea?

Multiple devices configuration

Hello everyone,
Does anyone know how to use the broadlink-mqtt-bridge V2 with multiple devices?
In the first version, all was working fine.
But, with this new version, I am not able to work with more than 1 device.

Thank you for your help!

[warn]: Failed to find file

Hi,

when tring to record my first button i get an "Error: IR timeout" first and when I try to play that button I get this warning [warn]: Failed to find file.
Any suggestion?

Thank you
Erik

Files api allows deletion of files outside the commands folder

Hi,

there seems to be a severe security issue in web.js on line 162:
Link

Calls to 'files delete' are unchecked and can be exploited to delete the entire installation. E.g., I was successful in removing package.json with the following code:

curl --request DELETE \ --url http://<IP_TO_YOUR_INSTALLATION>:3000/api/files \ --header 'content-type: application/x-www-form-urlencoded' \ --data file=package-lock.json

I propose only to allow the deletion of items in the commands subdirectory.

Graphique :3000 impssible

hello, I can't find the access cd /srv/openhab2-conf/ to do the installation. so I can't have access to the graphical interface

what should I do?

RF is played too long

Is there a way to shorten the length of time that the RF command is played back on broadlink? For my device, a short tap is different from a press and hold. The playback seems to be a press and hold for quite a long time, maybe 5 seconds or so.

Command issue

What does this mean?

2021-01-22 21:43:15 [error]: Missing commands
{
"path": "",
"type": "folder",
"text": "commands",
"time": "2021-01-22T20:57:07.640Z",
"children": [],
"id": "d41d8cd98f00b204e9800998ecf8427e"
}

to many parameters in openhab

hello

i want to send commands from openhab, and this is how i define my item

Switch tv "turn on tv" {mqtt=">[mosquitto:broadlink/tv/peerless/turnon:command:ON:play:0d43b4e42518],>[mosquitto:broadlink/tv/peerless:command:OFF:play:0d43b4e42518]"}

but i get an error, because the mqtt binding only let me send 5 parameters with “:”, this is the error from the log

is not a valid outbound configuration: Configuration requires 5 parameters separated by ':'

when i remove one of the “:” its send the message, for example without the “0d43b4e42518” but this is the device id, so it receive message but it will not work as i need to send this id number, and i get message from the broadlink bridge

mqtt failed Multiple devices exists. Please specify one to use.

Fail to run as a service on openhabian (runs OK when started manually)

May 12 11:39:55 openHABianPi systemd[1]: Starting Broadlink MQTT Bridge...
May 12 11:39:55 openHABianPi systemd[1]: Started Broadlink MQTT Bridge.
May 12 11:39:55 openHABianPi node[4037]: /srv/openhab2-conf/broadlink-mqtt-bridge/index.js:63
May 12 11:39:55 openHABianPi node[4037]: const { timestamp, level, message, ...args } = info;
May 12 11:39:55 openHABianPi node[4037]: ^^^
May 12 11:39:55 openHABianPi node[4037]: SyntaxError: Unexpected token ...
May 12 11:39:55 openHABianPi node[4037]: at createScript (vm.js:53:10)
May 12 11:39:55 openHABianPi node[4037]: at Object.runInThisContext (vm.js:95:10)
May 12 11:39:55 openHABianPi node[4037]: at Module._compile (module.js:543:28)
May 12 11:39:55 openHABianPi node[4037]: at Object.Module._extensions..js (module.js:580:10)
May 12 11:39:55 openHABianPi node[4037]: at Module.load (module.js:488:32)
May 12 11:39:55 openHABianPi node[4037]: at tryModuleLoad (module.js:447:12)
May 12 11:39:55 openHABianPi node[4037]: at Function.Module._load (module.js:439:3)
May 12 11:39:55 openHABianPi node[4037]: at Module.runMain (module.js:605:10)
May 12 11:39:55 openHABianPi node[4037]: at run (bootstrap_node.js:427:7)
May 12 11:39:55 openHABianPi node[4037]: at startup (bootstrap_node.js:151:9)
May 12 11:39:55 openHABianPi systemd[1]: broadlinkbridge.service: main process exited, code=exited, status=1/FAILURE
May 12 11:39:55 openHABianPi systemd[1]: Unit broadlinkbridge.service entered failed state.

Convert RF to Bin file

Hi,

I have the following HEX, but I can't learn RF codes as I have lost the remote. I currently works with IHC app but want it working on this.

How can I convert the following to work

-78, 4, -124, 3, 13, 23, 24, 11, 25, 11, 24, 12, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 24, 12, 12, 23, 13, 23, 13, 22, 25, 11, 24, 11, 13, 23, 13, 23, 12, 23, 13, 23, 12, 23, 25, 11, 13, 23, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 13, 23, 12, 23, 13, 23, 24, 0, 1, 0, -97, 49, 12, 23, 13, 23, 24, 11, 13, 23, 25, 10, 13, 23, 13, 22, 13, 23, 12, 24, 24, 11, 24, 12, 24, 11, 25, 11, 12, 23, 13, 23, 12, 23, 25, 11, 24, 12, 24, 11, 13, 22, 13, 23, 13, 23, 24, 11, 24, 12, 12, 23, 13, 23, 12, 23, 13, 23, 13, 22, 25, 11, 12, 23, 25, 11, 12, 24, 12, 23, 12, 23, 25, 11, 12, 23, 13, 23, 13, 23, 24, 0, 1, 0, -97, 48, 13, 22, 13, 23, 25, 11, 12, 23, 25, 11, 12, 23, 12, 24, 12, 23, 13, 23, 25, 10, 25, 11, 25, 11, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 24, 12, 12, 23, 13, 22, 13, 23, 24, 12, 24, 11, 13, 23, 13, 22, 13, 23, 13, 23, 12, 23, 24, 12, 12, 23, 25, 11, 13, 22, 13, 23, 12, 23, 25, 11, 13, 23, 12, 23, 13, 23, 24, 0, 1, 0, -97, 48, 13, 23, 13, 22, 25, 11, 13, 22, 25, 11, 13, 23, 12, 23, 13, 22, 13, 23, 25, 11, 24, 11, 25, 11, 24, 11, 13, 23, 13, 22, 13, 23, 24, 12, 24, 11, 25, 11, 13, 22, 13, 23, 13, 22, 25, 11, 25, 11, 12, 23, 13, 23, 12, 23, 13, 23, 12, 23, 24, 12, 12, 23, 25, 11, 13, 22, 13, 23, 13, 22, 25, 11, 12, 24, 12, 23, 13, 23, 24, 0, 1, 0, -97, 48, 13, 23, 12, 23, 25, 11, 13, 22, 25, 11, 13, 22, 13, 23, 13, 23, 12, 23, 25, 11, 24, 11, 25, 11, 24, 11, 13, 23, 12, 24, 12, 23, 25, 11, 24, 11, 25, 11, 13, 22, 13, 23, 12, 23, 25, 11, 24, 12, 12, 23, 13, 23, 12, 23, 13, 23, 13, 23, 24, 11, 12, 24, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 13, 23, 12, 23, 13, 23, 24, 0, 1, 0, -96, 48, 12, 23, 13, 23, 24, 11, 13, 23, 25, 10, 13, 23, 13, 22, 13, 23, 13, 23, 24, 11, 25, 11, 24, 11, 25, 11, 13, 23, 12, 23, 13, 22, 25, 11, 25, 11, 24, 11, 13, 23, 13, 23, 12, 23, 24, 12, 24, 11, 13, 23, 13, 22, 13, 23, 12, 23, 13, 23, 24, 12, 12, 23, 25, 11, 12, 23, 13, 22, 13, 23, 25, 11, 12, 23, 13, 23, 13, 23, 24, 0, 1, 0, -97, 48, 13, 23, 13, 23, 24, 11, 13, 23, 24, 11, 13, 23, 12, 24, 12, 23, 13, 23, 24, 11, 25, 11, 24, 11, 25, 11, 13, 22, 13, 23, 13, 23, 24, 11, 25, 11, 24, 11, 13, 23, 13, 22, 13, 23, 24, 11, 25, 11, 13, 22, 13, 23, 13, 23, 12, 23, 13, 23, 24, 11, 13, 23, 25, 10, 13, 23, 12, 23, 13, 23, 24, 12, 12, 23, 13, 23, 12, 23, 25, -1, -96, 48, 13, 22, 13, 23, 25, 11, 12, 23, 25, 11, 13, 22, 13, 23, 13, 23, 12, 23, 25, 11, 24, 11, 25, 11, 24, 11, 13, 23, 12, 24, 12, 23, 24, 12, 24, 11, 24, 11, 13, 23, 13, 23, 12, 23, 25, 11, 24, 11, 13, 23, 12, 23, 13, 23, 12, 23, 13, 23, 24, 12, 12, 23, 24, 11, 13, 23, 13, 23, 12, 23, 25, 11, 12, 23, 13, 23, 13, 23, 24, 0, 1, 0, -97, 48, 12, 23, 13, 23, 24, 12, 12, 23, 25, 11, 12, 23, 13, 22, 13, 23, 13, 23, 24, 11, 25, 11, 24, 12, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 13, 23, 12, 23, 13, 23, 12, 23, 13, 23, 24, 11, 13, 23, 24, 11, 13, 23, 12, 23, 13, 23, 25, 10, 13, 23, 12, 24, 12, 23, 25, -1, -96, 47, 13, 23, 13, 22, 25, 11, 13, 22, 25, 11, 13, 23, 12, 23, 13, 23, 12, 23, 25, 11, 24, 11, 25, 11, 24, 11, 13, 23, 13, 22, 13, 23, 25, 11, 24, 11, 24, 12, 12, 23, 13, 23, 12, 23, 25, 11, 24, 11, 13, 23, 12, 24, 12, 23, 12, 23, 13, 23, 24, 12, 12, 23, 24, 12, 12, 23, 13, 22, 13, 23, 25, 11, 12, 23, 13, 23, 13, 22, 25, -1, -96, 48, 13, 22, 13, 23, 25, 11, 12, 23, 25, 10, 13, 23, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 24, 11, 25, 11, 12, 23, 13, 23, 13, 23, 24, 11, 25, 11, 24, 11, 13, 23, 12, 23, 13, 23, 24, 11, 25, 11, 12, 23, 13, 23, 12, 23, 13, 23, 12, 23, 25, 11, 12, 23, 25, 11, 12, 23, 13, 23, 12, 24, 24, 11, 12, 24, 12, 23, 13, 23, 24, 0, 5, -36, 0, 0, 0, 0

Cannot read property 'enterRFSweep' of undefined

Have upgraded to latest version of broadllink-mqtt-bridge. After upgrade can not control Broadlink RM pro. Can Access Web GUI on 3000 . Device Scan finds the device

Attempted to re record a RF function and seems stuck in recording mode, but no light on Broadlink to show recording like in previous version

2019-11-28 20:06:37 [info]: Starting Broadlink MQTT NodeJS Application
2019-11-28 20:06:37 [info]: Device found model: Broadlink RM2 Pro Plus v2, id: 34ea348efa7a, ip: 192.168.0.49
2019-11-28 20:07:02 [info]: Broadlink Discovery completed. Found 1 devices.
2019-11-28 20:07:33 [info]: Prepare topic: broadlink/blinds/lounge/up, message: on
2019-11-28 20:07:33 [error]: Error TypeError: Cannot read property 'enterRFSweep' of undefined
2019-11-28 20:07:33 [info]: Prepare topic: broadlink/blinds/lounge/up, message: on
2019-11-29 06:03:34 [error]: Already recording.

I started from scratch again. new SD card new raspberry buster install, new install of openhab etc. and new install of mosquitto etc. Clean install. Still getting same error after installing Broadlink-mqtt-bridge.

Did note on install the following

Installing dependencies ...
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN [email protected] No repository field.

[17:16:19] pi@openhabTEST:~$ npm -version
5.8.0
Installed Node version: v10.15.2

MQTT-Bridge missing

  • Platform information:
    • Hardware: Raspberry Ip
    • OS: openhabian
    • openHAB version: openHAB2.4
      I trying to get this to work.

https://github.com/fbacker/broadlink-mqtt-bridge

I have don every thing I think I may of missed something can some one help

yes I have MQTT Binding (v1.x)
have use mqtt fx to

broadlink/epson_projector/menu
play

and it worked.

mqtt.cfg

#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://192.168.0.4:1883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<clientId>

# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false

# Optional. User id to authenticate with the broker.
#<broker>.user=<user>

# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>

# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>

# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>

# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>

# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>

Items

//Test
Switch Menu                      "Menu"                                                 {mqtt=">[broker:broadlink/epson_projector/menu:command:ON:play],>[broker:broadlink/epson_projector/menu:command:OFF:play}

site map

Frame label="Garage"
       {
           Switch item=DEMOSW
           Switch item=Menu

Configure

in ./config there's a couple of options in default.json. Do not change this. This is the default settings that can be overwritten. Make your own file ./config/local.json and only add and change values that you want.

NOTE: Changing the default.json will break updates.

{
  "mqtt": {
    "host": "127.0.0.1",
    "port": 1883,
    "protocol": "mqtt",
    "subscribeBasePath": "broadlink"
  },
  "recording": {
    "timeout": {
      "ir": 30,
      "rf": 30
    },
    "path": null
  },
  "gui": {
    "port": 3000
  }
}

User and pasword mqtt broker

Hello fbacker let me say you that this is a great proyect, congratulations for it.

My broker Mosquitto have user and pasword, I have created local.json but my web acces trough "myip:3000" has down it.

/srv/openhab2-conf/broadlink-mqtt-bridge/config/local.json
{
"mqtt": {
"host": "192.168.1.113",
"port": 1883,
"protocol": "mqtt",
"subscribeBasePath": "broadlink"
"user":"openhabian"
"pwd":"7121799422"
},
"recording": {
"timeout": {
"ir": 30,
"rf": 30
},
"path": null
},
"gui": {
"port": 3000
}
}

Thanks for your answer.

Docker image for RPI 4

Hello,

I was trying to install your project, but my docker instance fails with error:

standard_init_linux.go:228: exec user process caused: exec format error

Usually this is due to a docker container being compiled for other platform.
So I suppose that my platform is not supported.
I am using a Raspberry pi 4:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.43-v7l+ #1425 SMP Wed Jun 16 18:01:57 BST 2021 armv7l GNU/Linux

I already tried switching to different tag, :latest, :dev-arm32v7, :dev-arm64v8, :dev-armhf all gave the same error.

Can you confirm whether the container should be compatible with the Rpi 4?
If not, would it be possible to add support for it?
If yes, any idea what would be going on in my setup?

Thank you.

Features request

Is it possible to get the local time in the logs? I get the UTC time but can you adjust according to the location?
One more thing, is it possible to rename the broadlink devices? (Just in the GUI) like broadlink living room, broadlink kitchen and the possibility to sort them by IP address?
Thank you very much !

npm ERR! code ELIFECYCLE

After upgrade to the latest commit . i can't start the service.
remove /srv/openhab2-conf/broadlink-mqtt-bridge directory and try to install from scratch
but it not fix the issue.

`npm run production

[email protected] production /srv/openhab2-conf/broadlink-mqtt-bridge
node -r esm index.js

LOGLEVEL: debug
2019-12-20 07:44:24 [debug]: MQTT Options
{
"host": "127.0.0.1",
"port": 1883,
"protocol": "mqtt",
"subscribeBasePath": "broadlink/",
"defaultProtocol": "mqtt",
"keepalive": 60,
"reschedulePings": true,
"protocolId": "MQTT",
"protocolVersion": 4,
"reconnectPeriod": 1000,
"connectTimeout": 30000,
"clean": true,
"resubscribe": true,
"clientId": "mqttjs_aaf684d0",
"hostname": "127.0.0.1"
}
2019-12-20 07:44:25 [info]: Starting Broadlink MQTT NodeJS Application
2019-12-20 07:44:25 [debug]: GUI Web listen on port 3000
2019-12-20 07:44:25 [debug]: MQTT Connected, subscribe: broadlink/#
2019-12-20 07:44:25 [info]: Device found model: Broadlink RM Mini, id: 34ea34cdf7b6, ip: 192.168.1.62
TypeError: Converting circular structure to JSON
at JSON.stringify ()
at Printf.require.format.combine.format.printf [as template] (/srv/openhab2-conf/broadlink-mqtt-bridge/src/logger.js:27:44)
at Printf.transform (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/logform/printf.js:11:26)
at Format.info [as transform] (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/logform/combine.js:20:24)
at DerivedLogger._transform (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/lib/winston/logger.js:305:29)
at DerivedLogger.Transform._read (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:177:10)
at DerivedLogger.Transform._write (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:164:83)
at doWrite (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:405:139)
at writeOrBuffer (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:394:5)
at DerivedLogger.Writable.write (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:303:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] production: node -r esm index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/openhabian/.npm/_logs/2019-12-20T07_44_25_342Z-debug.log
`

Error TypeError: data.deviceModules[0].enterRFSweep

As #25

I am reopening this. Same problem with RF recording. Followed steps as by mountain-pitt (see ref at the top) but didn't solve the problem. Still error:
2019-12-11 16:11:23 [error]: Error TypeError: data.deviceModules[0].enterRFSweep is not a function
Please some assistance to solve this. Running on a PI with broadlink RM2.

How to select a broadlink device

Hi

nice project.

My broadlink devices are well detected.

How in the UI, can i select which broadlink device to record and replay?

How can from MQTT, can i select which broadlink device to record and replay?

Thanks
image

Mqtt reconnect each 30 seconds

Using the latest version on rpi3b+.
OS: openhabian with mosquitto broker.
bridge is running as service.

In logs each 30 seconds i see next:
2019-12-17 17:31:27 [error]: MQTT Closed
2019-12-17 17:31:28 [info]: MQTT Reconnected
2019-12-17 17:31:58 [error]: MQTT Closed
2019-12-17 17:31:59 [info]: MQTT Reconnected
2019-12-17 17:32:29 [error]: MQTT Closed

API action to rescan devices

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!

RM Mini 3 D will not learn

Using v.2.3.0 of broadlink-mqtt-bridge with a brand new RM Mini 3 D (type 0x5f36 ).

Unit is discovered using the app, but will not learn any IR codes. When trying to learn, the LED does not light up.

Had similar issues using python-broadlink, which had to be patched to handle a storageError ( mjg59/python-broadlink#371 )

Docker setup not working :cbrosius/broadlink-mqtt-bridge-Raspbian Buster

Hi I am using RPI3B+ with Latest raspbian Buster .
Using cbrosius/broadlink-mqtt-bridge docker from docker Hub
I added Port and Volume directory pat in Docker compose file.
Port Modified as 3000 is in used by Garafana so trying to chnage in 3002.
Modified Docker compose :

broadlink-mqtt-bridge:

    container_name: broadlink-mqtt-bridge
    image: cbrosius/broadlink-mqtt-bridge

    restart: always
    network_mode: host
    ports:
      - 3002:3000
      - 3003:3001
    volumes:
      - ./volumes/broadlink-mqtt-bridge/config:/config
      - ./volumes/broadlink-mqtt-bridge/commands:/commands

Log :

./docker-entrypoint.sh: line 3: can't open /broadlink-mqtt-bridge/conf.template: no such file,
,
> [email protected] start /broadlink-mqtt-bridge,
> node -r esm index.js,
,
WARNING: No configurations found in configuration directory:/broadlink-mqtt-bridge/config,
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.,
/broadlink-mqtt-bridge/src/config.js:1,
TypeError: Cannot read property 'path' of undefined,
    at new Config (/broadlink-mqtt-bridge/src/config.js:8:44),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/config.js:48:9),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/logger.js:1),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/index.js:1),
npm ERR! code ELIFECYCLE,
npm ERR! errno 1,
npm ERR! [email protected] start: `node -r esm index.js`,
npm ERR! Exit status 1,�,
 ,
npm ERR! Failed at the [email protected] start script.,
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.,
,
npm ERR! A complete log of this run can be found in:,
npm ERR!     /root/.npm/_logs/2020-04-07T19_11_46_958Z-debug.log,
./docker-entrypoint.sh: line 3: can't open /broadlink-mqtt-bridge/conf.template: no such file,
,
> [email protected] start /broadlink-mqtt-bridge,
> node -r esm index.js,
,
WARNING: No configurations found in configuration directory:/broadlink-mqtt-bridge/config,
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.,
/broadlink-mqtt-bridge/src/config.js:1,
TypeError: Cannot read property 'path' of undefined,
    at new Config (/broadlink-mqtt-bridge/src/config.js:8:44),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/config.js:48:9),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/logger.js:1),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/index.js:1),
npm ERR! code ELIFECYCLE,
npm ERR! errno 1,
npm ERR! [email protected] start: `node -r esm index.js`,
npm ERR! Exit status 1,�,
 ,
npm ERR! Failed at the [email protected] start script.,
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.,
,
npm ERR! A complete log of this run can be found in:,
npm ERR!     /root/.npm/_logs/2020-04-07T19_11_55_520Z-debug.log,
./docker-entrypoint.sh: line 3: can't open /broadlink-mqtt-bridge/conf.template: no such file,
,
> [email protected] start /broadlink-mqtt-bridge,
> node -r esm index.js,
,
WARNING: No configurations found in configuration directory:/broadlink-mqtt-bridge/config,
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.,
/broadlink-mqtt-bridge/src/config.js:1,
TypeError: Cannot read property 'path' of undefined,
    at new Config (/broadlink-mqtt-bridge/src/config.js:8:44),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/config.js:48:9),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/src/logger.js:1),
    at Generator.next (<anonymous>),
    at Object.<anonymous> (/broadlink-mqtt-bridge/index.js:1),
npm ERR! code ELIFECYCLE,
npm ERR! errno 1,
npm ERR! [email protected] start: `node -r esm index.js`,
npm ERR! Exit status 1,�,
 ,
npm ERR! Failed at the [email protected] start script.,
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.,
,
npm ERR! A complete log of this run can be found in:,
npm ERR!     /root/.npm/_logs/2020-04-07T19_12_02_909Z-debug.log,

broadlinkbridge.service failure

Hello fbacker.
Broadlinkbridge.service does not work anymore, next is the result of to review its status, could you please give some guidance about how to repair it. I tried of reinstall but it does not work.

sudo systemctl status broadlinkbridge.service broadlinkbridge.service - Broadlink MQTT Bridge
Loaded: loaded (/etc/systemd/system/broadlinkbridge.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-01-30 12:46:03 -05; 9s ago
Process: 2150 ExecStart=/usr/bin/node index.js (code=exited, status=1/FAILURE)
Main PID: 2150 (code=exited, status=1/FAILURE)

Jan 30 12:46:03 openHABianPi systemd[1]: broadlinkbridge.service: Main process exited, code=exited, status=1/FAILURE
Jan 30 12:46:03 openHABianPi systemd[1]: broadlinkbridge.service: Unit entered failed state.
Jan 30 12:46:03 openHABianPi systemd[1]: broadlinkbridge.service: Failed with result 'exit-code'.
`

Error when running index.js

Hello Fbacker,
I tried what you said earlier today and it worked. Now I'm getting a new Error. Read the error in the code down below.

I can't reach the webgui on port 3001 (I changed it). It said that the MQTT connection worked.

I reinstalled my openHAB (v2.4 now) and got this error after running "node index.js" in the broadlink-mqtt-bridge directroy:


env { LC_ALL: 'en_US.UTF-8',
  LS_COLORS: 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:',
  LESSCLOSE: '/usr/bin/lesspipe %s %s',
  LANG: 'en_US.UTF-8',
  SUDO_GID: '1000',
  EDITOR: 'nano',
  USERNAME: 'root',
  SUDO_COMMAND: '/bin/bash',
  NO_AT_BRIDGE: '1',
  USER: 'root',
  PWD: '/srv/openhab2-conf/broadlink-mqtt-bridge',
  HOME: '/root',
  LC_CTYPE: 'en_US.UTF-8',
  SUDO_USER: 'openhabian',
  SUDO_UID: '1000',
  MAIL: '/var/mail/root',
  SHELL: '/bin/bash',
  TERM: 'xterm',
  SHLVL: '1',
  LANGUAGE: 'en_US.UTF-8',
  LOGNAME: 'root',
  PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
  GCC_COLORS: 'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01',
  LESSOPEN: '| /usr/bin/lesspipe %s',
  OLDPWD: '/srv/openhab2-conf',
  _: '/usr/bin/node' }
commandsPath /srv/openhab2-conf/broadlink-mqtt-bridge/commands
2018-12-19 20:48:53 [info]:     Starting Broadlink MQTT NodeJS Application
2018-12-19 20:48:53 [info]:     MQTT Options {
  "host": "127.0.0.1",
  "port": 1883,
  "protocol": "mqtt",
  "subscribeBasePath": "broadlink",
  "username": "censored",
  "password": "censored"
}
2018-12-19 20:48:53 [info]:     GUI Web listen on port 3001
2018-12-19 20:48:53 [info]:     MQTT Connected {
  "cmd": "connack",
  "retain": false,
  "qos": 0,
  "dup": false,
  "length": 2,
  "topic": null,
  "payload": null,
  "sessionPresent": false,
  "returnCode": 0
}
/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:194
      log(`\n\x1b[35m[Info]\x1b[0m We've discovered an unknown Broadlink device. This likely won't cause any issues.\n\nPlease raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: "${deviceType.toString(16)}". The device is connected to your network with the IP address "${host.address}".\n`);
      ^

TypeError: log is not a function
    at Broadlink.addDevice (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:194:7)
    at Broadlink.onMessage (/srv/openhab2-conf/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:171:10)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:659:8)

Only logger run (3001)

Hi bro, thank you for your work, I've been worked with your git for years! thanks first.
I atm have 2.5 openhab (stable) on RPI 4 .
I've installed on clean 2.5 image the git, all works fine..
I've installed Mosqitto on OH.
I've added MQTT Broker, And MQTT Generic with the MQTT as Bridge. (Both online status) Didn't really touched the settings.

And the main problem it's not connect me to the GUI .
Only to the logger, in the Logger (port 3001) it's telling me this:

2021-09-02 21:13:35 [error]: Missing commands
{
"path": "",
"type": "folder",
"text": "commands",
"time": "2021-09-02T20:26:53.084Z",
"children": [],
"id": "d41d8cd98f00b204e9800998ecf8427e"
}
2021-09-02 21:13:36 [info]: Device found model: Broadlink RM Mini, id: 42f7c874d241, ip: 10.0.0.3
2021-09-02 21:14:00 [info]: Broadlink Discovery completed. Found 1 devices.

Apprciat your help thank you so much for everything you do!!!!

GUI doesn't support Multiple Broadlink Devices

Device IDs are not working on the GUI.

I enter them and they are ignored.

However if I do the same thing using MQTT it works. Can you please look into this?

This also applies to POST commands which I assume is what the GUI is using

POST
http://localhost:3000/api/play

BODY

{"topic":"broadlink/room/aircon", "message":"off","device":"xxx"}

V1 - Not working anymore?

Hi my friend, I've been using your V1 Git, almost 1 year.
I by mastake moved to V2, And you explained me how to back to V1.

And I sucssed moving to V1 But it's not working, after reboot it's not coming up (even when I tried to start the service manually) , and when it's up I can't find devices, rescan ,record, or playing anything.

What should I do, the V2 Will force me to record all my codes again (over 180 codes).. am I right?

Thank you for your support on your git, really apprciat it.

By the way I am using OpenHab as well.

Error when using AutoInstaller

Hi, when I install the application using the autoInstaller I keep getting this message from node when installing dependencies

Unhandled rejection Error: Command failed: /usr/bin/git submodule update -q --init -- 
recursiveopenhab2-conf/broadlink-mqtt-bridge/node_modules/.st
fatal: Could not change back to '/root/.npm/_cacache/tmp/git-clone-8feb9b0d': Permission denied

at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-02T23_48_42_196Z-debug.log
Unable to install dependencies!

I could somehow fix the problem by executing the bash script manually and modify the package.json file and changing the line
"broadlinkjs-rm": "git+https://github.com/fbacker/broadlinkjs-rm"
by
"broadlinkjs-rm": **"file:insert_broadlinkjs-rm_path_here"**

and run npm install --production

Is there a way to fix this issue? I'm not sure if I'm the only one having this problem...

Thank you

Failure to discover multiple RM Mini

I have 2 RM Mini running on the same network. I can run and discover each RM mini individually and use it without any problem. However, when I plug both of them on at the same time, only one will be discovered.

update: I have gotten a RM Pro from a friend... I can discover 2 devices, One pro and one mini... but never 2 mini at the same time...

unable to access GUI after update

I have updated to latest version, reinstalled over existing installation.
Running openHAB. The port 3000 is occupied by Grafana.
Kept the same local.json config as before with port 3030 assigned to GUI.
I am able to see the logs in port 3001, identifying the device and existing commands.
Commands are sent and run ok. Still the GUI on port 3030 is not accessible.
It worked ok before the update.

conf.template no such file

[email protected] start /broadlink-mqtt-bridge
node -r esm index.js
WARNING: No configurations found in configuration directory:/broadlink-mqtt-bridge/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
/broadlink-mqtt-bridge/src/config.js:1
TypeError: Cannot read property 'path' of undefined
at new Config (/broadlink-mqtt-bridge/src/config.js:8:44)
at Object. (/broadlink-mqtt-bridge/src/config.js:48:9)
at Generator.next ()
at Object. (/broadlink-mqtt-bridge/src/logger.js:1)
at Generator.next ()
at Object. (/broadlink-mqtt-bridge/index.js:1)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node -r esm index.js
npm ERR! Exit status 1
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-04-17T18_51_33_370Z-debug.log
./docker-entrypoint.sh: line 3: can't open /broadlink-mqtt-bridge/conf.template: no such file

Changing default ports

I have a system also running Grafana tool which also has a web interface on port 3000.
How can I change the bridge web configuration to use a different port?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.