Broadlink S1C Alarm Kit Custom Sensor Component

hi I have hassbian 0.65.5, I followed the guide but the sensors do not appear in the home assistant, in the log I see:

File “/home/homeassistant/.homeassistant/custom_components/sensor/broadlink_s1c.py”, line 91, in async_setup_platform
conn_obj = HubConnection (ip_address, mac_addr, timeout)
File “/home/homeassistant/.homeassistant/custom_components/sensor/broadlink_s1c.py”, line 172, in init
self._hub = broadlink.S1C ((ip_addr, 80), mac_addr)
AttributeError: module ‘broadlink’ has no attribute ‘S1C’

I tried to delete the broadlink_s1c.cpython-35.pyc file and restart HA but without success.
How can I solve?

Correct extension is .py not .pyc maybe is The reason Why this file in not found…

Ciao Roberto

the file broadlink_s1c.cpython-35.pyc automatically creates it on reboot in the pycache_ folder

Have you put this file broadlink_s1c.py in the right folder?

yes, i have put the broadlink_s1c.py file in: /home/homeassistant/.homeassistant/custom_components/sensor

It seem not using broadlink 0.6 but previus version and don’t find s1c library have you Used last version plugin ?

i have used the last component sensor https://github.com/TomerFi/home-assistant-custom-components/tree/master/broadlink_s1c/custom_components/sensor

Right ! Try to restart raspberry and see if work , otherwise you need force use of broadlink library 0,6 all’ is tested since version HA 0.65.4

i have restart the raspberry but don’t work.
How i force the library 0.6 ?

Yes becouse ha use broadlink 0.5 as default while s1c sensor working only with broadlink 0.6

how do i make it work with 0.6?

Now works!
with hassbian 0.65.5 don’t work, i updated to 0.65.6 and it work!

edit:

it worked once, but you have later reboots no longer worked…

I installed this with the latest HA, 0.65.6 but I get this error:

AttributeError: module ‘broadlink’ has no attribute ‘S1C’

What do I need to modify to get this to work with the latest HA?

Thank you Tomer

1 Like

The configuration should be like this
sensor:

  • platform: broadlink_s1c
    ip_address: 192.168.31.68
    mac: ‘34:EA:34:XX:XX:XX’
    timeout: 10

Is the timeout in minutes or seconds?
Thanks as always

Seconds …

1 Like

I’ve updated the component:

  • Fixed for version 0.67.1 which uses the new broadlink 0.8 library.
  • Canceled the use of the custom broadlink 0.6 library (If you’re updating from the previous version, please make sure there is no broadlink folder in your /config/deps folder).
  • Fix unnecessary log writes of repeated time outs (@Marc_R this one is for you :wink: )

@roberto87 @imperialjoy
Sorry it took me so long to reply.
I hope you got the component working.
If not, please try the new version.
If it still doesn’t work please reply with log details and I’ll do my best to help.

3 Likes

Thank you so much. I will try tonight. By the way the old one is working fine for me. The only problem is that if I restart HA. The status will show unknown. So I have to turn on then off the alarm to get the new status of the alarm.

1 Like

For those who got this error
> Traceback (most recent call last):

      File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
        SLOW_SETUP_MAX_WAIT, loop=hass.loop)
      File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
        return fut.result()
      File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
        raise self._exception
      File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
        result = coro.send(None)
      File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
        res = func(*args, **kw)
      File "/home/homeassistant/.homeassistant/custom_components/sensor/broadlink_s1c.py", line 91, in async_setup_platform
        conn_obj = HubConnection(ip_address, mac_addr, timeout)
      File "/home/homeassistant/.homeassistant/custom_components/sensor/broadlink_s1c.py", line 172, in __init__
        self._hub = broadlink.S1C((ip_addr, 80), mac_addr)
      File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 753, in __init__
    TypeError: __init__() missing 1 required positional argument: 'devtype'

To fix it, I’ve download last version of the fantastic python script of @TomerFi put it in its custom folder and then I deleted the file:
custom_components/sensor/__pycache__/broadlink_s1c.cpython-35.pyc

Restarted home assistant with:
systemctl restart [email protected]

Tested on Broadlink Alarm kit S2C and it works :slight_smile:
That’s all

1 Like