dtgbot - Domoticz TeleGram BOT
Moderator: leecollings
-
- Posts: 336
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
dtgbot is rarely reliable in my experience.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
..
A bit of a blunt statement don't you think?
I am running it for years and it is rock solid given you take all required precautions.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 531
- Joined: Saturday 02 June 2018 11:05
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.1
- Location: Echt, Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I installed it last year.
My wife and me are verder happy with it. Works like a dream.
We like it, because no network setting modification are needed, to give commands to domoticz when we are away from home.
My wife and me are verder happy with it. Works like a dream.
We like it, because no network setting modification are needed, to give commands to domoticz when we are away from home.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
-
- Posts: 336
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I find the service frequently hangs but yes, perhaps a little harsh.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
That simply means you didn't implement the monit option as that should take care of any hangs. It is a known fact that the long poll can hang for the http addin used, hence the monit check. It only hangs when you have some internet quality issues.
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 336
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
That's another way of putting it. Monit saves the day.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Whatever makes you feel like you are right....
I can't remember the last time Monit was needed to restart DTGBOT for my installation and that must be more than a year ago..... but moving on as its clear what your opinion is.
I can't remember the last time Monit was needed to restart DTGBOT for my installation and that must be more than a year ago..... but moving on as its clear what your opinion is.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
this error appears in dtb.log.errors
i tried this way but i think the link is dead
Code: Select all
/usr/bin/lua5.2: error loading module 'ssl.core' from file '/usr/local/lib/lua/5.2/ssl.so':
libssl.so.1.0.0: cannot open shared object file: No such file or directory
stack traceback:
[C]: in ?
[C]: in function 'require'
/usr/local/share/lua/5.2/ssl.lua:7: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.2/ssl/https.lua:10: in main chunk
[C]: in function 'require'
/home/pi/dtgbot/dtgbot.lua:132: in main chunk
[C]: in ?
i tried this way but i think the link is dead
Marcello1970 wrote: ↑Thursday 28 February 2019 12:34
Edit the sources.listadd the next line:Code: Select all
sudo nano /etc/apt/sources.list
this linkthis linkCode: Select all
deb http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
Save it with CTRL + X , Y
and then:Then the bot works!Code: Select all
sudo apt-get update sudo apt-get install libssl1.0.0
Thanks to:
https://diyprojects.io/domoticz-install ... HfCKOhKgdW
Code: Select all
pi@raspberrypi2:~ $ apt list libssl*
Listing... Done
libssl-dev/oldstable,now 1.1.1d-0+deb10u7 armhf [installed]
libssl-doc/oldstable 1.1.1d-0+deb10u7 all
libssl-ocaml-dev/oldstable 0.5.5-1 armhf
libssl-ocaml/oldstable 0.5.5-1 armhf
libssl-utils-clojure/oldstable 0.8.3-2 all
libssl1.0-dev/oldstable 1.0.2q-2 armhf
libssl1.0.2/oldstable,now 1.0.2q-2 armhf [installed,automatic]
libssl1.1-dbgsym/oldstable 1.1.1d-0+deb10u6+rpt1 armhf
libssl1.1/oldstable,now 1.1.1d-0+deb10u7 armhf [installed]
pi@raspberrypi2:~ $
-
- Posts: 531
- Joined: Saturday 02 June 2018 11:05
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.1
- Location: Echt, Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I had the same problem last month.
Solved it with this
You are trying to get something out of the jessie archive. But that doesn't exist anymore. Therefor the error.
Solved it with this
You are trying to get something out of the jessie archive. But that doesn't exist anymore. Therefor the error.
Code: Select all
wget http://ftp.nl.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb
sudo reboot
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Thanks a lot, it works great nowhoeby wrote: ↑Monday 20 December 2021 18:22 I had the same problem last month.
Solved it with this
You are trying to get something out of the jessie archive. But that doesn't exist anymore. Therefor the error.
Code: Select all
wget http://ftp.nl.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb sudo reboot
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
another question, how to turn on a switch that is password protected
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
How are you trying to switch this switch? Via a bash or LUA script using a JSON call to domoticz or the MENU?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
As this requires a JSON call with the extra password field, can only see this working via a Bash or LUA command files that performs that action and the command yourself in the dtgmenu.cfg.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Just create a script for ON and one for OFF .... something like:
and save it to /dtgbot/bash with the name pswitchon.sh.
do the same for pswitchoff.sh.
Set the x attribute (chmod +x pswitch*.sh)
Modify dtgmenu.cfg and add this command to an menu item .... eg:
Restart DTGBOT and you should be in business... (all untested
)
... but to be honest: aren't you defeating the purpose of making it a password protected switch when you automate it in this way?
Code: Select all
#!/bin/sh
curl 'https://yourdomoticzip:port/json.htm?type=command¶m=switchlight&idx=IDX-oftheSwitch&switchcmd=On&passcode=YOUR_SWITCH_PASSWORD_AS_SET_IN_SETTINGS'
do the same for pswitchoff.sh.
Set the x attribute (chmod +x pswitch*.sh)
Modify dtgmenu.cfg and add this command to an menu item .... eg:
Code: Select all
static_dtgmenu_submenus = {
["pSwitch"] = {whitelist="",showdevstatus="n",Menuwidth=3,
buttons={
["pswitchon"] = {whitelist=""},
["pswitchoff"] = {whitelist=""},
}
},
}

