3
var String commands = "/office_light"
5
// See UID of Telegram Thing
6
val telegramAction = getActions("telegram","telegram:telegramBot:df22be725f")
8
if (receivedEvent != null) {
9
text = transform("JSONPATH", "$.text", receivedEvent.toString)
10
// from = transform("JSONPATH", "$.from", receivedEvent.toString)
13
switch (text.toLowerCase) {
14
case "/office_light": {
15
var status=callScript ("switch_office_light");
17
// Replying to other bot is impossible
18
telegramAction.sendTelegram("OK. Switching " + status);
19
} catch (Exception e) {
20
logInfo("telegram_parser", "Executed command: " + text);
25
// Replying to other bot is impossible
26
telegramAction.sendTelegram("Unknown command: " + text + ", try: " + commands);
27
} catch (Exception e) {
28
logInfo("telegram_parser", "Unknown command: " + text);