Broadlink RM-PRO and A1 sensor

you mean the temperature sensor of the Broadlink RMPRO?

Bare in mind that (to me) is almost unusable, because few times it shows correct temperature and most of the time not

under sensor:

  - platform: broadlink
    update_interval: 60
    host: 192.168.1.89
    mac: 'bxxx:0f'
    name: Living Room
    monitored_conditions:
      - temperature

as per the Climate sectionj here is the code:

under group:

  living_room:
    name: Living room
    view: yes
    entities:
       - group.living_room_lights
       - light.foyer
       - switch.christmas_tree_lights
       - switch.cast_power
       - switch.optoma
       - switch.soundbar
       - switch.hdmi_cast
       - switch.hdmi_tv
       - switch.karaoke
       - climate.claudio_thermo
       - media_player.cast_living
       - media_player.living_room_home
       - media_player.home_group
       - sensor.living_room_temperature
1 Like

Thanks for some helpful insight.

How it can be done? digging third day in a row :confused:

Open a new thread, and post what you have so far.
Maybe someone can help you.

the SP3?

Is it giving the state back to HASS?

I only have a SP mini…working normally (yes sending state back)

guys, anyone encounter same issue like mine? setup on a good night scene on iOS (using Homebridge) to have the have the HA to shut the Orbivo smart plug and also RM Pro to shut off fan and TC2 using RF…but after which…the HA can’t work with RM Pro until restarted the HA service…not sure if this something to do with broadlink.py? may be that it can’t handle surge of actions commands in scene?

Or anyone have any idea to setup delay/wait time for each of the action?

For those who have Broadlink Tasker RM Plugin installed, I have created a small code import script. It takes the codes from RM Plugin HTTP bridge and outputs them in proper format for Python Broadlink module.
Save the following code as ‘convert.py’ and call it like this:

python convert.py http://192.168.0.111:9876

Where the URL is the address of your HTTP Bridge.

#!/usr/bin/env python
import requests
import binascii
import base64
import sys

if len(sys.argv) < 2:
  print("Usage: {0} <url>".format(sys.argv[0]))
  sys.exit(1)

codes = requests.get(sys.argv[1]+'/codes')
for code in codes.json():
  print("{}: {}".format(code.get('displayName'), base64.b64encode(binascii.a2b_hex(code.get('code')))))
3 Likes

did someone solve AES error?
occurring with 5065 version also.

Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
result = coro.throw(exc)
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py”, line 1049, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch/init.py”, line 87, in async_handle_switch_service
yield from switch.async_turn_on()
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 353, in async_turn_on
None, ft.partial(self.turn_on, **kwargs))
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/hass/.homeassistant/custom_components/switch/broadlink.py”, line 167, in turn_on
if self._sendpacket(self._command_on):
File “/home/hass/.homeassistant/custom_components/switch/broadlink.py”, line 188, in _sendpacket
if not self._auth():
File “/home/hass/.homeassistant/custom_components/switch/broadlink.py”, line 195, in _auth
auth = self._device.auth()
File “/home/hass/.homeassistant/deps/broadlink/init.py”, line 169, in auth
response = self.send_packet(0x65, payload)
File “/home/hass/.homeassistant/deps/broadlink/init.py”, line 214, in send_packet
aes = AES.new(bytes(self.key), AES.MODE_CBC, bytes(self.iv))
File “/home/hass/.homeassistant/deps/Crypto/Cipher/AES.py”, line 95, in new
return AESCipher(key, *args, **kwargs)
File “/home/hass/.homeassistant/deps/Crypto/Cipher/AES.py”, line 59, in init
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)
File “/home/hass/.homeassistant/deps/Crypto/Cipher/blockalgo.py”, line 141, in init
self._cipher = factory.new(key, *args, **kwargs)
ValueError: AES key must be either 16, 24, or 32 bytes long

check the codes you’re firing. try to relearn using learnig service of broadlink…

I am even unable to learn commands from learn service.
says this:
17-01-13 02:07:56 custom_components.switch.broadlink: Failed to connect to device.

while sending codes, it sends once on restart ,then gives AES key error.

are you sure you configured correct the ip and mac address of your rm?
wanna share your code?

I do not understand which version you are using, but there have been a lot of bug fixes in the Broadlink component since the last release. So I suggest that you wait for the next release or use the dev version: https://home-assistant.io/developers/development_environment

i solved it by changing /.homeassistant/deps/broadlink folder with new version from mjg569 GitHub(python-broadlink).
However now i am unable to use learn command, it always says failed to connect to device.

I am still not sure that you use the latest version. So I suggest that you wait for the next release or set up the dev version.

after upgrade able to have learn command but the code recieved and display on the front end is not show full and can’t selection for copy. anyother way to view the code?

17-01-16 11:27:54 homeassistant.components.switch: Error while setting up platform broadlink
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 115, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 141, in init
self._command_on = b64decode(command_on) if command_on else None
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/base64.py”, line 90, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

In the log

got the same problem here, but only happen when adding new code learn after upgrade to 0.36

17-01-16 18:42:45 homeassistant.components.switch: Error while setting up platform broadlink
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 115, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 141, in init
self._command_on = b64decode(command_on) if command_on else None
File “/usr/lib/python3.4/base64.py”, line 90, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

hi , can u teach me how to setup home assistant with broadlink rm pro , thx