Broadlink RM-PRO and A1 sensor

I don’t see errors in my code, but it gives error

script:
  garden_moodlight:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.garden_right
          effect: colorloop
          brightness: 254
          transition: 5
# Script projector
  projector_on:
    sequence:
      - service: switch.turn_on
        data:
          entity_id: switch.projector_power
      - delay:
          seconds: 1
        service: switch.turn_on
        data:
          entity_id: switch.projector
  projector_off:
    sequence:
      - service: switch.turn_off
        data:
          entity_id: switch.projector
      - delay:
          milliseconds: 500
      - service: switch.turn_off
        data:
          entity_id: switch.projector

I got these codes for Samsung Soundbar Series

AUTO POWER
JgBQAJSPEQ4RDhMMEQ4SLhAvEg0RDhIvEDAQLxEvEQ0SDREPEA4SkBAPEQ4SDREOES4REBANEi8QLhEvEi4SDhAOES8RLhINEQ4REA8QDy8SAA0FAAAAAAAAAAA=

AUTO POWER
JgBQAJSOEg8SDxIPEREQLxIvERARDxIvES8SLxMuERATDRMOEREQkREvEw4SDxIQEC8SDxIPEi4TLhIwES4SEhEPES8TLhEREA8SEBIOES8SAA0FAAAAAAAAAAA=

POWER
JgBQAJGQEQ4REA8OEQ8QLxIuEg0RDxEuES4RLxEwEA4RDhINEQ4RkBINEQ4REA8OEg0RDxAOEg4QLxEvEC8RDxEuEi4RLhEvEg4QDhEPES4SAA0FAAAAAAAAAAA=

INPUT BD DVD
JgBsAFE9DSQMJQ4MDAoOCw4LDSQNCw0lDiMOCw0LDSYNCw4jDQsPIg4LDgoNCw4LDgwMDAwLDgoOCw0lDAsODA4JDgwNCg0LDyMNCw4lDAwOCg0kDgwOCQ8iDgsNCw4lDQoNDA0LDgAFZlBrDQANBQAAAAAAAAAAAAAAAA==

INPUT CD
+DSMOJA4KDQwNCw0LDiQOCw0lDSMOCw0LDiQNDQ0iDwsMJA8KDwkNDA0LDQsOCw0MDAwOCg0kDwoNCw8KDQsPCQ4LDSQNDQ0kDQoOJA0lDQwMDQ0KDSUNDA0lDAoOCw8JDQAFaFFsDAANBQAAAAAAAAAAAAAAA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wwMDgAFZVFpDgANBQAAAAAAAAAAAAAAAA==

thanks, yes, just power toggle unfortunately.

What is wrong with my script?

those inputs seams to be discrete codes… maybe

Your scripts has some errors I think…
mine is this and they work with Delay

script:
  luzes_sala_pause:
    sequence:
      - service: input_boolean.toggle
        data:        
          entity_id: input_boolean.sofa
      - delay:
          seconds: 10
      - service: input_boolean.toggle
        data:        
          entity_id: input_boolean.sala
  luzes_apagar:
    sequence:
      - service: input_boolean.toggle
        data:
          entity_id:
            - input_boolean.alla
           - input_boolean.allb
            - input_boolean.allc
      - delay:
          seconds: 2
      - service: input_boolean.toggle
        data:
          entity_id:
            - input_boolean.alla
            - input_boolean.allb
            - input_boolean.allc

usually, when you miss a ’ - ’ symbol, you get and error from the previous or the next lines…

Found this on web:
“There aren’t any descrete codes. I found that if you put the sound bar on auto power, it will turn on itself. This can only be done by using an optical cable out of the TV into the sound bar. Once it senses audio, it will turn on automatically. The sound bar will turn off itself after 20 mins of no audio”

yeah, unfortunately it serves a projector and no optical cable. I guess all my next appliances will need to have IP

@Danielhiversen

What would be the steps to create a database with IR codes and access them directly from the HA web interface.

I ask this because I just found out that a Universal Remote Control app for Android added RM-PRO support.
The application allows you to add an RM-PRO and configure any existing remote control in its database, which is very, very complete.

It would be great if we could eliminate the need for lerning.

2 Likes

Is it any chance to add a feature that the Broadlink could read IR input all the time and update switch devices when a IR device is switched from a remote?
My devices are using the same code to turn on and off so a automation rule is not very usefull since the automation rule don’t know if the device is on or off.

volume up and volume down?

Nope, Broadlink SDK only permits it receive codes when in learning mode.
You could use discrete codes for on and off different commands…

Just noticed now that one of my RM-PRO has the same problem, learning just those AAAAA
Now I will try the new version for broadlink.py @Danielhiversen created…
Fixed with the last version.

Volume UP
JgBQAJKREA8QDw8QDxAQMA8wEBAPDxAwEDAQLxAwEA8QDxAPEA8QkRAPDxAPEA8QDzAQMBAwDxAPMBAwEDAPEA8QDxAPEA8wEA8QDw8QEDAQAA0FAAAAAAAAAAA

Volume DOWN
JgBQAJGSEA8PEA8QDxAPMBAwEA8PEBAvEDAQMBAvEBAPDxAPEA8QkRAPEA8QDxAPEA8QDxAPEDAQLxAwEDAQDxAwDzAQMBAPEA8QDxAPEDAQAA0FAAAAAAAAAAA

it is intermittent. Sometime it does, sometimes not … unpredictable

thanks now is needed a button function in HA

The last broadlink.py fixed mine.

https://github.com/home-assistant/home-assistant/blob/Broadlink_fix/homeassistant/components/switch/broadlink.py

I am so confused now to what I have. What is the best solution to install this component?

I installed in HASS environment, but also in python3.4 directory

I have done some testing and it seems like the Broadlink could send and receive IR packages at the same time, I put it in learning mode and then tried to turn on a device from HA and the device turned on and Broadlink received a packet.
So if the Broadlink device is in learning mode all the time it should be capable to receive packages from a remote control, and also update the status.

Another advance I can see in have the Broadlink to receive packages is that you could actually use a IR remote control to turn on and off other devices that is connected to HA.

1 Like

Hi,

I am trying to configure the Broadlink Switch.
I updated to ver 0.35 of HA and tried to configure switch . I was able to make the RM Pro learn a switch initially but the issue was the switch was not coming on my Frontend.
I later changed the broadlink.py in both :/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor and :/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch to the latest version .
Once the new versions of broadlink.py , I am getting the error " homeassistant.components.switch.broadlink: Failed to connect to device."

Kindly help:

  1. To get the Switches on the frontend
  2. To use the latest broadlink.py ( since i have a RMPro and IR Blaster)

My Configuration.yaml is as follows:

homeassistant:

Name of the location where Home Assistant is running

name: Home

Location required to calculate the time the sun rises and sets

latitude: XXXXX
longitude: XXXXX

Impacts weather/sunrise data (altitude above sea level in meters)

elevation: 922

metric for Metric, imperial for Imperial

unit_system: metric

Pick yours from here: List of tz database time zones - Wikipedia

time_zone: Asia/Kolkata

