Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation for Device Id and Model? #64

Open
surfrock66 opened this issue Dec 17, 2022 · 4 comments
Open

Translation for Device Id and Model? #64

surfrock66 opened this issue Dec 17, 2022 · 4 comments

Comments

@surfrock66
Copy link

I have 2 Broadlink devices, an "RM Pro" and an "RM4 Pro". I can get to them in broadlink-python (though they're in a different subnet, so no discovery, but I have the mac and IP). In broadlink python, I can get the "devtype" which is 21011 for the RM4 Pro, and 10026 for the RM Pro. Knowing discovery across subnets is out, I've attempted to make my own devices.json file. I have tried the various model ID's on the README but none work; is this because it's in it's own subnet, or am I having trouble translating the devtype to the model needed in the json? Is it possible to map the "0x" ID to the devtype returned from the cli?

@sameleff
Copy link

I'm having similar struggles with the RM4 Pro...I was able to get it connected to my Wifi network with the Broadlink app, but the docker Broadlink Manager keeps throwing errors when I try to use it to learn codes. I tried a similar endeavor as you (creating my own devices.json file), and Broadlink Manager is able to connect to and successfully ping my device, but I tried each of the device types for RM4 pro devices and I consistently receive an error when I click "Learn IR Code" or "Learn RF Code". Did you ever figure this out?

@rodpestell
Copy link

Hi @sameleff and @surfrock66. Excuse me for the direct contact but you both seem to have got further than myself in getting this working and so would it be possible to help me a little by providing some intro steps of how you got to the point for the webpage to be up and running on this thread: #74

Thanks in advance

@surfrock66
Copy link
Author

I never actually fully got it working; instead though the broadlink integration into homeassistant works great, I've been using that. If you use homeassistant, the guide is here: https://www.home-assistant.io/integrations/broadlink/

@sameleff
Copy link

sameleff commented Dec 19, 2023

@surfrock66 I ended up doing the same thing!

@rodpestell here are the exact steps that eventually worked for me.

  1. Connect the Broadlink device to my WiFi network without using the app.
    The only method that worked here was to install the python broadlink module and leverage those commands directly. The instructions at the link worked for me (the Broadlink WiFi SSID was different, but it's intuitive enough to choose the one that says "Broadlink"!); you only need to perform items 1 & 2. I have python on my home computer already, so this was the easiest option for me. If you don't want to mess with python, you should be able to use the Broadlink app to provision the device, then proceed with steps I outline below.
  2. Install the Broadlink integration in Home Assistant (linked by surfrock66 above). From now on, this is by far the easiest and most functional. Even after manually determining the correct device type and creating a manual devices.json file, I could not get broadlink manager to work correction.
  3. I wrote myself a quick script and created some helpers to automate the process of learning IR codes using the Home Assistant GUI. You obviously don't have to do all this, but it makes the process a lot easier when you have a lot of buttons to learn. I plan to upload all this to my github (but it'll have to be after the holidays) since this is honestly the first time I've done something other's might benefit from, so forgive the crudeness of the version below.

Create the following helpers:

  1. IRCommandName, input_text
  2. IRDeviceList, input_select
    Set the list option to the name of the Broadlink entity you just created. In my case, this is "remote.ht_controller".
    image
  3. IRDeviceName, input_text
  4. IRServiceList, input_select
    Set the list options to include the following "remote.learn_command", "remote.send_command", "remote.delete_command"
    image

Create the following script:

alias: Broadlink Training Ops Script
sequence:
  - service: "{{ states('input_select.irservicelist') }}"
    target:
      entity_id: "{{ states('input_select.irdevicelist') }}"
    data:
      device: "{{ states('input_text.irdevicename') }}"
      command: "{{ states('input_text.ircommandname') }}"
mode: single
icon: mdi:remote

Create the following manual card:

square: false
type: grid
cards:
  - type: entities
    entities:
      - entity: input_select.irservicelist
        name: Select Mode (learn, send, delete)
      - entity: input_select.irdevicelist
        name: Select IR Transmitting Device
      - entity: input_text.irdevicename
        name: Input IR Device Name
      - entity: input_text.ircommandname
        name: Input IR Command Name
    title: IR Remote Training
  - show_name: true
    show_icon: false
    name: Run script
    type: button
    tap_action:
      action: call-service
      service: script.broadlink_training_script
      target: {}
columns: 1

When you want to execute a Broadlink command, use the card to do so. Tell it what you want to do (IRServiceList), what Broadlink device to send the command from (IRDeviceList), what device the command is for (IRDeviceName), and the name of the command (IRCommandName).
image

As mentioned in the Broadlink integration help, you can see the codes you have learned in the file created in the .storage folder of your Home Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants