This is a pythons script to connect an Raspberry PI to an Zemismart Roller Shade, it’s listen to an MQTT topic and execute a close or open command based on that topic.
The Zemismart Roller shade are great and have a good price (Thanks @TheHookUp video I discovered them!), but they only have bluetooth connection! this script help integrate them to HA using a Raspberry PI (I’m currently using a cheap RPi W). This is my first “public” script and so far has been a long journey to make it work!! My programming skills are kind of limit, but with a lot of copy/past and google I made it happen!!
Where do I get it??
Here is the link to my github project link! First time using github, so hope I don’t mess up too much… like I did uploading my password in there last week!
After setting up the Rapsberry, just add some other stuff and you should be good to go!
- paho-mqtt (pip install paho-mqtt)
- bluepy (sudo pip install bluepy)
- libglib2.0-dev (sudo apt-get install libglib2.0-dev)
The file and the config it’s one script: rollshade.py
In HA you can add some switch with each one of the shades, just add this:
- platform: mqtt name: "Curtain Bedroom" state_topic: "curtains/00:00:00:00:00:00/status" command_topic: "curtains/00:00:00:00:00:00" qos: 0 state_on: "on" state_off: "off" payload_on: "open" payload_off: "close" retain: false optimistic: false
- Get information from the Shade (battery, state, etc…), currently it’s just sending command, for open and close.
- ESP32 version - Would prefer to run this in a ESP32 instead of a Raspberry PI
- Since I can’t get information on current state and home assistant start with Off, if the shade is Open (On) you need to rapidly click the button twice to make it close and sync the state.