group:
living_room_view:
name: Living Room
view: yes
entities:
- group.living_room
kitchen_wa_view:
name: Kitchen and Workarea
view: yes
entities:
- group.kitchen_wa
balcony_passage_view:
name: Balcony and Passage
view: yes
entities:
- group.balcony_passage
bedroom_view:
name: Bedroom
view: yes
entities:
- group.bedroom
office_view:
name: Office
view: yes
entities:
- group.office
guestroom_view:
name: Guest Room
view: yes
entities:
- group.guestroom
equipment_view:
name: Equipments
view: yes
entities:
- group.equipment
sockets_view:
name: Sockets
view: yes
entities:
- group.sockets
living_room:
name: Living Room
entities:
- switch.hall_light
- switch.yellow_light
- switch.white_light
- switch.mainwall_light
- switch.buddhawallcenter_light
- switch.buddhawallside_light
- switch.krishna_light
- switch.ledstrip_light
kitchen_wa:
name: Kitchen and Workarea
entities:
- switch.kitchen_light
- switch.workarea_light
balcony_passage:
name: Balcony and Passage
entities:
- switch.outside_light
- switch.passage_light
bedroom:
name: Bedroom
entities:
- switch.main_room_light_1
- switch.main_room_light_2
- switch.main_room_fan
office:
name: Office
entities:
- switch.office_room_fan
- switch.office_room_light_a
- switch.office_room_light_b
guestroom:
name: Guest Room
entities:
- switch.office_guest_light_a
- switch.office_guest_light_b
- switch.office_guest_fan
equipment:
name: Equipments
entities:
- switch.tv
- media_player.anoops_chromecast
- switch.alloff
sockets:
name: Sockets
entities:
- switch.socket1
automation:

  • alias: “Sunset Lights ON Hall”
    trigger:
    platform: sun
    event: sunset
    offset: “-00:15:00”
    action:
    service: switch.turn_on
    entity_id:
    - switch.hall_light
    - switch.yellow_light
    - switch.mainwall_light
    - switch.buddhawallside_light
  • alias: “Sunset Lights ON Kitchen”
    trigger:
    platform: sun
    event: sunset
    offset: “-00:16:00”
    action:
    service: switch.turn_on
    entity_id:
    - switch.kitchen_light
    - switch.workarea_light
  • alias: “Sunset Lights ON Bedroom”
    trigger:
    platform: sun
    event: sunset
    offset: “-00:10:00”
    action:
    service: switch.turn_on
    entity_id:
    - switch.main_room_light_1
    - switch.main_room_light_2
  • alias: “Sunset Lights ON Guest Room”
    trigger:
    platform: sun
    event: sunset
    offset: “-00:10:00”
    action:
    service: switch.turn_on
    entity_id:
    - switch.office_guest_light_a
    - switch.office_guest_light_b
  • alias: “Sunset Lights ON Office Room”
    trigger:
    platform: sun
    event: sunset
    offset: “-00:17:00”
    action:
    service: switch.turn_on
    entity_id:
    - switch.office_room_light_a
    - switch.office_room_light_b
    zone:
    name: Home
    latitude: XXXX
    longitude: XXXX
    radius: 200
    icon: mdi:home
    zone 2:
    name: Work
    latitude: XXXX
    longitude: XXX
    radius: 500
    icon: mdi:Work

Show links to resources in log and frontend

introduction:

Enables the frontend

frontend:

http:

Uncomment this to add a password (recommended!)

api_password: "XXXXX"
ssl_certificate: '/etc/sslforfree/certificate.crt'
ssl_key: '/etc/sslforfree/private.key'

Checks for available updates

updater:

Discover some devices automatically

discovery:

Allows you to issue voice commands from the frontend in enabled browsers

conversation:

Enables support for tracking state changes over time.

history:

View all events in a logbook

logbook:

Track the sun

sun:

Weather Prediction

logger:
default: critical
logs:
homeassistant.components.switch.broadlink: debug
sensor:

- platform: yr

- platform: command_line

command: “/usr/bin/curl -X GET ‘http://192.168.1.43:9876/temperature?deviceMac=b4430deefd5f’”

unit_of_measurement: “°C”

value_template: ‘{{ value_json.temperature}}’

freiendly_name: Broadlink RMPro

Hey guys,

Newbie here! :slight_smile:

So, I managed to install pycrypto manually under virtual env and I got the RM2 temp sensor showing on my HA frontend. But now trying to create switches I can’t get broadlink to show under domains to be able to use the learn_command. I’m sure I’m missing something.

Also… @oliverdog (boas :slight_smile:), can you get me the discrete codes for a 2016 Samsung Smart TV (KS7000)? Just paste it on a pastebin or something. Thanks mate!

Edit: nevermind… suddenly the learn_command is showing. Should have posted earlier. :joy: