Broadlink S1C Alarm Kit Custom Sensor Component

I had issues with “unknown” state from motion sensors. I just replace the batteris and tada…

Could you please tell me how to integrate the “Security Status” on my Raspberry PI 4b?
I can see all of my sensors, including the 3 A1.

I have this on configuration.yaml:

sensor:
  - platform: broadlink_s1c
    ip_address: "192.168.0.9"
    mac: "B4:XX:XX:XX:XX:XX"

And inside /config/custom_components/broadlink_s1c I have
init.py
sensor.py

My init.py it’s empty.

I would like to add t your “Security Status” on my dashboard…

Thank you!

@rn1 now, HA also need version, not only init.py files, version is in manifest.json. Here files https://github.com/nick2525/broadlink_s1c_s2c/tree/master/custom_components/broadlink_s1c_s2c

here my configuration

sensor 7:

  • platform: broadlink_s1c
    ip_address: “192.168.1.124”
    mac: “45:34:45:46:76:45”
    timeout: 200

@AndroVet I added delay, to reduce the load on the processor in case of errors.

@nnemedi please, reboot HA after battery replace, if sensor will not work after 20 minutes, please reboot HA again, in case of error check sensor in official Broadlink APP

Yes, thank you. After battery replacing we need to reboot HA. I just shared my experience with unknown status, that my motion sensor was in unknow status no matter what I did with it until I replaced the batteries in it.

Does anybody have any idea how I can get rid of this error:

Logger: custom_components.broadlink_s1c.sensor
Source: custom_components/broadlink_s1c/sensor.py:273
Integration: broadlink_s1c (documentation, issues)
First occurred: 8:50:49 PM (2 occurrences)
Last logged: 8:50:49 PM

exception while getting sensors status: Traceback (most recent call last): File “/config/custom_components/broadlink_s1c/sensor.py”, line 259, in run current_status = self._hub.get_sensors_status() File “/usr/local/lib/python3.8/site-packages/broadlink/alarm.py”, line 37, in get_sensors_status ‘sensors’: [ File “/usr/local/lib/python3.8/site-packages/broadlink/alarm.py”, line 40, in ‘name’: sensor[4:26].decode().strip(’\x00’), UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa0 in position 1: invalid start byte
exception while getting sensors status: Traceback (most recent call last): File “/config/custom_components/broadlink_s1c/sensor.py”, line 259, in run current_status = self._hub.get_sensors_status() File “/usr/local/lib/python3.8/site-packages/broadlink/alarm.py”, line 37, in get_sensors_status ‘sensors’: [ File “/usr/local/lib/python3.8/site-packages/broadlink/alarm.py”, line 40, in ‘name’: sensor[4:26].decode().strip(’\x00’), UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8e in position 4: invalid start byte

@nnemedi @rn1 @AndroVet @pgdg71 @yonny24 @Ozkan_Ozturk After updating to HA 2021.4.0, they updated the broadlink library version from version 16 to 17, which broke the integration. But I already fixed it, I copied the code of the 16th version of the broadlink into this repository, now it will never break again, since it does not depend on the version of the broadlink library at all. You can update to new integration from HACS or copy again files https://github.com/nick2525/broadlink_s1c_s2c/tree/master/custom_components/broadlink_s1c_s2c now it is much more files

1 Like

I installed your HACS integration and upgraded HA to latest release (and and it worked flawlessy).

Thanks!

works great ! Nice fix

Hi,

I’ve installed the https://github.com/nick2525/broadlink_s1c_s2c addon but for some reason some of my sensors and the alarm do not show up. I’m trying to find a solution for abou a week with no luck.

Could someone please help me? I can see the sensors that are missing in the error log but I don’t know how to fix it…

Heres the log:

2021-04-09 14:20:39 ERROR (MainThread) [homeassistant.components.sensor] Entity id already exists - ignoring: sensor.broadlink_s1c_garagem
2021-04-09 14:20:39 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform broadlink_s1c
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 474, in _async_add_entity
raise HomeAssistantError(f"Invalid entity ID: {entity.entity_id}")
homeassistant.exceptions.HomeAssistantError: Invalid entity ID: sensor.broadlink_s1c_hall_r/c
2021-04-09 14:20:39 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up broadlink_s1c platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 213, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 474, in _async_add_entity
raise HomeAssistantError(f"Invalid entity ID: {entity.entity_id}")
homeassistant.exceptions.HomeAssistantError: Invalid entity ID: sensor.broadlink_s1c_hall_r/c
2021-04-09 14:24:45 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/broadlink_s1c_s2c/sensor.py", line 168, in async_event_listener
yield from self.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 282, in async_update_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity Hall r/c: motion_detected>
2021-04-09 14:25:16 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/broadlink_s1c_s2c/sensor.py", line 168, in async_event_listener
yield from self.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 282, in async_update_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity Hall r/c: no_motion>

Hall r/c it’s one of the sensors I cannot see in “Entities”.

I also would like to add the ALARM panel like this, but can’t figure that out…
711e2bb99af2243ab2d4789934026c71e29736b8

@rn1 Name is sensor.broadlink_s1c_hall_r/c, maybe problem is in slash, so try to rename sensor.broadlink_s1c_hall_r/c to sensor.broadlink_s1c_hall_r_c

1 Like

Hi @nick2525. If you want a clean fix you can replace None with 0x2714 here:

self._hub = S1C((ip_addr, 80), mac_addr, 0x2714)

Sorry for the inconvenience, we no longer accept None because new devices only work if the correct type is informed.

@felipediel thanks, done. Now we again use lib broadlink version 17, and again there are fewer files.

1 Like

That was it!! Thank you!!
Now I’m just missing the “Security Status” on my dashboard… :slight_smile:

Could someone please help me with the “Security Status” integration?

This broadlink component broke with core-2021.4.4

Rolling back as I write this

@yonny24 very strange, I upgraded to last core and it works. Did you try to upgrade component with HACs or copy files? I upgraded component 4 days ago.

1 Like

ah no I didn’t. Sorry how did you do that? Do I need to upgrade all of the components to your new repo?

Looks like I am still on this original version and not the ‘nick2525/broadlink_s1c_s2c’

home-assistant-custom-components/broadlink_s1c at master · TomerFi/home-assistant-custom-components · GitHub

Awesome just seen the previous posts and found it in HACS!! Sorry been rather busy lately.

Will try it out today!!

UPDATE: Perfect all solved with your new HACS integration version!! updated smoothly to the new core.

Thanks

1 Like

Could someone please help me with the “Security Status” integration?
Mine it’s just showing sensors and remotes…