Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position is not updated - PositionableHorizontalAwning - io:HorizontalAwningIOComponent #30

Closed
dsbaars opened this issue Jun 5, 2020 · 10 comments · Fixed by #41
Closed
Labels
bug Something isn't working platform: cover

Comments

@dsbaars
Copy link

dsbaars commented Jun 5, 2020

Describe the bug
When I control my horizontal awning (Uitvalscherm), the awning does what I ask but the position is not updated.

The HA log is spammed with the following error:

Jun 05 19:36:59 meterkastpi hass[24450]:     await self.hass.async_add_executor_job(self.update)
Jun 05 19:36:59 meterkastpi hass[24450]:   File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
Jun 05 19:36:59 meterkastpi hass[24450]:     result = self.fn(*self.args, **self.kwargs)
Jun 05 19:36:59 meterkastpi hass[24450]:   File "/home/homeassistant/.homeassistant/custom_components/tahoma/cover.py", line 112, in update
Jun 05 19:36:59 meterkastpi hass[24450]:     CORE_CLOSURE_STATE)
Jun 05 19:36:59 meterkastpi hass[24450]: TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Jun 05 19:37:15 meterkastpi hass[24450]: 2020-06-05 19:37:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for cover.zonwering fails
Jun 05 19:37:15 meterkastpi hass[24450]: Traceback (most recent call last):
Jun 05 19:37:15 meterkastpi hass[24450]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
Jun 05 19:37:15 meterkastpi hass[24450]:     await self.async_device_update()
Jun 05 19:37:15 meterkastpi hass[24450]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 472, in async_device_update
Jun 05 19:37:15 meterkastpi hass[24450]:     await self.hass.async_add_executor_job(self.update)
Jun 05 19:37:15 meterkastpi hass[24450]:   File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
Jun 05 19:37:15 meterkastpi hass[24450]:     result = self.fn(*self.args, **self.kwargs)
Jun 05 19:37:15 meterkastpi hass[24450]:   File "/home/homeassistant/.homeassistant/custom_components/tahoma/cover.py", line 112, in update
Jun 05 19:37:15 meterkastpi hass[24450]:     CORE_CLOSURE_STATE)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'cover.zonwering' (in my case)
  2. Click on 'open' or 'close'
  3. See the awning physically do what I ask, but the position slider not changing

Expected behavior
The position slider to change

Environment (please complete the following information):

  • Home Assistant version: 0.110.4
  • Platform: cover

Device: (if your problem is related to a specific device)

  • Model: PositionableHorizontalAwning
    by Somfy
  • Type: io:HorizontalAwningIOComponent
@dsbaars dsbaars added the bug Something isn't working label Jun 5, 2020
@iMicknl
Copy link
Owner

iMicknl commented Jun 5, 2020

Thanks for reporting. Which version of the component are you using? (Via HACS or latest from master)

I think the issue is possibly that the position for horizontal awnings have to be reversed. I will have a look.

@dsbaars
Copy link
Author

dsbaars commented Jun 5, 2020 via email

@dsbaars
Copy link
Author

dsbaars commented Jun 5, 2020

I'm currently using homebridge-tahoma, since the HA integration using the Open API and the existing Tahoma integration do not work well for me.

This code might point you in the right direction. I'm also available on the HA discord server.

Removing the offset if..then statements and removing the 100- at self.position seems to stop the error message already.

EDIT: Removing those two actually made it work as expected :) The initial value after restarting was not completely to the right though, so maybe the offset is only required at initalization?

@iMicknl iMicknl changed the title [Bug] Position is not updated Position is not updated - PositionableHorizontalAwning - io:HorizontalAwningIOComponent Jun 6, 2020
@iMicknl
Copy link
Owner

iMicknl commented Jun 6, 2020

In the original component, they added an exception for the io:HorizontalAwningIOComponent. However, in this refactor, we try to add features based on the available states and commands to make it more modular.

