fbacker / broadlink-mqtt-bridge

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

to many parameters in openhab #6

Closed ntk9 closed 5 years ago

ntk9 commented 5 years ago

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.

fbacker commented 5 years ago

Don't know how I could have missed this.

Please try latest version. use a - seperator instead. e.g. ....nk/tv/peerless:command:OFF:play-0d43b4e42518

ntk9 commented 5 years ago

Without the latest version it work also like this with \\ someone told me to try on the openhab forum

Switch vacuum "turnonoff" {mqtt=">[mosquitto:broadlink/manicure/vacuum/turnonoff:command:ON:play\\:34ea34d09e37]"}

but i will also try the latest version with - instead and report if its working correctly

also how can i uninstall this bridge, i want to do fresh clean install, i get an error because i did few changes, it still working but want to make new installation

BTW great bridge! thanks for this amazing work!

ntk9 commented 5 years ago

i tried with - after update last ver but its not working but it still work like this play\\:34ea34d09e37 so i think there is no need to change this, just the readme file need update

fbacker commented 5 years ago

Did you run the bash script or git pull? On my server I’ve tried with play-idforbroadlink with success.

If update manually with git pull you need to restart the service. On Sun, 4 Nov 2018 at 18:58, ntk9 notifications@github.com wrote:

i tried with - after update last ver but not working but it still work like this play\:34ea34d09e37 so i think there is no need to change this, just the readme file need update

— You are receiving this because you commented.

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

ntk9 commented 5 years ago

I run git pull

OK i will reboot and check, but as i said, it also work with just add \\

fbacker commented 5 years ago

Feelt like the mqtt strings got a bit more complexed to view with the \ 😃 Better to not use openHAB mqtt characters for confusion. On Sun, 4 Nov 2018 at 20:27, ntk9 notifications@github.com wrote:

I run git pull

OK i will reboot and check, but as i said, it also work with just add \

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/fbacker/broadlink-mqtt-bridge/issues/6#issuecomment-435698074, or mute the thread https://github.com/notifications/unsubscribe-auth/AERVmV8-NrPorqGnvcmUHUxTs-AwroxDks5urz-fgaJpZM4YNFA_ .

ntk9 commented 5 years ago

even after reboot its not working with - only with \\ i tried to run git pull again, "say "up do date"

fbacker commented 5 years ago

Weird. If you are looking at the 'admin gui' (port 3000). How does the log looks like? Example when I send from the GUI. This changes my fan lights.

prepareAction
{
  "action": "play-770f7817ea86",
  "topic": "broadlink/fans/livingroom/lights",
  "origin": "web"
}

checking index.js line 345 and 413 should have been changed to - instead of :

running git showin the folder should show the commit hash first line in yellow. Should be: ca3adfbd05f1b92af5340e8b31c78ad8b063d6f6

fbacker commented 5 years ago

And example when the outdoor lights just turned on from openhab

MQTT Message
{
  "topic": "broadlink/switches/outdoor/garden1/on",
  "msg": "play-770f7817ea86"
}
ntk9 commented 5 years ago

i had some problems with the \\ so i tried again with - and now its working, so you can mark this as solved

wanted to know, if i have this

if (FanSpeed.state == "NULL") return; // If NULL do nothing
val topic = "broadlink/fans/livingroom/speed-" + FanSpeed.state
publish("mqtt", topic, "play")

and the selection number for exampale is 120 and i want it will send command only with

broadlink/fans/livingroom/speed-20 and not broadlink/fans/livingroom/speed-120 can i do it?

also if you can add macro recording it will be great

thanks

ntk9 commented 5 years ago

starting to get this error when i test this

} events.js:183 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::3000 at Server.setupListenHandle [as _listen2] (net.js:1360:14) at listenInCluster (net.js:1401:12) at Server.listen (net.js:1485:7) at Object. (/home/openhabian/broadlink-mqtt-bridge/index.js:171:8) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10) .

and cand send commands, any idea way?

fbacker commented 5 years ago

The code example you show is in openhab rules. Don't quite understand what you want to do. It's just from dynamic values, create a new string to broadcast.

In the error you showing I guess it's from when you are starting the service. You have already something running at port 3000. So if you check that with the browser maybe this service is already running or something else.

The issue of \ and - is solved so closing this thread.

ntk9 commented 5 years ago

i change the port to 3222 and i still have this error