Guide: Script execution from signals

Moderators: tom_rosenback, Daniel, Telldus

Posts: 778
Joined: Thu Jan 18, 2018 11:08 am

Guide: Script execution from signals

Post by tom_rosenback » Thu Jan 18, 2018 11:08 am

Many people have asked how they can make for example a door sensor to trigger a device in HA, so now I thought it would be a good time to create a small guide for it. Daniel wrote a short guide inside a topic earlier so I just lifted it out into own topic to make it easier to find.
Daniel wrote:
Telldus script execution: ... om-signals

In short, just put an executable script in /usr/local/share/telldus/scripts/deviceevent and it will be executed every time any device changes status. I have got one that does this:

Code: Select all


echo "--------------------------------------" >> /tmp/tdlog.log
date +"%d %b %T" >> /tmp/tdlog.log
echo "deviceevent" >> /tmp/tdlog.log

echo "Device: ${DEVICEID}" >> /tmp/tdlog.log
echo "Method: ${METHOD}" >> /tmp/tdlog.log

case ${METHOD} in

echo "Status: ${status}" >> /tmp/tdlog.log


wget -qO- "${url}" &> /dev/null
...which changes status of the devices in HomeAutomation.

There is also other API methods available in HA so if there is something else (eg run a macro) you want to do based on a event just look in the API folder if there is a method for it available.

Senaste info och release om/av HomeAutomation hittas här
Latest info and release of HomeAutomation can be found here