Skip to content

A simple API in front of the TellStick tdtool written in Go (List and turn devices on/off)

Notifications You must be signed in to change notification settings

peterhellberg/go-tdtool-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

go-tdtool-api

A simple API in front of the TellStick tdtool. (Written in Go)

tdtool

The tdtool binary is installed when installing the TelldusCenter.

You can also find it in the telldus-core package. (You probably don’t need to install the GUI)

TellStick

You will also need one of these:

TellStick

And probably one or two controllable devices. (I’ve got the Nexa PB-3)

Running in the background

nohup ./tdtool-api &

This will try to start a web server on port 8080

Using the API

Listing available devices

curl http://localhost:8080/

This should output something along these lines:

Number of devices: 4
1    Lights          ON
3    Hörnlampa       ON
2    Skrivbordslampa OFF
4    Sovrumslampa    ON

Turning a device ON

curl -X PUT http://localhost:8080/2/on

This should output:

Turning on device 2, Skrivbordslampa - Success

Turning a device OFF

curl -X PUT http://localhost:8080/4/off

This should output:

Turning off device 4, Sovrumslampa - Success

Sync calls

You can also make synchronous requests by adding /sync to the end of the path:

curl -X PUT http://localhost:8080/3/off/sync

About

A simple API in front of the TellStick tdtool written in Go (List and turn devices on/off)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages