https://github.com/martendebruijn/stevie-the-tv
Control Stevie the TV
https://github.com/martendebruijn/stevie-the-tv
python samsung smart-tv smartthings
Last synced: 3 months ago
JSON representation
Control Stevie the TV
- Host: GitHub
- URL: https://github.com/martendebruijn/stevie-the-tv
- Owner: martendebruijn
- License: mit
- Created: 2024-10-23T19:11:01.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-28T23:42:32.000Z (7 months ago)
- Last Synced: 2024-11-13T13:58:17.753Z (6 months ago)
- Topics: python, samsung, smart-tv, smartthings
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stevie-the-tv
Control Stevie the TV

- [stevie-the-tv](#stevie-the-tv)
- [Install](#install)
- [Usage](#usage)
- [Switch](#switch)
- [Turn Stevie ON](#turn-stevie-on)
- [Successful response](#successful-response)
- [Unsuccessful response](#unsuccessful-response)
- [Turn Stevie OFF](#turn-stevie-off)
- [Successful response](#successful-response-1)
- [Unsuccessful response](#unsuccessful-response-1)
- [Audio volume](#audio-volume)
- [Successful response](#successful-response-2)
- [Unsuccessful response](#unsuccessful-response-2)
- [References](#references)## Install
1. Register with Samsung SmartThings and obtain an API key.
2. Retrieve the device ID:```sh
curl -X GET "https://api.smartthings.com/v1/devices" \
-H "Authorization: Bearer "
```3. Create a .env file and set the environment variables:
```sh
cp src/.env.example src/.env
```4. Install the `requests` module and the `python-dotenv` module for Python:
```sh
pip install requests
pip install python-dotenv
```## Usage
### Switch
Turn Stevie on or off.
- **Flag**: `--turn`
- **Options**: `on`, `off`#### Turn Stevie ON
```sh
python src/stevie.py --turn on
```Responses
##### Successful response
```sh
Stevie is turned on!
```##### Unsuccessful response
```sh
Error sending command:
```#### Turn Stevie OFF
```sh
python src/stevie.py --turn off
```Responses
##### Successful response
```sh
Stevie is turned off!
```##### Unsuccessful response
```sh
Error sending command:
```### Audio volume
Change how loud Stevie is.
- **Flag**: `--volume`
- **Options**: integer `0-100````sh
python src/stevie.py --volume int[0...100]
```Responses
#### Successful response
```sh
Stevie's volume is set to {volume}!
```#### Unsuccessful response
```sh
Error sending command:
```## References
- [SmartThings API](https://developer.smartthings.com/docs/api/public)
- [Capabilities reference](https://developer.smartthings.com/docs/devices/capabilities/capabilities-reference)