The simple way to control your MicroPython board with Amazon Alexa, Google Home, SmartThings, Homebridge and Node-RED.
Tutorials:
Device Type | Supported ? | Example |
---|---|---|
Switch |
|
here |
Blinds |
|
here |
Dimmable Switch |
|
here |
Fan |
|
here |
Garage Door |
|
here |
Light |
|
here |
Lock |
|
here |
Thermostat |
|
here |
TV |
|
here |
AC Unit |
|
here |
Temperature Sensor |
|
here |
Motion Sensor |
|
here |
Contact Sensor |
|
here |
Speaker |
|
here |
Custom Device Types |
Pending | - |
Using mpremote: (pip install --user mpremote)
make sure device is not connected to IDE
mpremote mip install github:sinricpro/micropython-sinricpro-sdk
or
py -m mpremote connect <COM_PORT> mip install github:sinricpro/micropython-sinricpro-sdk
Using mip (in REPL):
import mip
mip.install("github:sinricpro/micropython-sinricpro-sdk")
SinrciPro library will be installed in the /lib folder. You can manually copy the sinricpro
folder to /lib as well
Checkout the examples directory.
Tested on
-
MicroPython v1.21.0 on 2023-10-05; Generic ESP32 module with ESP32
-
MicroPython v1.21.0 on 2023-10-06; Raspberry Pi Pico W with RP2040
- Install Micropython (https://docs.micropython.org/en/latest/esp32/tutorial/intro.html)
- Install PyMakr in VSCode
- VSCode -> Open Workspace from File -> micropython-sinricpro-sdk.code-workspace
- Create a new file called main.py to code.
- Connect to ESP32 in PyMakr -> Upload -> Hardreset device.
- Please use Pylint for formatting (https://marketplace.visualstudio.com/items?itemName=ms-python.pylint)
import mip
mip.install("shutil")
import shutil
shutil.rmtree("/lib/sinricpro")
import os
def listdir(dir):
for i in os.listdir(dir):
print('{}/{}'.format(dir,i))
listdir("/")
Join us on our Official Discord Server!