Tilt My Blinds/MySmartBlinds

@yammering I have your component working just fine. At first, I did lose all access to the bridge and needed to re-pair it but it seems to be working fine now. I do see this error in the logs though. Thanks so much for working on this!!

  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 63, in async_wrapper
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 187, in _set_blind_positions
  File "/Users/mediacenter/.homeassistant/deps/lib/python/site-packages/smartblinds_client/smartblinds.py", line 151, in set_blinds_position
  File "/Users/mediacenter/.homeassistant/deps/lib/python/site-packages/smartblinds_client/smartblinds.py", line 157, in _parse_states
    for blind_state in response['data']['blindsState']:
KeyError: 'blindsState'

That should be fixed in the newer rev I just posted.

1 Like

@yammering

This version has some big issues for me. Opening or closing doesn’t work but it reads the state every 15 minutes or so. Ideas?

Edit: figured out cover.open_cover doesn’t work, it now is cover.open_cover_tilt

However, this means it won’t work with lovelace, picture-elements and the toggle tap action. It also doesn’t seem to appear in Homekit along with the other cover components I am passing through.

Even more problems…here’s the full error log. Blinds lost all control. Is there a way I can get the older version? I copied over my file :tired_face:

Fri Sep 28 2018 12:04:10 GMT-0400 (EDT)

Update for cover.blinds fails
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 139, in update_blind_states
    await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
    yield from self.async_update()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 274, in async_update
    state = await self._bridge.get_blind_state(self._blind)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 124, in get_blind_state
    await self.update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 67, in async_wrapper
    return await func(*args, **kwargs)
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 137, in update_blind_states
    updated = await self._update_blind_states()
  File "/Users/mediacenter/.homeassistant/custom_components/cover/mysmartblinds_bridge.py", line 162, in _update_blind_states
    self._blind_states = await self._update_states_task
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/mediacenter/.homeassistant/deps/lib/python/site-packages/smartblinds_client/smartblinds.py", line 129, in get_blinds_state
    'blinds': list(map(lambda b: b.encoded_mac, blinds)),
  File "/Users/mediacenter/.homeassistant/deps/lib/python/site-packages/smartblinds_client/smartblinds.py", line 177, in _graphql
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.mysmartblinds.com/v1/graphql

Thanks for reporting. I’ll update again when it’s more finished. You can get the old one on GitHub by viewing the revision history Here

1 Like

@yammering, I just found an issue when using your lib for HA. I fixed it here by having a PR:

https://github.com/ianlevesque/smartblinds-client/pull/1

Please take a look if it can be merged, and I will keep testing your code for HA.

Thanks!

@Jer78 @zhangquan0126 I updated the code on github with a pretty well tested version. Let me know how that works for you. It might be close to mergeable.

@yammering I’ve been getting “unavailable” even with the new version after a few hours. Only a reboot solves the issue. Do you need logs?

Yeah that would be helpful. If you could turn the logging up to debug for the component ideally.

logger:
  logs:
    homeassistant.components.cover.mysmartblinds_bridge: debug

@yammering
Not sure how useful these logs are but when it loses connection the position displays 1 then goes back to its real state of 199. Not sure what causes it to go to “unavailable”

2018-10-11 16:15:46 INFO (MainThread) [homeassistant.loader] Loaded cover.mysmartblinds_bridge from custom_components.cover.mysmartblinds_bridge
2018-10-11 16:18:42 DEBUG (SyncWorker_0) [custom_components.cover.mysmartblinds_bridge] get_blinds_and_rooms() took 1.42 seconds
2018-10-11 16:27:27 DEBUG (SyncWorker_8) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=199,rssi=-75,battery_level=100)}
2018-10-11 16:27:27 DEBUG (SyncWorker_8) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 4.78 seconds
2018-10-11 16:27:27 DEBUG (SyncWorker_8) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 4.78 seconds
2018-10-11 16:27:27 DEBUG (SyncWorker_3) [custom_components.cover.mysmartblinds_bridge] Updated Blinds: BlindState(position=199,rssi=-75,battery_level=100)
2018-10-11 16:27:27 DEBUG (SyncWorker_1) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=199,rssi=-75,battery_level=100)}
2018-10-11 16:27:27 DEBUG (SyncWorker_1) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 4.81 seconds
2018-10-11 16:27:27 DEBUG (SyncWorker_1) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 4.81 seconds
2018-10-11 16:27:27 DEBUG (SyncWorker_7) [custom_components.cover.mysmartblinds_bridge] Updated Blinds: BlindState(position=199,rssi=-75,battery_level=100)
2018-10-11 16:32:27 DEBUG (SyncWorker_9) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=199,rssi=-75,battery_level=100)}
2018-10-11 16:32:27 DEBUG (SyncWorker_9) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 4.84 seconds
2018-10-11 16:32:27 DEBUG (SyncWorker_9) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 4.84 seconds
2018-10-11 16:32:27 DEBUG (SyncWorker_9) [custom_components.cover.mysmartblinds_bridge] Updated Blinds: BlindState(position=199,rssi=-75,battery_level=100)
2018-10-11 16:37:28 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=199,rssi=-64,battery_level=100)}
2018-10-11 16:37:28 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 4.84 seconds
2018-10-11 16:37:28 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 4.84 seconds
2018-10-11 16:37:28 DEBUG (SyncWorker_0) [custom_components.cover.mysmartblinds_bridge] Updated Blinds: BlindState(position=199,rssi=-64,battery_level=100)
2018-10-11 16:42:50 DEBUG (SyncWorker_3) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=-1,rssi=0,battery_level=-1)}
2018-10-11 16:42:50 DEBUG (SyncWorker_3) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 25.81 seconds
2018-10-11 16:42:50 DEBUG (SyncWorker_3) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 25.81 seconds
2018-10-11 16:47:51 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=-1,rssi=0,battery_level=-1)}
2018-10-11 16:47:51 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 25.51 seconds
2018-10-11 16:47:51 DEBUG (SyncWorker_4) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 25.51 seconds
2018-10-11 16:52:32 DEBUG (SyncWorker_7) [custom_components.cover.mysmartblinds_bridge] Blind states: {'yWBdF9LS': BlindState(position=199,rssi=-72,battery_level=100)}
2018-10-11 16:52:32 DEBUG (SyncWorker_7) [custom_components.cover.mysmartblinds_bridge] update_blind_states() took 5.15 seconds
2018-10-11 16:52:32 DEBUG (SyncWorker_7) [custom_components.cover.mysmartblinds_bridge] _update_periodic() took 5.15 seconds
2018-10-11 16:52:32 DEBUG (SyncWorker_1) [custom_components.cover.mysmartblinds_bridge] Updated Blinds: BlindState(position=199,rssi=-72,battery_level=100)

@yammering Great! The new version of mysmartblinds bridge works for me.

Basically, it is cloud pushing. Could we make it local pushing? It would align the motivation of HA.

Yeah I see some positions of -1, that seems to be what the bridge reports if it can’t communicate with a blind for some reason. Not sure how we should handle that.

I’d prefer that too but I have no idea how to communicate with the bridge over LAN, if you even can. I’m sure you could reverse the BTLE protocol and use some other bridge to communicate with them without the cloud but that’s another whole level of project.

David S has more or less reverse engineered the BTLE code for the blinds… I’m helping him work out the kinks towards getting something that works with HA.

You can follow along with his work and my testing @ https://github.com/dnschneid/pysmartblinds/issues/3

This to me local BT control is the most promising approach…

Eventually I’d like to be able to treat the blinds as native devices via haaska & hass instead of that stupid mysmartblinds alexa skill.

To me the bridge is pretty much dead end, unless someone can solder on some leads and get a serial connection to get root (I can upload pics of the board if anyone is good with hardware) or reverse engineer the Nordic semi DFU firmware that is sitting in inside the android app apk under /res/raw/update_image*.zip … Honestly, I’m not sure there’s much point though.

So far the bridge version @yammering created is pretty solid. Works very well for me. Will this get released in a future update to HA without the need for the custom component?

@jumpkick
I can understand Bluetooth would be better for a lot of people since you could have local control and no need for the bridge. My old Mac Mini has no BLE support so I need the bridge for the time being. But I do agree with you on the Alexa skill, it’s absolute garbage. This company is so frustrating because they have no customer service skills. They don’t want to open an API nor care for product suggestions. I bought them cheap awhile ago but since the price went up I won’t be adding more.

Yeah I don’t think there’s any point to reversing their bridge further. I’ve basically accepted the bridge’s cloud limitation and slow polling and find it useful but I probably won’t pursue merging it.

I’m with you on the customer front… a damn web interface on the bridge or some API would’ve been really nice … :frowning:

Incidentally the Raspberry Pi 3 did quite well at BLE (better then my old chromebox), so I’d think about that as an upgrade path for BLE rather than looking for a dongle… Might be worth the few extra pesos with the power savings.

@yammering Good on you for hacking the app API, that’s some good stuff … :smiley:

1 Like

I’ve done some work to Mr Schneider’s repo to get the mysmartblind component to run on HASS 0.77+, along with documenting the setup instructions on my fork (pulls for my stuff are waiting to go back upstream to his repo)… My fork is here:

So far I would say it’s too early to really use… it needs better error / retry handling and additional low level BLE protocol reverse engineering. It usually takes me several tries to get the blinds to move. That being said, if anyone is handy at coding, please grab the code and mess with it.

@yammering

0.92 breaks custom components. I tried adding the manifest file based on the link below but still doesn’t work. Any ideas?

https://developers.home-assistant.io/docs/en/creating_integration_manifest.html

Have you added an empty __init__.py file?

None of the custom components I use have that .json file yet.