Telegram - Setting Up Remote Control - Foundations

From Domoticz
Jump to navigation Jump to search

If you have followed the instructions on Installing Telegram Notification System page then you are halfway to having remote control.

The first thing needed is to install jq:

# Old link? : wget http://stedolan.github.io/jq/download/source/jq-1.4.tar.gz
wget https://github.com/stedolan/jq/releases/download/jq-1.4/jq-1.4.tar.gz
tar -zxvf jq-1.4.tar.gz
rm jq-1.4.tar.gz
cd jq-1.4
./configure
make
sudo make install

Now you can reboot your Pi.

Then from your remote telegram system (i.e. telegram on your phone) test your system works by getting a list of the remote control available:

help

Some of the remote control is from Bash scripts that return information or just return smilies:

smiliesoverview - returns a series of smilies
systemstatus - returns the system status once configured
temperature - returns temperatures once configured

And some of the remote control is from Lua functions:

On - On devicename turns a device / group / scene on i.e. On Study - you need to keep the correct capitalisation
Off - Off devicename turns a device / group off i.e. Off House Lights - turns off all your house lights if there is a group House Lights
Battery - Battery devicename returns the level of a battery - only sensible if the device has a battery
Smiliesoverview - returns a series of smilies
Systemstatus - returns the system status once configured
Temperature - returns temperatures once configured

The commands as typed into the Telegram client are single words, followed by parameters, where the first parameter is normally the name of the device, group or scene involved.

More to follow .....

Then it is easy to create some specific Lua functions based on the information on the this wiki - Telegram - Setting Up Remote Control - Lua Functions.

There are lots of Bash scripts on the Wiki which can be linked into Telegram - Telegram - Setting Up Remote Control - Bash Scripts.