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.
- Host: GitHub
- URL: https://github.com/grantlemons/light-control
- Owner: grantlemons
- Created: 2021-04-24T21:02:55.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-02-07T04:52:04.000Z (about 4 years ago)
- Last Synced: 2025-01-15T11:25:18.108Z (about 1 year ago)
- Topics: python39, smartthings, smartthings-api
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.