Apparently, pycrypto issue has been fixed. However, I can still see some errors.
2018-03-08 00:18:30 DEBUG (MainThread) [custom_components.sensor.broadlink_s1c] starting platform setup
2018-03-08 00:18:31 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform broadlink_s1c
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/config/custom_components/sensor/broadlink_s1c.py", line 91, in async_setup_platform
conn_obj = HubConnection(ip_address, mac_addr, timeout)
File "/config/custom_components/sensor/broadlink_s1c.py", line 171, in __init__
self._hub = broadlink.S1C((ip_addr, 80), mac_addr)
AttributeError: module 'broadlink' has no attribute 'S1C'
2
I think in your case it might be the opposite issue because of the version.
My referenced library required was updated to use pycryptodome instead of pycrypto because they are actually the same and they can’t work together and HA already works with pycryptodome.
Maybe 0.62.1 still works with pycrypto…
Can you please try changing the assignment of the REQUIREMENTS to the original library:
because using the secrets.yaml file I kept receiving this error:
and the error I read is
2018-03-08 10:05:48 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.broadlink_s1c
2018-03-08 10:05:48 DEBUG (MainThread) [custom_components.sensor.broadlink_s1c] starting platform setup
2018-03-08 10:05:48 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform broadlink_s1c
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 189, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/config/custom_components/sensor/broadlink_s1c.py", line 93, in async_setup_platform
conn_obj = HubConnection(ip_address, mac_addr, timeout)
File "/config/custom_components/sensor/broadlink_s1c.py", line 173, in __init__
self._hub = broadlink.S1C((ip_addr, 80), mac_addr)
AttributeError: module 'broadlink' has no attribute 'S1C'
I’m glad it’s working.
I’ll try and update the component so that it will assign a different requirement based on the HA version.
That way it will support all versions until the original library will be updated aswell.
But I think the error message you’ve received module 'broadlink' has no attribute 'S1C'
was not caused by the use of the secrets.yaml file.
The error simply says that there is no S1C support in the imported broadlink library.
Which probably means its trying to work with the pre-existing broadlink 0.5 library and not the required broadlink 0.6 one.
A while ago I had a feeling that in some cases HA initiates newly added custom components before its done satisfying their requirements, which means that once the component was initiated it imported the broadlink 0.5 library instead of broadlink 0.6 which was not fully installed yet.
If that’s the case then I believe that now after the component was already initiated once and the cache file was created, this issue is resolved.
I also work with the secrets.yaml file and it works well.
If you can try reinserting the secret, restarting HA and confirming it for us, I’ll try and update the component so it will force the use of broadlink 0.6.
Just make sure the names of the sensors in the Braodlink app is not the same for more then one sensor.
I didn’t thought about the option of having two bridges each having a sensor with the same name,
So I create the entity id based on the name, I’m not sure what the result would be in this case.
I have the same error home assistant 0.64.3 , upgraded to broadlink 0.6
Blockquote Error while setting up platform broadlink_s1c
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 84, 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 93, in async_setup_platform
conn_obj = HubConnection(ip_address, mac_addr, timeout)
File “/home/homeassistant/.homeassistant/custom_components/sensor/broadlink_s1c.py”, line 173, in init
self._hub = broadlink.S1C((ip_addr, 80), mac_addr)
AttributeError: module ‘broadlink’ has no attribute ‘S1C’
I get a lot of these errors after a while:
Any idea?
Failed to connect. No retries.
1:02 AM /usr/lib/python3.6/site-packages/pychromecast/socket_client.py (ERROR)
max exceptions allowed in watch loop exceeded, stoping watch loop
4:20 PM custom_components/sensor/broadlink_s1c.py (ERROR)
Fri Mar 09 2018 16:20:03 GMT+0700 (SE Asia Standard Time)
exception while getting sensors status: Traceback (most recent call last):
File "/config/custom_components/sensor/broadlink_s1c.py", line 262, in run
current_status = self._hub.get_sensors_status()
File "/config/deps/lib/python3.6/site-packages/broadlink/__init__.py", line 548, in get_sensors_status
response = self.send_packet(0x6a, packet)
File "/config/deps/lib/python3.6/site-packages/broadlink/__init__.py", line 286, in send_packet
response = self.cs.recvfrom(2048)
socket.timeout: timed out
@dustardly2
I think I have a workaround.
I’m just testing it myself and if it works I’ll share it shortly.
@Marc_R
It’s kind of a “defense mechanism” ,
If you have too many network exceptions that prevent the connection to the bridge, the connection stops trying so it won’t overload your network or your HA log file.
I’m thinking about canceling it, but for now I’ve just adjusted it so it will allow more exceptions in a shorter amount of time.
I’ll share the new version shortly.
tested now and work perfect after a reboot, just one thing, all sensor are showed in the whater sensor menu, probably I need to edit configuration.yaml in another way?
I add sensor after this
Weather prediction
sensor:
I have 2 A1 broadlink
after I add ip and mac address of 5 (2 s1c and 3 s2c and all working but notify me in the high menu ) there is a way to show in a different menu?