... but to be honest: aren't you defeating the purpose of making it a password protected switch when you automate it in this way?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
you are right, the switch is password protected only to prevent accidental pressing, it may be possible to ask whether to execute that command, only for certain switches
-
- Posts: 531
- Joined: Saturday 02 June 2018 11:05
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.1
- Location: Echt, Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
satanasinc wrote: ↑Tuesday 13 March 2018 16:53 Hi!
First of all excuse my bad english. I do my best.
Ive got a RPi working with the telegram bot and domoticz control but my instalation is very old running ver rapsbian wheezy. So i do a fresh install in a new SD with raspbian stretch and the domoticz telegram bot control dont works.
I cant find where is the problem because dont recive answer from domoticz but the notification works perfect.
The /var/tmp/dtb.log apears to be correct...
2018-03-13 14:52:01 - DomoticzIP: 127.0.0.1
2018-03-13 14:52:01 - DomoticzPort: 8080
2018-03-13 14:52:01 - BotHomePath: /home/pi/dtgbot/
2018-03-13 14:52:01 - TempFileDir: /var/tmp/
2018-03-13 14:52:01 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-03-13 14:52:01 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-03-13 14:52:01 - TelegramBotToken: 524####64:AAFZUOtHs_tvJ_F6c06GYpkt6$$$$$$$$$$$$
2018-03-13 14:52:01 - TelegramBotOffset: TelegramBotOffset
2018-03-13 14:52:01 - -----------------------------------------
2018-03-13 14:52:01 - Starting Telegram api Bot message handler
2018-03-13 14:52:01 - -----------------------------------------
In /var/tmp/dtb.log.error i got this...
Illegal instruction
My /etc/profile.d/DomoticzData.sh#I can't get the next line to work during start-up so have gone to 127 instead
#export DomoticzIP=$(hostname -I|sed 's/[ ]*$//')
export DomoticzIP="127.0.0.1"
export DomoticzPort="8080"
export TempFileDir="/var/tmp/"
export BotHomePath="/home/pi/dtgbot/"
export BotBashScriptPath=$BotHomePath"bash/"
export BotLuaScriptPath=$BotHomePath"lua/"
export BotLuaLog=$TempFileDir"dtb.log"
export TelegramChatId='34####63#
export TelegramBotToken="524####64:AAFZUOtHs_tvJ_F6c06GYpkt6$$$$$$$$$$$$"
export TelegramBotOffset="TelegramBotOffset"
export EmailTo="alt$$$$$[email protected]"
I have started the installation a couple of times wthout luck following the domoticz wiki.
Any idea? What can i do to make it work?
Thanx in advance for your help.
Regards
The link on the similar issue isn't working anymore, any idea where the link was transfered to?jvdz wrote: ↑Tuesday 13 March 2018 18:36 The issue seems to lie in these lines so guess the best bet will be an issue with the require files:Could the issue be similar to issues reported like this one?: http://www.domoticz.com/forum/viewtopic ... on#p171940Code: Select all
-- Load necessary Lua libraries http = require "socket.http"; socket = require "socket"; https = require "ssl.https"; JSON = require "JSON"; function file_exists(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end -- Load the configuration file this file contains the list of commands -- used to define the external files with the command function to load. local config="" if (file_exists(BotHomePath.."dtgbot-user.cfg")) then config = assert(loadfile(BotHomePath.."dtgbot-user.cfg"))(); print_to_log ("Using DTGBOT config file:"..BotHomePath.."dtgbot-user.cfg") else config = assert(loadfile(BotHomePath.."dtgbot.cfg"))(); print_to_log ("Using DTGBOT config file:"..BotHomePath.."dtgbot.cfg") end
Jos
Trying to install it on a pi zero. Get the same error as reported on page 15
why a pi zero, have this lying around and trying to test something
Code: Select all
2021-12-22 18:49:21 - -----------------------------------------
2021-12-22 18:49:21 - Starting Telegram api Bot message handler
2021-12-22 18:49:21 - -----------------------------------------
Illegal instruction
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
How to see the value of a sensor from the utility section. via a telegram command
devices - gives me the complete list
for example
info 22 - to show me the quantity in the water tank
devices - gives me the complete list
for example
info 22 - to show me the quantity in the water tank
- jvdz
- Posts: 2269
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
You can make your own bash (sh) script or LUA script to provide the correct answer or use the Menu structure to display the values of devices.
Just look at the examples provided.
Just look at the examples provided.

New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest