How can i add Broadlink temperature to ha?

Hello

I have a RmPro, how can I add the temperature to display on HA?
Thank!

MP

sensor:
  - platform: broadlink
    host: IP_ADDRESS
    mac: 'MAC_ADDRESS'
    monitored_conditions:
      - 'temperature'

yes yes, I did it, but this still does not show on ha, I don’t know what I miss :frowning:

You have to provide more info.
Have you tried hass --script check_config ?
Enable debug logging and check the log.
And read this https://home-assistant.io/docs/configuration/troubleshooting/

work now! change the code from switch.yaml to configuration.yaml

you are the men as always! Thanks!

Hmm… I thought my problems with the temp failing were over since the last HA update but it appears not, I get the error below and restarting HA is needed to get it working again for a while. Time it happens doesn’t coincide with anything else HA or the RM Pro is doing and I have the update interval set to 600 as someone else said the default caused theirs to fail. Any ideas appreciated?

2017-10-04 05:06:39 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.broadlink_sensor_temperature fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/broadlink.py", line 96, in update
    self._broadlink_data.update()
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 306, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/broadlink.py", line 134, in _update
    if retry > 0 and self._auth():
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/broadlink.py", line 139, in _auth
    auth = self._device.auth()
  File "/usr/lib/python3.6/site-packages/broadlink/__init__.py", line 205, in auth
    payload = self.decrypt(response[0x38:])
  File "/usr/lib/python3.6/site-packages/broadlink/__init__.py", line 174, in decrypt_pycrypto
    return aes.decrypt(bytes(payload))
  File "/usr/lib/python3.6/site-packages/Crypto/Cipher/_mode_cbc.py", line 209, in decrypt
    raise ValueError("Error %d while decrypting in CBC mode" % result)
ValueError: Error 3 while decrypting in CBC mode

It seems that you get some invalid data from your sensor.

Any idea what, or more importantly, what I can do about it? Or perhaps some way to tell it not to worry and have another go rather than just stop for good?

After I add the temp, all my broadlink device does not show any more.

do you have any idea what can i check?

Thanks!

i have a file switch.yaml
also on configuration.yaml i have what need to be add

i dont know what is worng the log is ok

Have you tried hass --script check_config ?

Why do you have broadlink _IR ? It should be only broadlink

Here is my setup:
https://github.com/Danielhiversen/home-assistant_config/blob/9f89c532b648cedf99b2e4d6b57f63ac04cba56f/sensors.yaml#L180 (The sensor is currently disabled)
https://github.com/Danielhiversen/home-assistant_config/blob/9f89c532b648cedf99b2e4d6b57f63ac04cba56f/switches.yaml#L83

1 Like

copy your code :slight_smile: so I need to add the broadlink to the main script and also to the switch.yaml
good to know, this info is missing on the webpage.

  • platform: broadlink
    host: 192.168.31.82
    mac:

No, you have them wherever you have the relevant components. This can either be directly in the config yaml OR if you have split up your config like Daniel has, and most do after a short while, you have a link in the config to load the relevant file and then the setting in the secondary file.

In this case the temp bit goes under sensors and the switches controlled by your RM Pro goes under switches.

may you know why alexa get the device as offline and some time online?