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

https://github.com/grantlemons/light-control

Code to mess around with my smartthings connected lights utilizing the pysmartthings library.
https://github.com/grantlemons/light-control

python39 smartthings smartthings-api

Last synced: about 1 year ago
JSON representation

Code to mess around with my smartthings connected lights utilizing the pysmartthings library.

Awesome Lists containing this project

README

          

# This is python code to mess around with my lights

In order to use it, the first thing one needs to do is [get a smartthings personal access token](https://account.smartthings.com/tokens).
Secondly, one must copy the [.env.example](./.env.example) file into a [.env file](./.env).
Copy your token and put it in your .env file (example can be found [here](./.env.example).)

## Running it
To get it working, go into [LightControl.py](./LightControl.py), and run the program.
This will give an output of all devices and their states. Find your desired device and add it to your [.env file](./.env) as the value for `DEVICE_NAME`.

Comment the line `loop.run_until_complete( listDevices() )` and uncomment the line `#weirdRandomLights(my_lights_object, device_name)`

Run the program again and it should turn on and off the device specified in a semi-random manner.