The code is not ready for serious use yet, by any means, but I have now managed to raise and lower my Rollease blinds from Home Assistant.
Basically, it’s a script which connects to the Hub over RS485 and to an MQTT broker. Position updates from the blinds are fed to MQTT, and commands from MQTT can be used to make the blinds open, close, stop or move to a particular position.
It may still be a while before it’s properly tidied up and usable as a Hass.io plugin - I’m not too proud of the code yet - but it’s becoming fun to play with. Any developers who have Python 3.7 and aren’t frightened of asyncio are welcome to have a look and suggest improvements!
OK, I have it running here as a Hassio addon, and it’s working nicely. I woke up this morning and opened all the blinds in the house using the HomeAssistant iphone app. This means I can start thinking about things like sunset-based automations, and opening the blinds when there’s motion in the room after sunrise.
If anyone wants to try it and has the necessary hardware, you can install it as a local add-on as per the add-on tutorial. Just copy the contents of the git repository into a local add-on directory.
The main things still to do are to make it more robust if there are errors, blinds going offline, etc and to make it available as a proper add-on. I’ll probably eventually split it into two git repositories: a separate rollease2mqtt package that others can use, and a homeassistant-rollease one with the add-on configuration.
Yes, I did see that appear - it’ll be interesting to see what it offers. I note that it doesn’t have the RS485 interface any more, so I hope it offers some network-based alternative. I think it must, since they still talk about integration with things like Control4.
That may well be the easiest way to go once it’s actually available!
The documents for the Control4 interface state “The Automate Pulse Hub 2 supports Ethernet Cable (CAT 5) and Wireless Communication 2.4GHz) for home automate integration using the RJ45 port conveniently located on the back of the hub. Each hub can support integration of up to 30 shades.”
Hi,
Thanks for your work on this plugin.
I got the adapter, wired everything up, installed the plugin and it is almost working.
I have 7 blinds and only the first one is working and I am pretty sure that the startup error message is the problem as per below. Is it a timing issue?
thanks
INFO:__main__:Connecting to hub using device /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
INFO:rollease:Ask hubs to report in
INFO:rollease:Watching for serial updates
INFO:__main__:Pausing for 10 secs to allow blinds to respond
INFO:rollease:Registering hub 001
INFO:rollease:Requesting motor info for hub 001
INFO:rollease:Got address message from hub 001
INFO:rollease:Registering motor 001 on Hub 001
INFO:rollease:Requesting position info for motor 001 on hub 001
INFO:rollease:Recorded version of Hub 001 motor 001 as 'D00'
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<AcmedaConnection.monitor_updates() done, defined at /rollease.py:300> exception=UnicodeDecodeError('utf-8', b'!001D002\xf6!001D002vD00;', 8, 9, 'invalid start byte')>
Traceback (most recent call last):
File "/rollease.py", line 308, in monitor_updates
async for hub, delim, resp in self.response_iter():
File "/rollease.py", line 294, in response_iter
res = await self._get_response()
File "/rollease.py", line 265, in _get_response
return resp.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 8: invalid start byte
Mmm. I’m not sure about that one… It’s late tonight, but I’ll try to look more carefully into it soon.
There are some possible issues with overlapping reads and writes, I think; I’ve perhaps made things a bit too asynchronous! I need to insert a proper queue between requests coming in from HA and messages going out on the wire. In the meantime, I’ve found that it’s working very well for me as long as I don’t send commands to multiple blinds at the same time. In my automations, I insert a 3-second delay between asking one blind to move, and asking the next one, and that solved my problems for now. I have chunks of YAML that look like:
Thanks for the reply.
Actually, the error msgs that I posted are when starting the add-on. I have since tweaked the code slightly (with my very primitive py skills) to prevent the errors. I can get my shades to open/close and like you suggested I have a delay between commands although 1 second was enough.
Thanks for your work on this.
Oh, but @fantangelo, and anyone else who may have tried it so far, please note: the root MQTT topic has changed, and the covers now appear under ‘homeassistant’ rather than ‘home-assistant’, which is much more standard.
Would it be possible to update the add-configuration settings to pass the mqtt username/password as hassio secrets instead of in the open? Instead of passing the raw connection string, maybe do something like this
Got my hands on a pulse 2 (finally) I have three motorised blinds at home, wasn’t going to dive down the rabbit hole until I got these working then I will probably buy more.
At present the app is clunky but functional - looking forward to trying to get it working with home assiatant. It detected in HA automatically as a homekit device
but I couldnt pair with the number on the sticker - appparently the integration wants to see a code like XXXX-XX-XXXX but my code is just 1234 1234 format - wondering when i get more time if i scanned the QR code if it may actually have the other digits hidden?
I got my pulse 2 hub as well and was able to successfully pair it with HA using the HomeKit integration. The integration does ask for XXX-XX-XXX and the sticker has 1234 1234, but I just entered the numbers in the integration as 123-41-234 and everything worked flawlessly. I have 6 roller shades and they all show up in HA. I can open and close the rollers, plus set a position. They simply show up as a cover type entity.
The battery level is missing from the entity right now, but that’s something that I can work with.
cover.front_winder_roller open current_position: 97
friendly_name: Front Window Roller
supported_features: 7
Good news, I’ve got a version 1 hub and have managed to reverse engineer the direct interface that the iPhone app uses to communicate directly with the hub. I’ve published a python module that includes a fairly basic demo app. The demo app discovers any hubs on the local network and provides basic up/down/stop/moveto control of blinds.
I also am fairly well progressed in creating a home assistant add-on but for now need people with a hub and a basic level of python skills to test out the module to confirm it works for them.
You can checkout the module and demo from github here: