fbacker / broadlink-mqtt-bridge

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

How to select a broadlink device #1

Closed smartnakh closed 5 years ago

smartnakh commented 5 years ago

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

fbacker commented 5 years ago

Good question. I've not built it for multiple devices.

I wonder what would be the best solution for this. Maybe that each device would get an id (hash or key) based on mac address.

So when recording or playing it's possible to add this unique id. So play would be:

play:34ea15
recordIr:34ea15

This ID will be shown in the web log output.

and if no id is provided it will send to all devices. and record will generate error if more than 1 device.

fbacker commented 5 years ago

@smartnakh Can you confirm that the broadlink devices has different mac addresses? Know that sometimes cheap electronic devices can use the same MAC.

Had an Idéa to use a mash of ip and mac. But for people not setting static addresses to their broadlinks will be in for a headache if ip changes.

fbacker commented 5 years ago

@smartnakh please run git pull in the folder to try out latest version. Now there's support for multiple devices.

smartnakh commented 5 years ago

Thanks, the select iD is available.

i have typed the device iD

but node.js crash during the IR recording.

2018-10-14 10:18:10 [debug]: Broadlink IR RAW /etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519 data.device.emitter.off("rawData", callback); ^

TypeError: data.device.emitter.off is not a function at Device.callback (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519:27) at emitOne (events.js:116:13) at Device.emit (events.js:211:7) at Device.onPayloadReceived (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:389:14) at Socket.socket.on (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:274:14) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:659:8)

fbacker commented 5 years ago

@smartnakh, what broadlink device are you running?

On Sun, Oct 14, 2018 at 12:19 PM smartnakh notifications@github.com wrote:

Thanks, the select iD is available.

i have typed the device iD

but node.js crash during the IR recording.

2018-10-14 10:18:10 [debug]: Broadlink IR RAW

/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519 data.device.emitter.off("rawData", callback); ^

TypeError: data.device.emitter.off is not a function at Device.callback (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519:27) at emitOne (events.js:116:13) at Device.emit (events.js:211:7) at Device.onPayloadReceived (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:389:14) at Socket.socket.on (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:274:14) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:659:8)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/fbacker/broadlink-mqtt-bridge/issues/1#issuecomment-429612870, or mute the thread https://github.com/notifications/unsubscribe-auth/AERVmS6pEHnID7My6y3lE4PmRSgU0tOEks5ukw-_gaJpZM4XXkl1 .

smartnakh commented 5 years ago

Broadlink rm pro

Le dim. 14 oct. 2018 à 17:49, Fredrick Bäcker notifications@github.com a écrit :

@smartnakh, what broadlink device are you running?

On Sun, Oct 14, 2018 at 12:19 PM smartnakh notifications@github.com wrote:

Thanks, the select iD is available.

i have typed the device iD

but node.js crash during the IR recording.

2018-10-14 10:18:10 [debug]: Broadlink IR RAW

/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519 data.device.emitter.off("rawData", callback); ^

TypeError: data.device.emitter.off is not a function at Device.callback

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519:27) at emitOne (events.js:116:13) at Device.emit (events.js:211:7) at Device.onPayloadReceived

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:389:14) at Socket.socket.on

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:274:14) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:659:8)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub < https://github.com/fbacker/broadlink-mqtt-bridge/issues/1#issuecomment-429612870 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AERVmS6pEHnID7My6y3lE4PmRSgU0tOEks5ukw-_gaJpZM4XXkl1

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fbacker/broadlink-mqtt-bridge/issues/1#issuecomment-429632452, or mute the thread https://github.com/notifications/unsubscribe-auth/AeL6w7QNapL6q2JBPTuLK4wQGGNs-tJEks5uk07cgaJpZM4XXkl1 .

Le 14 oct. 2018 17:49, "Fredrick Bäcker" notifications@github.com a écrit :

@smartnakh, what broadlink device are you running?

On Sun, Oct 14, 2018 at 12:19 PM smartnakh notifications@github.com wrote:

Thanks, the select iD is available.

i have typed the device iD

but node.js crash during the IR recording.

2018-10-14 10:18:10 [debug]: Broadlink IR RAW

/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519 data.device.emitter.off("rawData", callback); ^

TypeError: data.device.emitter.off is not a function at Device.callback

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:519:27) at emitOne (events.js:116:13) at Device.emit (events.js:211:7) at Device.onPayloadReceived

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:389:14) at Socket.socket.on

(/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/node_modules/broadlinkjs-rm/index.js:274:14) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:659:8)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub < https://github.com/fbacker/broadlink-mqtt-bridge/issues/1#issuecomment-429612870 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AERVmS6pEHnID7My6y3lE4PmRSgU0tOEks5ukw-_gaJpZM4XXkl1

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fbacker/broadlink-mqtt-bridge/issues/1#issuecomment-429632452, or mute the thread https://github.com/notifications/unsubscribe-auth/AeL6w7QNapL6q2JBPTuLK4wQGGNs-tJEks5uk07cgaJpZM4XXkl1 .

fbacker commented 5 years ago

weird, might be a nodejs version thing. I changed the way I remove listeners. Please try again.

smartnakh commented 5 years ago

the record ir failed

image

image

mkdir: cannot create directory /commands/bb: Permission denied 2018-10-14 16:48:19 [error]: Failed to create file { "errno": -2, "code": "ENOENT", "syscall": "open", "path": "/commands/bb/vv.bin" } error occured Stopped at recordSave 2018-10-14 16:48:19 [debug]: deviceExitLearningIR web done undefined (node:4624) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'device' of undefined at Promise (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:455:10) at new Promise () at deviceExitLearningIR (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:453:3) at prepareAction.then.then.then.then.then.catch.err (/etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge/index.js:356:11) at at process._tickCallback (internal/process/next_tick.js:189:7) (node:4624) 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(). (rejection id: 1) (node:4624) [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.

i have done sudo chmod -R 777 /etc/openhab2/scripts/broadlink-mqtt-bridge/broadlink-mqtt-bridge

smartnakh commented 5 years ago

thanks it works, i was supposed to do the chmod on the path set in the config file.

is it possible to parse the bin code ?

smartnakh commented 5 years ago

"to parse the bin code"

till now, i was using this project. https://github.com/eschava/broadlink-mqtt

i have already all my IR and RF recorded but in this format 26008c0092951139103910371314111410151015101411391039103a101411141015101510141015101510151014103a1014111410151039103a1039103a1014103a10391039110005ff92961039103a1039101510141114101510151039103911391015101410151015101411141015101510141139101510141015103911391039103a101411391039103a10000d05000000000000000000000000

could i reuse it ?

fbacker commented 5 years ago

thanks, will add chmod requirements to the docs.

You could probably just move those files into the commands folder and make sure the file extension is .bin

iw62 commented 5 years ago

(using: RPI3 and openhabian) I followed the installation process and have a broadlink RM3 mini connected (set as fix IP). Also when i am using "broadlink manager" app, it recognize the device and i can record codes and send commands, but http://{computer-ip}:3000/ still not working and not recognize the broadlink device. Should i configure it somewhere or it should be auto detected?