@fantangelo, thanks for the dump - I’ve worked it out. The room/scene/roller ID’s are not stings so I’ve changed how they’re parsed. I’ve just committed an update to the aiopulse API if you can give the demo one more go. If this works for you I’ll update the Home Assistant integration.
@stavroz, can you run the demo on another machine and provide the debug dumps? Any OS with python 3 should be fine.
Not sure why but ‘connect’ just gave me a bunch of errors when I was trying it before but it is working now. Not sure if a restart of hassio made a difference.
thanks for the tip.
@gregbm: That’s great, I was able to reproduce the issue - you have a roller that is not in any room. I’ve re-created your full setup and was able to get everything to parse OK. Can you check-out the latest and give the demo yet another go?
Also, noting that you’ve already posted it publically here, are you happy for me to use all your output to create unit tests that I’ll check-in? I don’t believe there is anything personally identifying (just the private IP addresses of your hub along with room/scene/roller names).
Gents, I just pushed a new commit of the integration to my fork. Suggest using the instructions on the other thread to install it as a custom component to give it a go. You may need to upgrade to a fairly recent build of Home Assistant (I’m on 0.108.5).
The integration is working now. Thanks for your work!
I have two feature requests.
I only need to send a command to my shades twice a day, once in the morning based on sunrise to open, then in the evening to close based on sunset. I don’t really need to know if someone manually uses the remote to open/close the shades. So, is it possible to minimize the polling that is done to determine the current state? For example, by using a ‘scan_interval’ setting? I am concerned about unnecessary WIFI traffic when my system is already fairly congested as is. I would set the scan interval to, let’s say, once an hour.
Secondly, is there a way to open/close all shades with one cover.open call?
Also, is the discovery of hubs and devices only run once when the integration is added or is it run on every HA restart?
@atmurray I still get an error trying to install the integration. I upgraded to hassio 0.108.6 and HassOS 3.13.
Error log is:
2020-04-19 10:22:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 163, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 50, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 92, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 168, in _async_handle_step
f"Handler {flow.__class__.__name__} doesn't support step {step_id}"
homeassistant.data_entry_flow.UnknownStep: Handler AcmedaFlowHandler doesn't support step init
is it possible to minimize the polling that is done to determine the current state? For example, by using a ‘scan_interval’ setting? I am concerned about unnecessary WIFI traffic when my system is already fairly congested as is. I would set the scan interval to, let’s say, once an hour.
The way I developed the API is asynchronous and doesn’t rely on polling at all. Essentially, the hub tells the API and therefore Home Assistant when a blind changes position. The only exception to this is that the API does periodically (every 30 seconds) send a short “poll” message (a couple of dozen bytes in total) in order to keep the connection to the hub alive. This mimics the way the hub communicates with the smart phone app and the Acmeda cloud service. As such, load on your WiFi network won’t be more than what these already create.
is there a way to open/close all shades with one cover.open call?
Despite creating this integration, I’m in no way a Home Assistant expert. However, I think this sort of thing should be able to be configured within Home Assistant itself. Have you considered configuring an automation or script to do this? I could look at exposing the configured Hub scenes in Home Assistant, but this seems to waste the power of Home Assistant itself.
is the discovery of hubs and devices only run once when the integration is added or is it run on every HA restart?
Discovery only runs the one time you “add” the integration (you can re-add the integration to add multiple hubs). You can actually manually add hubs to Home Assistant using the configuration script if for some reason discovery doesn’t work or you prefer not to run it.
I still get an error trying to install the integration.
I could be wrong but it looks like your install isn’t upgrading correctly. Either way, just for you I’ve had a go at backporting the integration, give the following a try:
curl https://codeload.github.com/atmurray/home-assistant/tar.gz/acmeda-backport | tar -xz --strip=3 home-assistant-acmeda-backport/homeassistant/components/acmeda
@stavroz, looks like you haven’t installed the API.
You can do this from PyPi:
pip install aiopulse
Or from within the aiopulse code in the directory that contains setup.py:
@atmurray
The backport worked for me. Thanks for your excellent support with this.
One issue is that the Current Position is the opposite of what the app says. When the Shade is closed the current position says 0% whereas the app says 100%
A question - does the battery level work? Mine all say 100%.