Could you maybe gather some more details of your device, so I can have a look? https://github.com/totalimmersion/com.somfy.tahoma/files/2755935/Instructions.for.the.TaHoma.devices.pdf.

@dsbaars
Copy link
Author

dsbaars commented Jun 6, 2020

My password is not accepted on the html5 client, probably because I have a Connexoon IO box. Is there another way I can provide you the required information? (and funny running into you here after three years @iMicknl :) )

@vlebourl
Copy link
Collaborator

vlebourl commented Jun 7, 2020

If you're familiar with running a Python script, you can have a look at the bottom of this page https://github.com/vlebourl/tahoma_extended/blob/master/README.md

@dsbaars
Copy link
Author

dsbaars commented Jun 7, 2020

Your script was not working correctly, but I modified it myself to make it work.
I made the following changes to line 37 and 42 to make it work:

      states = v.state_definitions
      commands = v.command_definitions

Here is the output in devices.txt.

****************************************
Label: zonwering
controlableName: io:HorizontalAwningIOComponent
uiClass: Awning
widget: PositionableHorizontalAwning
=== States ===
<pyhoma.pyhoma.Device object at 0x76018ab0>
'core:DeploymentState'
'core:Memorized1PositionState'
'core:NameState'
'core:OpenClosedState'
'core:PriorityLockTimerState'
'core:RSSILevelState'
'core:SecuredPositionState'
'core:StatusState'
'io:PriorityLockLevelState'
'io:PriorityLockOriginatorState'

=== Commands ===
'close'
'delayedStopIdentify'
'deploy'
'down'
'getName'
'identify'
'my'
'open'
'refreshMemorized1Position'
'setClosure'
'setDeployment'
'setMemorized1Position'
'setName'
'setPosition'
'setSecuredPosition'
'startIdentify'
'stop'
'stopIdentify'
'undeploy'
'up'
'wink'

@iMicknl
Copy link
Owner

iMicknl commented Jun 7, 2020

My password is not accepted on the html5 client, probably because I have a Connexoon IO box. Is there another way I can provide you the required information? (and funny running into you here after three years @iMicknl :) )

Indeed, likewise! Nice to 'meet' again after those years. ;-)

Could you maybe give the latest master a try? https://github.com/iMicknl/ha-tahoma/tree/master a try? I noticed I made a mistake in the if statement, however I would like to understand how we can detect if 100 is closed or 100 is open in a dynamic way. For now, I just assume that core:DeploymentState == 100 means open.

# Home Assistant: 0 is closed, 100 is fully open.
# core:ClosureState: 100 is closed, 0 is fully open.

@dsbaars
Copy link
Author

dsbaars commented Jun 7, 2020

Entity was disabled after replacing the code, after removing the integration and wanting to re-add it again the integration does not appear anymore and gives the following error in the logs:

Jun 07 15:55:35 meterkastpi hass[22009]: 2020-06-07 15:55:35 INFO (SyncWorker_9) [homeassistant.loader] Loaded tahoma from homeassistant.components.tahoma
Jun 07 15:55:42 meterkastpi hass[22009]: 2020-06-07 15:55:42 INFO (MainThread) [homeassistant.setup] Setting up tahoma
Jun 07 15:55:43 meterkastpi hass[22009]: 2020-06-07 15:55:43 ERROR (MainThread) [homeassistant.setup] Error during setup of component tahoma
Jun 07 15:55:43 meterkastpi hass[22009]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tahoma/__init__.py", line 74, in setup
Jun 07 15:55:43 meterkastpi hass[22009]: KeyError: 'tahoma'

@iMicknl
Copy link
Owner

iMicknl commented Jun 7, 2020

In case you have time, you can find me on HA Discord as iMick or on https://discord.com/channels/718361810985549945/718361810985549948, a Discord that was created for this component. Not sure where this error is coming from, I can not reproduce it with latest master on both my installs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: cover
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants