An open API service indexing awesome lists of open source software.

https://github.com/sinricpro/micropython-sinricpro-sdk

Micropython SinricPro SDK
https://github.com/sinricpro/micropython-sinricpro-sdk

Last synced: 8 months ago
JSON representation

Micropython SinricPro SDK

Awesome Lists containing this project

README

          

# Micropython-SinricPro SDK

[![Discord](https://img.shields.io/badge/discord-%23micropython-blue.svg)](https://discord.gg/rq9vcRcSqA)

The simple way to control your MicroPython board with Amazon Alexa, Google Home, SmartThings, Homebridge and Node-RED.

Tutorials:

- ##### [How to turn on and off a Relay (ESP32)](https://help.sinric.pro/pages/tutorials/switch/micropython/how-to-turn-on-and-off-a-relay-using-micropython.html)

### Which device types are working as of now?

|Device Type |Supported ? | Example
|--- |--- |---
| `Switch` |

  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/switch)
| `Blinds` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/blinds)
| `Dimmable Switch` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/dim-switch)
| `Fan` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/dim-switch)
| `Garage Door` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/fan)
| `Light` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/light)
| `Lock` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/lock)
| `Thermostat` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/thermostat)
| `TV` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/tv)
| `AC Unit` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/ac-unit)
| `Temperature Sensor` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/temperature_sensor)
| `Motion Sensor` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/motion-sensor)
| `Contact Sensor` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/contact-sensor)
| `Speaker` |
  • - [x] Completed
| [here](https://github.com/sinricpro/micropython-sinricpro-sdk/tree/main/examples/speaker)
| `Custom Device Types` | Pending | -

### How do I install it?

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 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

## How can I use it?

Checkout the examples directory.

### Will it run on Microcontroller X?

Tested on

1. MicroPython v1.21.0 on 2023-10-05; Generic ESP32 module with ESP32

2. MicroPython v1.21.0 on 2023-10-06; Raspberry Pi Pico W with RP2040

### For development using PyMakr:

1. Install Micropython (https://docs.micropython.org/en/latest/esp32/tutorial/intro.html)
2. Install PyMakr in VSCode
3. VSCode -> Open Workspace from File -> micropython-sinricpro-sdk.code-workspace
4. Create a new file called main.py to code.
5. Connect to ESP32 in PyMakr -> Upload -> Hardreset device.
6. Please use Pylint for formatting (https://marketplace.visualstudio.com/items?itemName=ms-python.pylint)

### To remove the library manually:

```
import mip
mip.install("shutil")
import shutil
shutil.rmtree("/lib/sinricpro")
```

### To list files in ESP32 or PICOW
```
import os
def listdir(dir):
for i in os.listdir(dir):
print('{}/{}'.format(dir,i))

listdir("/")
```

## Join the community!
Join us on our [Official Discord Server](https://discord.gg/rq9vcRcSqA)!