Teletask-api
An open source java JSON REST API for Teletask domotics.
It is the purpose to generate a REST API for software developers or domotics enthusiasts, who are interested in generating their own control environment for the TELETASK domotics systems, so you can create your own user interface and connected solutions and services.
If you own a Teletask MICROS (note: not the latest MICROS+), you have access to the free DLL32 LIBRARY (TDS15132). However, if you're a java programmer like myself, you don't want to use a windows dll :-) The API also supports the MICROS+, but you'll have to buy a licence to be able to make TCP calls. Bought me a RS232 > LAN converter (TDS10118) so I could access my MICROS server through regular IP.
Started discussing the possibilities on the Teletask forum: http://www.teletask.be/forum/default.aspx?g=posts&t=195 ...and ended up programming a java interface based on IP Sockets, exposed by a basic JSON REST service.
Initially only setting and getting RELAYS, MTRUPDOWN, GENMOOD, LOCMOOD, COND, FLAG is supported.
Added a basic HTML 5 GUI for access on a mobile device. Fastest implementation proved to be jQuery Mobile (at the time of creation).
However I highly recommend using Home Assistant: https://home-assistant.io
Currently the API uses an internal MQTT broker, but support for an external broker will be added to bridge with Home Assistant.
You can however already use the REST interface to make calls from Home Assistant to the TeleTask server.
How this API works:
- Build the war file using maven (
mvn clean package
). - Your Teletask config is read from the tds-config.json file. This file holds all info on your personal setup. An example config can be downloaded from here. Create one which corresponds to your setup, and store it accessible to the app server.
- Deploy the war to a java app server on a device on your local network, so it has access to your MICROS server. I used a low power Raspberry PI
- Add these VM parameters to your java app server:
JAVA_OPTS="$JAVA_OPTS -DconfigFile=/home/pi/teletask/tds-config.json"
JAVA_OPTS="$JAVA_OPTS -Dlogfile=/home/pi/teletask/teletask.log"
Libraries / Technologies
- Maven 3
- JBoss RESTEasy
- Jackson JSON processor
- jQuery Mobile
- ...
REST API
Base URL API
http://<host>:<port>/teletask/api
Config
- URI: GET
<base_url>/component/config
- Description: Gets the complete configuration in JSON.
Relay
- URI: GET
<base_url>/component/state/relay/{number}
- Description: Gets the relay state. Returns 0 for off, 1 for on.
- URI: PUT
<base_url>/component/relay/{number}/state/{on/off}
- Description: Switches the relay on/off.
- Description: Switches the relay on/off.
Local Mood
- URI: GET
<base_url>/component/state/mood/local/{number}
- Description: Gets the mood state. Returns 0 for off, 1 for on.
- URI: PUT
<base_url>/mood/local/{number}/state/{on/off}
- Description: Switches the mood on/off.
- Description: Switches the mood on/off.
General Mood
- URI: GET
<base_url>/component/state/mood/general/{number}
- Description: Gets the mood state. Returns 0 for off, 1 for on.
- URI: PUT
<base_url>/mood/general/{number}/state/{on/off}
- Description: Switches the mood on/off.
- Description: Switches the mood on/off.
Motor
- URI: GET
<base_url>/component/state/motor/{number}
- Description: Gets the motor state. 1 for down, 0 for up.
- URI: PUT
<base_url>/motor/{number}/state/{down/up}
- Description: Switches the motor up or down. ### Roadmap:
Current status: fully working REST API & UI.
Future release:
Support all micros features (dimming, check flags, conditions...)Add iBeacon support: this way I can use presence detection and switch relays depending on being close to a beacon.Add support for an iTach Flex device so I can control additional devices through IR (airco units, projector, tv, ...).A more advanced HTML 5 GUI for access on a mobile device (possibly using Twitter Bootstrap, Sencha Touch, ...).
All of these features, and a lot lot lot more are available on Home Assistant, so only concentrating on core Teletask features, and better integration with IoT, improving MQTT support.