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

Tilt only Somfy blinds via BOND entities states are unavailable #59396

Closed
6254sagebrush opened this issue Nov 9, 2021 · 35 comments · Fixed by #59505
Closed

Tilt only Somfy blinds via BOND entities states are unavailable #59396

6254sagebrush opened this issue Nov 9, 2021 · 35 comments · Fixed by #59505
Assignees

Comments

@6254sagebrush
Copy link

The problem

I added recently Somfy blinds via BOND. I have two blinds and entities were added.
cover.xxx_office_left_blind
whenever I press UP/DOWN button I get this error:

Failed to call service cover/open_cover. 404, message='Not Found', url=URL("http://BOND_IP_ADDR/v2/devices/BOND_CODE/actions/Open)

for this BOND entity I have few FAN connected that are working smoothly...

What version of Home Assistant Core has the issue?

core-2021.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Somfy Bond

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@6254sagebrush 6254sagebrush changed the title Somfy blinds via BOND wentities states are unavailable Somfy blinds via BOND entities states are unavailable Nov 9, 2021
@probot-home-assistant
Copy link

bond documentation
bond source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @bdraco, @prystupa, @joshs85, mind taking a look at this issue as it has been labeled with an integration (bond) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@bdraco
Copy link
Member

bdraco commented Nov 9, 2021

Have you tried deleting and reading the device to the bond and then reloading the integration ?

@6254sagebrush
Copy link
Author

@bdraco I tried few times. in one of the blinds pressing the white rectangle (My) is doing what it supposed to do. but pressing UP/DOWN returns the error all the time. The other blind My is not doing anything, UP/DOWN still get the error I mentioned.
using BOND APP I can cvontrol both blinds. moreover I have few FANs constrolled and able to change speed and on/off the light there.

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

Are the somfy shades tilt only?

Can you post a screenshot of the shade in the bond app?

@bdraco bdraco changed the title Somfy blinds via BOND entities states are unavailable Tilt only Somfy blinds via BOND entities states are unavailable Nov 10, 2021
@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

That explains it. The integration doesn't have support for tilt only blinds. It assumes all blinds are open/close

@6254sagebrush
Copy link
Author

6254sagebrush commented Nov 10, 2021

That explains it. The integration doesn't have support for tilt only blinds. It assumes all blinds are open/close

@bdraco ohh, anything I can do to have tilt support ?

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

I couldn't find anything in the bond api docs on how this so I'm not sure its possible to support, if the docs are missing, or the command to tilt is called something that wasn't obvious

http://docs-local.appbond.com/#section/Features/Open

You might try asking here
https://forum.bondhome.io/c/integrations/9

@6254sagebrush
Copy link
Author

I couldn't find anything in the bond api docs on how this so I'm not sure its possible to support, if the docs are missing, or the command to tilt is called something that wasn't obvious

http://docs-local.appbond.com/#section/Features/Open

You might try asking here https://forum.bondhome.io/c/integrations/9

@bdraco thanks will ask there

@6254sagebrush
Copy link
Author

@bdraco how come the pressing of open/close using BOND APP tilt it up/down? isn't HA immitate the command of the BOND APP ? so theoretically it should work the same? am I missing something ? thanks

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

It is sending the Open command and getting a 404 Not found from the bond device. I assume its called something else since Open isn't working.

You could play around with the api http://docs-local.appbond.com/#section/Getting-Started/Get-Device-Information and see if you can discover what the bond device is expecting to get.

@6254sagebrush
Copy link
Author

It is sending the Open command and getting a 404 Not found from the bond device. I assume its called something else since Open isn't working.

You could play around with the api http://docs-local.appbond.com/#section/Getting-Started/Get-Device-Information and see if you can discover what the bond device is expecting to get.

@bdraco nice, I manage to get from the Somfy device: actions: "Hold","TiltClose","TiltOpen","Pair","Preset","Stop"
I will read how using curl command I can use it

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

It would still be good to ask on the bond forums since it looks like it is indeed missing from the api docs. (unless I am blind)

@6254sagebrush
Copy link
Author

@bdraco ;-)
I see it is not in the API I will ask thanks

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021 via email

@6254sagebrush
Copy link
Author

@bdraco it is possible to control the Tilt :-)
curl -H “BOND-Token: xxxxxxxxxxxxxxxx” -X PUT -i http://bondIP/v2/devices/blindDeviceID/actions/TiltOpen -d {}
curl -H “BOND-Token: xxxxxxxxxxxxxxxx” -X PUT -i http://bondIP/v2/devices/blindDeviceID/actions/TiltClose -d {}
curl -H “BOND-Token: xxxxxxxxxxxxxxxx” -X PUT -i http://bondIP/v2/devices/blindDeviceID/actions/Hold -d {}

Hold is like "My" Button

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021

Great. We do need a way to detect if it's available so we need a dump of the current state as well

@6254sagebrush
Copy link
Author

@bdraco is it a curl command of the state ?

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021 via email

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021 via email

@6254sagebrush
Copy link
Author

WhatsApp Image 2021-11-10 at 07 43 25
@bdraco each command update both counter1 and 2

@bdraco
Copy link
Member

bdraco commented Nov 10, 2021 via email

@6254sagebrush
Copy link
Author

found this:
SUPPORT_OPEN = 1
SUPPORT_CLOSE = 2
SUPPORT_SET_POSITION = 4
SUPPORT_STOP = 8
SUPPORT_OPEN_TILT = 16
SUPPORT_CLOSE_TILT = 32
SUPPORT_STOP_TILT = 64
SUPPORT_SET_TILT_POSITION = 128

so currently 11 means only open/close/stop, I will change to 240 for tilt and will try

@6254sagebrush
Copy link
Author

Checkout the PR, and rsync the bond component into /config/custom_components/bond/, then restart. This will override the built-in bond integration with the one in the pull request. When the release is done, delete /config/custom_components/bond/ and update

@bdraco Do I need to copy only the new changes files or the entire files (even those who are not changed) ? Thanks

@bdraco
Copy link
Member

bdraco commented Nov 11, 2021

You need to copy the entire bond directory

@6254sagebrush
Copy link
Author

@bdraco I tried with new files but still device become unavailable. why a device would become unavailable? is it after reading the state ?

@6254sagebrush
Copy link
Author

2021-11-11 06:57:11 WARNING (MainThread) [homeassistant.components.bond.entity] Entity None has become unavailable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/bond/entity.py", line 121, in _async_update_from_api
state: dict = await self._hub.bond.device_state(self._device_id)
File "/usr/local/lib/python3.9/site-packages/bond_api/bond.py", line 56, in device_state
return await self.__get(f"/v2/devices/{device_id}/state")
File "/usr/local/lib/python3.9/site-packages/bond_api/bond.py", line 93, in __get
return await self.__call(get)
File "/usr/local/lib/python3.9/site-packages/bond_api/bond.py", line 101, in __call
return await handler(self._session)
File "/usr/local/lib/python3.9/site-packages/bond_api/bond.py", line 87, in get
async with session.get(
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 619, in _request
break
File "/usr/local/lib/python3.9/site-packages/aiohttp/helpers.py", line 656, in exit
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

@bdraco I still get device unavailable, attached the log.

@bdraco
Copy link
Member

bdraco commented Nov 11, 2021

It looks like the bond hub is failing to return the state of the device. Which firmware version is it running?

@6254sagebrush
Copy link
Author

It looks like the bond hub is failing to return the state of the device. Which firmware version is it running?

v2.28.0

@bdraco
Copy link
Member

bdraco commented Nov 11, 2021

Thats pretty new. I have no idea why the /v2/devices/{device_id}/state end point is timing out. You could try the beta firmwares but I'm not sure thats the issue.

Maybe check to see if its failing via curl as well?

@6254sagebrush
Copy link
Author

what should normally be returned for state? it returns two counters

curl
?

@bdraco
Copy link
Member

bdraco commented Nov 11, 2021

I'm not sure what is normal for a tilt only one since I have nothing to compare it to given the api isn't documented

@6254sagebrush
Copy link
Author

do you parse the state to see that it is valid? I mean in other entities like fan/light and so on ?

@bdraco
Copy link
Member

bdraco commented Nov 11, 2021

do you parse the state to see that it is valid? I mean in other entities like fan/light and so on ?

Yes. But valid just means its valid json in this case. The exception you posted implies that its not even responding and instead timing out.

@6254sagebrush
Copy link
Author

do you parse the state to see that it is valid? I mean in other entities like fan/light and so on ?

Yes. But valid just means its valid json in this case. The exception you posted implies that its not even responding and instead timing out.

@bdraco tested the PR and it working great, thanks a lot !!!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants