mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.38k stars 479 forks source link

New release with support for RM4C mini (product ID 0x520D)? #705

Closed mt0321 closed 1 year ago

mt0321 commented 2 years ago

Hello,

Could we get a new release supporting the Broadlink Bestcon RM4C mini with product ID 0x520D?

Support was merged in to the new_product_ids branch in June thanks to titusthefox04, but it's not in the main branch and also not available via Home Assistant, presumably because the last release was 0.18.2 in May.

Let me know if I can help. Thank you!

seb5594 commented 2 years ago

Would be very nice if this device could get be added into the main branch :)

guieiras-dev commented 2 years ago

Can't wait for this release to. I bought 3 RM4C mini with product ID 0x520D and would love to have native support.


Tip: If someone wants to support new Product IDs right now, patching manually the Home Assistant instance can be a solution.

1) Open Home Assistant and install "SSH & Web Terminal" add-on 2) Disable Protection mode 3) Connect to the Home Assistant instance using SSH:

ssh USER@IPADDRESS
docker exec -it homeassistant /bin/bash
cd /./usr/local/lib/python3.10/site-packages/broadlink
wget -O __init__.py https://raw.githubusercontent.com/mjg59/python-broadlink/new_product_ids/broadlink/__init__.py

4) Restart the server.

OGB1952 commented 2 years ago

I'm another one that has just bought a few of these newer RM4C Minis and have run into the same issue, so if there is an easy way to patch HA to recognise these product ID 0x520D RM4C Minis I would be grateful for any tips (I am definitely a novice!).

guieiras-dev commented 2 years ago

@OGB1952 You can try the steps on my comment above. After step 4 (restart the server), your HA should be able to recognize the RM4C using the native Broadlink integration.

OGB1952 commented 2 years ago

Many thanks, but try as I might I cannot find the location of the broadlink directory, or even the location of the Python directory. I'm running HA on a Raspberry Pi using the standard HAOS installation, so not using Docker. I've hunted high and low through the file system to try and locate where the file containing the definitions may be lurking to no avail. This is all that is in the /usr/local/lib directory:

[core-ssh /]$ cd /./usr/local/lib
[core-ssh lib]$ ls
libjemalloc.a      libjemalloc.so     libjemalloc.so.2   libjemalloc_pic.a  pkgconfig

It's a bit frustrating, as if I've understood things correctly it looks like all that needs to be done is to add a line in a file to define the 0x520D product ID.

iron-2 commented 2 years ago

Just got mine RM4C mini and have the same issue. Hopefully this is fixed soon.

seb5594 commented 2 years ago

Can't wait for this release to. I bought 3 RM4C mini with product ID 0x520D and would love to have native support.


Tip: If someone wants to support new Product IDs right now, patching manually the Home Assistant instance can be a solution.

1) Open Home Assistant and install "SSH & Web Terminal" add-on 2) Disable Protection mode 3) Connect to the Home Assistant instance using SSH:

ssh USER@IPADDRESS
docker exec -it homeassistant /bin/bash
cd /./usr/local/lib/python3.10/site-packages/broadlink
wget -O __init__.py https://raw.githubusercontent.com/mjg59/python-broadlink/new_product_ids/broadlink/__init__.py

4) Restart the server.

This does not work anymore since latest HassOS update. The python packages seems to have a new location. Do you know the new location?

OGB1952 commented 2 years ago

I've spent a fair bit of time trying to find where the packages have moved to with no luck, I'm afraid. It's irritating knowing that a simple file edit will probably fix this, but not being able to find where that file now is.

iron-2 commented 2 years ago

Where can I leave a post so that the devs get a message on this issue??

guieiras-dev commented 2 years ago

I feel sorry that you couldn't find the files with the guide on my comments above, but I’ll try to be more specific and I hope you should be able to manually patch your instance.

1) Use the Add-on from Home Assistant Community Add-ons, not from Official Add-ons. Remember to follow the installation guide correctly. image

2) It’s very important that you disable Protection Mode before starting add-on.

3) Connect to your instance using SSH or using Web Interface on add-on. When the instance is connected, you should see lines like these. F2A4C9B8-3893-423A-A0C1-CD675672C96F

4) Enter the lines below. These “docker” command should work no matter what is your installation (even HASS OS).

docker exec -it homeassistant /bin/bash
cd /./usr/local/lib/python3.10/site-packages/broadlink
wget -O __init__.py https://raw.githubusercontent.com/mjg59/python-broadlink/new_product_ids/broadlink/__init__.py
KennyHec commented 2 years ago

For those having problems with python dir not being found, use this instead in the terminal. This has always worked for me.

docker exec -it homeassistant /bin/bash
pip3 install git+https://github.com/mjg59/python-broadlink.git@new_product_ids --force-reinstall --no-deps
FlameSoulis commented 2 years ago

I'm reporting that the above instructions are incorrect. I have a core installation on a virtual machine, and I'm noticing that python is entirely missing. Perhaps this is the cause of all the problems?

In addition, the docker command doesn't work either because the command doesn't exist.

image

EDIT: Okay, thanks to this post, the issue is the terminal type. Switching this resolved the issue and made the above work.

domoaligato commented 1 year ago

the workaround works for me on unraid in docker.

simonbrunton commented 1 year ago

RM4C mini is still not supported in 2022.10.5

ALEXOTANO commented 1 year ago

I can't believe this haven't been solved, it is already merged to a branch and super-tested by the community, you should merge it already to main branch.

RandyLevensalor commented 1 year ago

@felipediel @mjg59 Is there anything we can do to help get a new release published? This patch has been merged and it would be great to have it included it included without needing to mod home assistant.

lobbie1978 commented 1 year ago

Same here. Command line does not work: "command not found". I have been waiting for support for this device for months now. Please merge the branch to main asap!

KennyHec commented 1 year ago

Same here. Command line does not work: "command not found". I have been waiting for support for this device for months now. Please merge the branch to main asap!

What command are u (trying to) using?

bisquit2003 commented 1 year ago

Same here. Command line does not work: "command not found". I have been waiting for support for this device for months now. Please merge the branch to main asap!

check addon, you need WEB terminal, not terminal

Druidblack commented 1 year ago

When will the normal support for these remotes be added?

ilvi80 commented 1 year ago

I made an adjustment to add RM4C mini 0x520D to the master branch, it needs to be merged. Let's bring this topic to an end and close it. Thank you for your understanding and work.