Page 16 of 30
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 03 August 2018 13:06
by hansies
Any change to got this working with channels?
Dtgbot is working perfect and love to use it. For now I want to go a step further so my 'TaskerBot' can talk to my 'DomoticzBot'. As bots can talk to eachother in private, the only way they can talk to eachother is in a channel.
So now I got a channel with me and my two bots. The thing is that dtgbot should understand the specific code from the channel.
If this will work than I can build my own geofence task working without having to open a port on my router of enable my VPN.
The reponse from a message and a channel is pretty the same, but I don't know anything about the dtgbot code.
Channel
Code: Select all
{
"update_id":602971###,
"channel_post":{
"message_id":5,
"author_signature":"#",
"chat":{
"id":-100##########,
"title":"#",
"username":"#",
"type":"channel"
},
"date":1533288546,
"text":"Test"
}
}
Message
Code: Select all
{
"update_id":684538###,
"message":{
"message_id":118,
"from":{
"id":#########,
"is_bot":false,
"first_name":"#",
"username":"#",
"language_code":"en-us"
},
"chat":{
"id":#########,
"first_name":"#",
"username":"#",
"type":"private"
},
"date":1533290530,
"text":"Hi"
}
)
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 03 August 2018 14:53
by jvdz
I will have a look at this as that shouldn't be too hard to add. (His famous last words

)
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 05 August 2018 14:01
by jvdz
hansies wrote: ↑Friday 03 August 2018 13:06
Any change to got this working with channels?
I 've pushed an update to the github repository for both the "master" branch, using the keyboard menus as the "Menu_Inline" branch to support channel messages.
I've found out that channels do not support keyboard menus, so DTGMENU will be disabled in the "Master" branch version when messages are received from the channel. The inline version works fine as far as I can tell.
Let me know when there are questions or issues.
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 28 October 2018 0:10
by Slayer007
Hi there,
Maybe someone can help me out. I've been using Telegram Bot for the past 3 years or so. I'm still using it and it is working like a charm.
Now I have bought myself a new RPI, starting from scratch. The other RPI is still online and still working with Telegram.
Now I've tried to install Telegram, but I can't get dtgbot to start/work. (It is by the way the same bot as the other RPI.)
I don't get any log errors, so something must go right
I think the problem is in this:
Code: Select all
2018-10-27 23:57:23 - Getting TelegramBotOffset the previous Telegram bot message offset from Domoticz
2018-10-27 23:57:23 - TelegramBotOffset user variable does not exist in Domoticz so can not continue
This is from domoticz
Code: Select all
2 TelegramBotMenu String On
1 TelegramBotOffset Integer 1
I can send messages to my bot, but my bot is not responding. I also exited the dtgbot from my old RPI, maybe that conflicted.
I started the uservariable TBO with +1, that didn't work. I also started with the last update_id +1 from my old RPI, but this alos didn't work.
I used my old dtgbot.lua and I also used the new dtgbot.lua.
Does anyone has an idea what is going wrong?
Thnx!
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 28 October 2018 10:27
by jvdz
You need to set the UserVariable TelegramBotOffset on the new System to the same value as the old system as that is the message sequencenumber for the received commands it is try to read. You probably can't use the both at the same time, but it should work when the old system's dtgbot is stopped.!
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 28 October 2018 11:50
by Slayer007
jvdz wrote: ↑Sunday 28 October 2018 10:27
You need to set the UserVariable TelegramBotOffset on the new System to the same value as the old system as that is the message sequencenumber for the received commands it is try to read. You probably can't use the both at the same time, but it should work when the old system's dtgbot is stopped.!
Jos
Hi Jos,
Sadly is doesn't work. I've stopped my dtgbot on my old RPI. Waited a couple of minutes. Then checked the TBO from the old one and filled it in by the new one. After that I started dtgbot on my new RPI and the log is still saying that the user variable doesn't exist...

Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 28 October 2018 11:58
by jvdz
So that would mean it can't connect to the domoticz server to retrieve the variable.
Are you sure the serversettings are done correctly?
Are you user Userid/Password for access to domoticz?
Could you show the whole dtgbot.log so I can have a look to see if that looks correct? ( you can also PM in case you don't want to post it in open forum)
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 30 October 2018 20:16
by EldigoR
hansies wrote: ↑Thursday 02 August 2018 20:51
G3rard wrote: ↑Saturday 13 May 2017 10:49
maomanna wrote:How did you compile the lua libraries?
In the OP is a 32bit version supplied.
I did the following steps to make dtgbot working on my Ubuntu server 14.04 x64.
I can confirm this is working on Ubuntu 16.04 64bit on my NUC with VirtualBox!
I Also confirm it working on Ubuntu server LTS 18.04 .
Also attachted the needed files.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 11:32
by nosehook
Hi, I have some issues getting the bot working with Domoticz.
The error log states:
Code: Select all
2018-11-21 11:04:07 - DomoticzIP: 192.168.0.115
2018-11-21 11:04:07 - DomoticzPort: 8080
2018-11-21 11:04:07 - BotHomePath: /home/pi/dtgbot/
2018-11-21 11:04:07 - TempFileDir: /var/tmp/
2018-11-21 11:04:07 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-11-21 11:04:07 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-11-21 11:04:07 - TelegramBotToken: correct token
2018-11-21 11:04:07 - TelegramBotOffset: TelegramBotOffset
2018-11-21 11:04:07 - -----------------------------------------
2018-11-21 11:04:07 - Starting Telegram api Bot message handler
2018-11-21 11:04:07 - -----------------------------------------
when I do
I get:
Code: Select all
2018-11-21 11:27:49 - DomoticzIP: 192.168.0.115
2018-11-21 11:27:49 - DomoticzPort: 8080
2018-11-21 11:27:49 - BotHomePath: /home/pi/dtgbot/
2018-11-21 11:27:49 - TempFileDir: /var/tmp/
2018-11-21 11:27:49 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-11-21 11:27:49 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-11-21 11:27:49 - TelegramBotToken: correct token
2018-11-21 11:27:49 - TelegramBotOffset: TelegramBotOffset
2018-11-21 11:27:49 - -----------------------------------------
2018-11-21 11:27:49 - Starting Telegram api Bot message handler
2018-11-21 11:27:49 - -----------------------------------------
lua: /usr/local/share/lua/5.2/socket.lua:12: module 'socket.core' not found:
no field package.preload['socket.core']
no file '/usr/local/share/lua/5.2/socket/core.lua'
no file '/usr/local/share/lua/5.2/socket/core/init.lua'
no file '/usr/local/lib/lua/5.2/socket/core.lua'
no file '/usr/local/lib/lua/5.2/socket/core/init.lua'
no file '/usr/share/lua/5.2/socket/core.lua'
no file '/usr/share/lua/5.2/socket/core/init.lua'
no file './socket/core.lua'
no file '/usr/local/lib/lua/5.2/socket/core.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/socket/core.so'
no file '/usr/lib/lua/5.2/socket/core.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket/core.so'
no file '/usr/local/lib/lua/5.2/socket.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/socket.so'
no file '/usr/lib/lua/5.2/socket.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket.so'
stack traceback:
[C]: in function 'require'
/usr/local/share/lua/5.2/socket.lua:12: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.2/socket/http.lua:10: in main chunk
[C]: in function 'require'
dtgbot.lua:114: in main chunk
[C]: in ?
When I do
I get
Code: Select all
dtgbot.service - LSB: A Telegram bot designed to control Domoticz
Loaded: loaded (/etc/init.d/dtgbot; generated; vendor preset: enabled)
Active: active (exited) since Wed 2018-11-21 11:04:07 CET; 25min ago
Docs: man:systemd-sysv-generator(8)
Process: 352 ExecStart=/etc/init.d/dtgbot start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/dtgbot.service
Nov 21 11:04:06 raspberrypi systemd[1]: Starting LSB: A Telegram bot designed to control Domoticz...
Nov 21 11:04:07 raspberrypi dtgbot[352]: Starting Telegram Bot for Domoticz ... Done.
Nov 21 11:04:07 raspberrypi systemd[1]: Started LSB: A Telegram bot designed to control Domoticz.
When I send messages via Telegram I get no response
Could someone please tell me how to fix things?
Kind regards,
Freek
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 19:03
by jvdz
It looks like you missed the part to install the LUA libraries in the Wiki:
https://www.domoticz.com/wiki/Remote_Co ... _Libraries
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 20:48
by nosehook
Hi Jos,
Thanks for the tip.
I remember doing this, something must have gone wrong.
I have installed the Lua part. Now when I check I get this:
Code: Select all
2018-11-21 20:43:08 - DomoticzIP: 192.168.0.115
2018-11-21 20:43:08 - DomoticzPort: 8080
2018-11-21 20:43:08 - BotHomePath: /home/pi/dtgbot/
2018-11-21 20:43:08 - TempFileDir: /var/tmp/
2018-11-21 20:43:08 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-11-21 20:43:08 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-11-21 20:43:08 - TelegramBotToken: Token
2018-11-21 20:43:08 - TelegramBotOffset: TelegramBotOffset
2018-11-21 20:43:08 - -----------------------------------------
2018-11-21 20:43:08 - Starting Telegram api Bot message handler
2018-11-21 20:43:08 - -----------------------------------------
lua: 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 directo ry
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'
dtgbot.lua:116: in main chunk
[C]: in ?
when I type help in telegram I get no response or anything.
any tips to help me out?
Kind regards,
Freek
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 20:53
by jvdz
The second part of the linked topic should have extracted the files in that folder.
Did you check which files are present in /usr/local/lib/lua/5.2/ ?
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 20:59
by nosehook
Yes,
In /usr/local/lib/lua/5.2 There are present:
mime socket ssl.so
In cd /usr/local/share/lua/5.2/ there are present:
ansicolors.lua JSON.lua ltn12.lua luacolors.lua mime mime.lua mobdebug.lua socket socket.lua ssl ssl.lua ssl.so
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 21:12
by jvdz
So the file seems to be there. Could you show me the result of these commands ran on the PI itself? :
ls -l /usr/local/lib/lua/5.2
ls -l /usr/local/share/lua/5.2/
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 21:16
by nosehook
Ofcourse!
First entry:
total 68
drwxr-sr-x 2 root staff 4096 Sep 25 2014 mime
drwxr-sr-x 2 root staff 4096 Sep 7 2014 socket
-rwxr-xr-x 1 root root 61293 Jul 5 2015 ssl.so
Second entry:
-rw-r--r-- 1 root staff 2184 Oct 25 2013 ansicolors.lua
-rw-r--r-- 1 root staff 34843 May 28 2015 JSON.lua
-rw-r--r-- 1 root staff 8331 Sep 25 2014 ltn12.lua
-rw-r--r-- 1 root staff 4812 Sep 25 2014 luacolors.lua
drwxr-sr-x 2 root staff 4096 Sep 25 2014 mime
-rw-r--r-- 1 root staff 2487 Sep 25 2014 mime.lua
-rw-r--r-- 1 root staff 62698 Sep 7 2014 mobdebug.lua
drwxr-sr-x 2 root staff 4096 Sep 25 2014 socket
-rw-r--r-- 1 root staff 5011 Sep 7 2014 socket.lua
drwxr-xr-x 2 root staff 4096 Jul 5 2015 ssl
-rw-r--r-- 1 root staff 4663 Jul 5 2015 ssl.lua
-rwxr-xr-x 1 root root 61293 Jul 5 2015 ssl.so
Thanks for helping out,
Freek
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 21:35
by nosehook
I tried:
sudo wget
http://ftp.nl.debian.org/debian/pool/main/o/openssl /libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb
and
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_armhf.deb
now I get:
2018-11-21 21:34:02 - DomoticzIP: 192.168.0.115
2018-11-21 21:34:02 - DomoticzPort: 8080
2018-11-21 21:34:02 - BotHomePath: /home/pi/dtgbot/
2018-11-21 21:34:02 - TempFileDir: /var/tmp/
2018-11-21 21:34:02 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-11-21 21:34:02 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-11-21 21:34:02 - TelegramBotToken: token
2018-11-21 21:34:02 - TelegramBotOffset: TelegramBotOffset
2018-11-21 21:34:02 - -----------------------------------------
2018-11-21 21:34:02 - Starting Telegram api Bot message handler
2018-11-21 21:34:02 - -----------------------------------------
Illegal instruction
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 21:40
by jvdz
I don't have this in /usr/local/share/lua/5.2/
rwxr-xr-x 1 root root 61293 Jul 5 2015 ssl.so
only in /usr/local/lib/lua/5.2
Could that be the issue?
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 21:44
by jvdz
No idea about that last one.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 21 November 2018 23:38
by nosehook
Hi Jos,
I removed the file, now I get:
2018-11-21 21:34:02 - DomoticzIP: 192.168.0.115
2018-11-21 21:34:02 - DomoticzPort: 8080
2018-11-21 21:34:02 - BotHomePath: /home/pi/dtgbot/
2018-11-21 21:34:02 - TempFileDir: /var/tmp/
2018-11-21 21:34:02 - BotLuaScriptPath: /home/pi/dtgbot/lua/
2018-11-21 21:34:02 - BotBashScriptPath: /home/pi/dtgbot/bash/
2018-11-21 21:34:02 - TelegramBotToken: token
2018-11-21 21:34:02 - TelegramBotOffset: TelegramBotOffset
2018-11-21 21:34:02 - -----------------------------------------
2018-11-21 21:34:02 - Starting Telegram api Bot message handler
2018-11-21 21:34:02 - -----------------------------------------
Illegal instruction
Should I try a clean install and try again via the WIKI?
Regards,
Freek
Re: dtgbot - Domoticz TeleGram BOT
Posted: Thursday 22 November 2018 8:59
by jvdz
That is what you posted earlier and I responded to with:
No idea about that last one.
It seems you downloaded another version of libssl which I guess is causing this. Can't you reverse that action and test again?
Jos