Closed merlin051 closed 6 years ago
Great, have you got this working fine?
No, sorry to say I just Googled: "Broadlink IR/RF blaster API" and it seemed descent after quickly reading. It allows HTTP calls, which is what you are after.
Yeah I've already read that article, got to the point when I needed an a droid device as a other bridge and stopped reading.
Yeah, even this github project requires an Android intermediary device: https://github.com/beckyricha/Broadlink-RM-SmartThings-Alexa
Sorry for the joykill!
I might have to write something to do this!
If you can read Chinese (or translate) here is the SDK: https://drive.google.com/file/d/0B65vYtefY0h2aE1LdWF5RG9sX00/view
My Chinese is a little rusty.
I spun up an android vm as I don't own an android and ran the bridge in that. The I used rm commander tools to generate the code. My home automation system then runs a batch file that contains the code. So far it works pretty well
Working via Android intermediary device and python broadlink also
anyway to convert https://github.com/mjg59/python-broadlink to java ?
+1 for a 'native bridge' -- the android tasker plugin doesn't work here anyway.... The broadlink is otherwise pretty nice, and very cheap; handles 433Mhz devices too which is quite cool.
@tyjtyj That is the basis of what I am looking into to be able to control a Broad link. The only thing is, what to control and how. It is an IR/RF/SmartPlug/SmartPowerStrip controller.
Add me to the list of users looking for this!
I've used the RM bridge management Page to learn IR device codes http://rm-bridge.fun2code.de/rm_manage/index.html Running the RM Bridge on an android TV box I can manually send signals to a device via the https short link however I can't get the HA-Bridge to send these. Anyone got it working that way?
There are some python scripts kicking about but I haven't had the time to review them all yet. This should be possible.
It seems overkill to need an android running tasker for this to work.
currently I am using broadlink-mqtt (https://github.com/eschava/broadlink-mqtt), another excellent project based on the python-broadlink. since HA-Bridge also has support for mqtt, everything works nicely.
Farhanito,
Can you give us any more detailed information on this?
I've never used mqtt before. Do I need something running a mqtt broker?
Alexa > Habridge > Mqtt broker > Broadlink ?
hi @merlin051,
yes, I'm running an mqtt broker (mosquitto) on the same machine (RaspberryPi) as HA-Bridge. and then run the broadlink-mqtt script to make RM device subscribed to certain topics.
after that you can tell Alexa to publish commands to that topic via HA-Bridge
@farhanito
I think I'm missing something, and i think I've misunderstood what MQTT(Mosquitto) does.
I've got mosquitto installed and running as a service on my windows box( same machine running HA Bridge)
I was expecting some sort of interface where i can map devices/commands?
I've got python installed, i use it for my Orvibo s20 control scripts, not sure how I can feed the broadlink script you pointed out into my environment?
any guidance much appreciated.
Not sure if the new version of the HA-Bridge helped but I can now send the links for IR signals to the RM Bridge ( https://play.google.com/store/apps/details?id=de.fun2code.android.rmbridge) Alexa now turns on/off my TV
@tuicemen i really want to try and avoid setting up an adroid bridge to act as a middleman in an already complicated setup.
@merlin051 As would I, but setting up another server using MQTT(Mosquitto) is even more complicated I feel. Since I already had an Android TV box for streaming this was the best solution for me (for now).
@merlin051 if you already have mosquitto running, then just run the broadlink-mqtt. make sure you already installed the required python modules (paho-mqtt and broadlink)
here's my broadlink-mqtt config:
Type of device. Valid options are 'lookup', 'rm', 'sp1', 'sp2', 'a1'
device_type = 'rm' # I use rm
lookup parameters
lookup_timeout = 20
local_address = '127.0.0.1'
parameters for direct connection
device_host = '192.168.31.108' # rm ip address device_mac = 'B4:43:0D:xx:xx:xx' # rm mac
MQTT connection parameters
mqtt_broker = 'localhost' # default: 'localhost' mqtt_port = 1883 # default: 1883 mqtt_clientid = 'broadlink' mqtt_username = '' mqtt_password = '' mqtt_topic_prefix = 'rm3/'`
after that, you can try publishing an mqtt message for example
topic = rm3/tv/samsung/ON content = record
this will make your rm goes into learning mode, ready to copy your remote button. when finished, it will automatically save the code in a file (named ON) inside this directory
../broadlink-mqtt/commands/tv/samsung/ON
to execute the command, publish this message
topic = rm3/tv/samsung/ON content = replay
good luck,
@farhanito thank you for your help.
I now have everything up and running. although I couldn't get the MQTT native stuff to work in HA Bridge. so I've just used a custom execution and [mosquitto_pub.exe] like this as a command:
C:\Program Files (x86)\mosquitto\mosquitto_pub.exe -t rm/soundbar/HDMI2 -m auto
any chance you can screenshot one of your devices config pages for me?
@farhanito sounds like you have mastered it!
a screenshot of your settings would be great! i've been racking my brain how to integrate my RM PRO also. i'm using FIBARO HC2 and everyone i have communicated with, said id have to install home assistant as "another" bridge just get this thing communicating with my two google home's...
@farhanito are you talking about this python module "eclipse/paho.mqtt.python" or this one "eclipse/paho.mqtt.java"?
@Matt8119 since I installed it using pip it's got to be paho.mqtt.pyhton I think.
hi all,
I am using just python code below
# file send_rf.py
import time
import sys
import broadlink
def senddatahex( hex_data ):
#print hex_data
#count zero padding
pad_len = 32 - (len(hex_data) - 24) % 32
hex_data = hex_data + "".ljust(pad_len, '0')
#print hex_data
myrm2.send_data(hex_data.decode('hex'))
#print "Success"
time.sleep(0.5)
return
def get_rm2():
myrm2 = broadlink.discover(1)
myrm2 = devices[0]
#or you can hard code it
#myrm2 = broadlink.rm(host=("192.168.1.10",80), mac=bytearray.fromhex("b4 43 00 00 00 00"))
myrm2.auth()
return myrm2
#Begin
command = sys.argv[1].lower()
if sys.argv[2:]:
btnOnOff = sys.argv[2].lower()
myrm2 = get_rm2()
if command == 'raw':
senddatahex(btnOnOff)
exit()
based on https://github.com/mjg59/python-broadlink
Under HA Select Script Program On URL X:\python-2.7.12.amd64\python.exe X:\2broadlink\send_rf.py raw 260058000001289313121212143513121411131114111411133614361311133613361336143514361312131212371311141114111435133614351435141212371336133614101411140005260001264913000c4f0001274814000d05
Above is On code for LG tv.
Hope this helped
@merlin051 @Matt8119
sorry I'm on mobile right now, can't give you proper screenshots.
first, don't forget to add your broker settings in the HA-Bridge config http://i.imgur.com/TBBPAAy.png
after that, you can go to the MQTT Messages tab and add your topics and content (auto or replay). http://i.imgur.com/oSf8SK4.png
pressing "Build publish Message" button will open the Device creation page. Modify the device name as needed, and review the On/Off items rows. and finally, press the "Add Bridge Device" button.
What do the 433mhz playback files look like?
I can't get mine to record the signal for the boiler so looking at an arduino to record and playback on the Broadlink, I just need to get it in right format..
There is already java api for broadlink
just need some java expert for integration
that would be awesome to have "one" bridge. it looks very promising! this is just way over my head... i wouldn't mind testing it when its almost ready.
What do the 433mhz playback files look like?
I can't get mine to record the signal for the boiler so looking at an arduino to record and playback on the Broadlink, I just need to get it in right format..
Guys, I have had this working with ha bridge ages ago and it works flawlessly with Alexa. And it's much simpler. Just install jeedom server. Log in and get broad link plugin. Then make sure advanced mode or something's on. Go in the plugon, register the code and copy the command URL. Then add that in manual add in ha bridge. If you want a more detailed instructions just ask! Hope this helps PS use chrome with its built in translator to translate French jeedom into English Jev
The amazing thing about HA-Bridge is it's simplicity. I had a look at most of the current HA solutions and I still don't have a use case that HA-Bridge cannot cover.
@jevtheboss ive found the french site with the jeedom server info, but the directions show doing it from scratch. can this run on the same PI that the ha bridge is running on?
@Matt8119 Yes unfortunately. You can use it on the same pi the ha bridge is on, but the easiest way is to start from scratch, get the jeedom pi image, flash iT and it will setup MySQL and jedom and everything. You can then install ha bridge. I believe you can install it without flashing the image but it's a lot harder, the jeedom image automatically does a load of pre built scripts on first boot. Just flash it, plug it in to ether net, turn it on , go to its IP address on your computer and watch the magic happen! It takes a while though😠 just be patient Jev
@jevtheboss i was watching a few jeedom videos on youtube concerning plugins. now i guess my question is; is the plugin for the broadlink self contained, meaning it has its own discover button, and settings? also one last question, when after i activate the plugin, in the video i watched they used an RFXCOM as an example. he selected the port to use it on, now the broadlink plugin isnt using a physical port, what do you point it to?
I would also like to see HA-Bridge fully support the BroadlinkRM Pro and eliminate the need for an Android device to run RM bridge.
@Matt8119 yes it is self contained. No need for an Android device! Anyway, I not sure what you mean about the port thing but you just put the plugin in discovery mode and it finds the broad link. Click it and press learn a code. Use rm or rf . Then press the settings cog and then right click and copy the URL that's there. Also, I had to assign a static IP from my router to my broadlink as it kept giving it a different IP and so heeding couldn't find it. I'll do a guide when I get round to it of you want Thanks Jev
@jevtheboss I'll be sure to remember those things! It's seems quite straight forward with a friendly UI compared to command prompts. A tutorial wouldn't hurt! When you get the chance.. thanks!
Matt
What a pain ... I was searching for the plugin on github but wasn't able to find anything. So I installed Jeedom using docker which was quite simple and straight forward as described in the docs.
When switching the UI to any other language nothing happend. So I had to use a translator ... uhm. Indeed the plugin is available in the store
but also this is only french. I had a look at the code - it has a Python based daemon to communicate with the Broadlink and a mixture of PHP/JS for the web-parts.
Since the plugin is delivered under the GNU v2 license it could be re-used for other projects as well. I pushed the current version to github to start playing with it once I have the RM pro.
UPDATE: The plugin is available here - no idea why wasn't able to find it
@tyjtyj Unfortunately, that java library is incomplete. Commands are not yet defined.
Ok Guys and @Matt8119 So this is what I did to use my broadlink with HA bridge. I figured this out (it took me ages) and requires some patience and common sense. THIS METHOD DOES NOT REQUIRE AN ANDROID DEVICE I ran all this on the very first model raspberry pi (very old but works fine)but i assume you could use this on any Anyway,
@jevtheboss perfect, these are extremely detailed!!! i already went ahead and ordered a second PI3 from modmypi.com in the UK just so if i run into any issues on my main PI that the Ha-bridge is running on, incase of any issues i may run into or just format the SD card if need be... not sure if you have yours up and running yet, but could you post a few examples of what your commands look like?
much appreciated!
matt
I used this https://github.com/davorf/BlackBeanControl which is a much lighter approach
I read the readme.File and didn't see anything about the discovery process... Do you have any experience using it?
All of the groundwork is done using https://github.com/mjg59/python-broadlink - can already be installed using pip install broadlink
. Getting your devices ... yeah, that part is missing from the BlackBeanControl.
You can use search-bl.sh
listed here https://wiki.fhem.de/wiki/Broadlink - of course you could use all the scripts there but the BlackBeanControl is more user friendly.
Extracting existing codes also works using this https://github.com/NightRang3r/Broadlink-e-control-db-dump
Having to install four different java files, On top of all the separate command line needed, seems a bit much just to control an ir/rf plug etc... I appreciate the input, but I'll stick with jeedom. Being, it's one program with only a separate plugin and the UI is just way more friendly vs all those command lines id need and jumping back and forth between Java files. I can just see something going wrong and not knowing how to remedy it, without to just start all over again....
Anyone know how to get the bridge to talk to a Broadlink IR/RF blaster?