Giter VIP home page Giter VIP logo

techno-tim / techno-broadlink Goto Github PK

View Code? Open in Web Editor NEW
83.0 83.0 20.0 2.78 MB

A Docker container for BroadLink devices with a REST API and React UI

Home Page: https://www.youtube.com/watch?v=4MJW29mR-Xc

License: MIT License

Python 46.84% HTML 2.46% JavaScript 50.30% Dockerfile 0.40%
api broadlink broadlink-devices cli docker docker-container flask python react reactjs techno-broadlink technotim

techno-broadlink's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar josegonzalez avatar sognen avatar timothystewart6 avatar zroger49 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  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

techno-broadlink's Issues

API documentation

Really great project! Was so easy to set up!

But now I want to use the API but I'm not sure how to do it. Based on the postman file I'm trying to understand what a curl request might look like, but I'm completely new to using APIs at that level and I'v never user postman either, so I'm kinda stuck. Could you explain the basic structure of how the API is addressed and perhaps provide an example?

Do I understand correctly that the API cannot be used by simply calling a URL in the browser?

In case it matters, what I'm actually trying to do is adress your app via OpenHAB.

device discovery not possible

Hello,

first of all, thank you very much for your work.

However, unfortunately I am not able to add my Broadlink RM4 mini.
Is it possible that there is a problem if the Rancher VM and the WLAN with the Broadlink RM4 mini are in different networks? The WLAN has a different address range than the server LAN. I have already reset the Broadlink several times. Unfortunately, it is still not displayed / recognised in the UI. There are no restrictions within the networks. All connections among each other are allowed.

Iam using the Rancher / Kubernetes Version
With HOST_IP Value of Rancher

I hope you can support ;)

Kind regards
Schmandre

Manually Change Device IP Without Requiring Broadcast

megashub
Question -- is there any way to manually re-add a device to Tim's Broadlink Control dockerized API service? I have it running on my NAS and all was working fine, but then I replaced my home network with better gear, and added a properly isolated IoT network with WAN only access, with my LAN devices able to see devices on the IoT network. Works great. My NAS is on my main LAN network, and the Broadlink RM4 mini is on the IoT network. I manually joined the RM4 mini to the IoT network, but now, the Broadlink Control service on the NAS can't discover the RM4... so /command json commands fail out with 'null' results.

TechnoTim
This is a tough one since you want these broadcasted packets to traverse vlans / networks. I think it might be possible with mDNS. I would look into that for your firewall.

megashub
yeah that's what I was afraid of... mDNS is a little brute force on Ubiquiti's Dream Machine Pro, I'm afraid. Could the container service be made to work strictly via static IP vs. requiring broadcast packet discovery? or are the commands sent to the RM4 via broadcast?

TechnoTim
possibly but I think you need to discover the device at least once to do some sort of handshake, I can't remember the details.

megashub
hmm that makes sense.. it creates a json file per discovered MAC... so I was hoping I could just edit the IP in the existing file and it would pick it up.. but that hasn't worked.

{"ip": "<RM4 IoT Network IP>", "mac": "<RM4 MAC>", "model": "RM4 mini", "manufacturer": "Broadlink", "commands": [{"id": "00e854ff-145a-4ac8-b25b-5ce84051368b", "name": "Vizio TV Power", "data": "260050000001268f1411151014351410151014101510150f153514351410153513361435143515341510141015101534141114101510141015341535143513121435133614351435150005120001274714000d05000000000000"}], "name": "", "temperature": 0.0, "humidity": 0.0}

TechnoTim
I think I understand why, but I would have to rework some stuff to make it work. If you open an issue on github I can try to take look sometime! That would be super helpful, that way someone else could possibly provide a fix too

Unable to find devices.

Hi, Im using the docker version on unraid. I watched the video and read what I could find. My logs are blank no files are in my appdata folder but I can reach the webui however no devices are found. I have a RM 4 mini. Any advice?

I'm sure i'll get this eventually. Learning python now to use the console for commands.

docker run issue

Hi,

I run this command:

docker run -e HOST_IP=192.168.0.37 -p 10981:10981 -v /opt/broadlink/config:/app/config --network host timothystewart6/techno-broadlink:latest

I have the warning:
docker : WARNING: Published ports are discarded when using host network mode
Au caractère Ligne:1 : 1
+ docker run -e HOST_IP=192.168.0.37 -p 10981:10981 -v /broadlink/confi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (WARNING: Publis...st network mode:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

It's installed correctly in docker desktop but I can't access the webpage.

image

But I still have this issue:

image

What is wrong?

Thanks,

Fails when discovering devices

Hi,
I'm getting an error message when discovering devices. See under log. "Discovered 0 devices" is displayed on the screen.
All my devices are found when using Broadlink Manager https://github.com/t0mer/broadlinkmanager-docker.

Devices:
RM2
RM3/mini
A1

I using the docker image.

Best Regards,
Cato

RM2

broadlink_cli --type 0x2712 --host 192.168.1.205 --mac XXXXXXXXXX

Device file data (to be used with --device @filename in broadlink_cli) :
sensors = {'temperature': 26.6}
broadcast ip is: 192.168.1.255
args: Namespace(dst_ip='192.168.1.255', ip='192.168.1.104', timeout=2)
Discovering...
devices [<rm: Broadlink RM pro/pro+ (0x2712) at 192.168.1.205:80 | b4:43:0d:38:fb:9c | 智能遥控 | Unlocked>, <a1: Broadlink e-Sensor (0x2714) at 192.168.1.239:80 | b4:43:0d:70:21:8e | 空气质量仪 | Unlocked>]
found [<rm: Broadlink RM pro/pro+ (0x2712) at 192.168.1.205:80 | b4:43:0d:38:fb:9c | 智能遥控 | Unlocked>, <a1: Broadlink e-Sensor (0x2714) at 192.168.1.239:80 | b4:43:0d:70:21:8e | 空气质量仪 | Unlocked>]
###########################################
RM2

broadlink_cli --type 0x2712 --host 192.168.1.205 --mac XXXXXXXXXX

Device file data (to be used with --device @filename in broadlink_cli) :
sensors = {'temperature': 26.6}
broadcast ip is: 192.168.1.255
args: Namespace(dst_ip='192.168.1.255', ip='192.168.1.104', timeout=2)
Discovering...
ERROR:api:Exception on /discover [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "./api.py", line 60, in discover
return jsonify(discover_devices(host_ip))
File "/app/broadlink_service.py", line 85, in discover_devices
humidity = sensors['humidity']
KeyError: 'humidity'

/16 networks

Currently, the discovery only works on /24 networks, so it doesn't pick up my broadlink.

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.