core: Broadlink switch sp3mini error

The problem

ERROR (MainThread) [homeassistant.components.broadlink.switch] Failed to update state: The device storage is full

Environment

  • Home Assistant Core release with the issue: Home Assistant 0.110.7
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): homeassistant/raspberrypi3-homeassistant:stable
  • Integration causing this issue: broadlink switch
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml

switch:
  - platform: broadlink
    host: 192.168.2.245
    mac: 'mac'
    friendly_name: sp3mini
    type: sp3

Traceback/Error logs

ERROR (MainThread) [homeassistant.components.broadlink.switch] Failed to update state: The device storage is full

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 42 (24 by maintainers)

Most upvoted comments

Hello, Im trying to test the code in home assistant. Are there any changes in homeassistant/components/broadlink too? I see that there is code in const.py and switch.py, that correspond to SP1/SP2 switches, but no code for SP3/SP4. Are the changes in python-broadlink sufficient to add support for SP3/SP4?

(I have an SP4 switch, and with the python-broadlink changes to init.py/switch.py, things work correctly in python interpreter, but when I try the Broadlink integration from UI, its still broken)

Okay, looks like I missed the part about the sp4 branch from @felipediel . Checked it out, the switch works!

@felipediel Still works for me with the newest code.

@felipediel I can confirm that controlling the switch works fine with python-broadlink on your latest-broadlink branch, and also with home-assistant on your sp4 branch. Thanks a lot!

@felipediel Thanks for investigating!

It seems to return the correct state when toggled via the IHC app. Note I can only control it with the older IHC app; the newer BroadLink app lists the device, but refuses to interact with it (“It’s currently not supported on this device.”).

Setting power to False has no effect, no matter whether the switch is turned on or off.

# Turn ON via IHC app
>>> d.get_state()
{'pwr': 1, 'maxworktime': 0, 'indicator': 1}
# Turn OFF via IHC app
>>> d.get_state()
{'pwr': 0, 'maxworktime': 0, 'indicator': 1}

I can capture some network traces if that would be helpful.

Yes

>>> import broadlink as blk
>>> devs = blk.discover(timeout=5)
>>> [(d.host[0], hex(d.devtype), d.mac.hex()) for d in devs]
[('192.168.1.27', '0x5f36', '39ee7aa7df24')]
>>> d = devs[0]
>>> d.auth()
True
>>> d.check_sensors()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bram/Documents/projects/home-assistant/core/venv/lib/python3.7/site-packages/broadlink/__init__.py", line 680, in check_sensors
    'temperature': self.check_temperature(),
  File "/Users/bram/Documents/projects/home-assistant/core/venv/lib/python3.7/site-packages/broadlink/__init__.py", line 673, in check_temperature
    return self._read_sensor( 0x24, 4, 100.0 )
  File "/Users/bram/Documents/projects/home-assistant/core/venv/lib/python3.7/site-packages/broadlink/__init__.py", line 653, in _read_sensor
    check_error(response[0x22:0x24])
  File "/Users/bram/Documents/projects/home-assistant/core/venv/lib/python3.7/site-packages/broadlink/exceptions.py", line 97, in check_error
    raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

@felipediel Looking much better. Now returning 0 when power is switched off, and 1 when it’s turned on.

>>> import broadlink as blk
>>> d = blk.sp4(('192.168.1.199', 80), 'aabbccddeeff', 0x7d11)
>>> d.auth()
True
>>> d.check_power()
1