dtgbot - Domoticz TeleGram BOT

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

solarboy
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

Post by solarboy »

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
User avatar
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

Post by jvdz »

solarboy wrote: Thursday 09 September 2021 1:13 dtgbot is rarely reliable in my experience.
..
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
hoeby
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

Post by hoeby »

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.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
solarboy
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

Post by solarboy »

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
User avatar
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

Post by jvdz »

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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
solarboy
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

Post by solarboy »

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
User avatar
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

Post by jvdz »

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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

this error appears in dtb.log.errors

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.list

Code: Select all

sudo nano /etc/apt/sources.list
add the next line:
this link

Code: Select all

deb http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
this link

Save it with CTRL + X , Y
and then:

Code: Select all

sudo apt-get update
sudo apt-get install libssl1.0.0
Then the bot works!
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:~ $ 

hoeby
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

Post by hoeby »

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
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

hoeby 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
Thanks a lot, it works great now
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

another question, how to turn on a switch that is password protected
User avatar
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

Post by jvdz »

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
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

jvdz wrote: Monday 20 December 2021 23:19 How are you trying to switch this switch? Via a bash or LUA script using a JSON call to domoticz or the MENU?
Via the Menu in Telegram
User avatar
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

Post by jvdz »

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
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

jvdz wrote: Tuesday 21 December 2021 9:08 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.
can you show me an example. please
User avatar
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

Post by jvdz »

Just create a script for ON and one for OFF .... something like:

Code: Select all

#!/bin/sh
curl 'https://yourdomoticzip:port/json.htm?type=command&param=switchlight&idx=IDX-oftheSwitch&switchcmd=On&passcode=YOUR_SWITCH_PASSWORD_AS_SET_IN_SETTINGS'
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:

Code: Select all

static_dtgmenu_submenus = {
	["pSwitch"] = {whitelist="",showdevstatus="n",Menuwidth=3,
		buttons={
		["pswitchon"]	 	= {whitelist=""},
		["pswitchoff"]	 	= {whitelist=""},
		}
	},
}
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?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

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
hoeby
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

Post by hoeby »

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
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:

Code: 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
Could the issue be similar to issues reported like this one?: http://www.domoticz.com/forum/viewtopic ... on#p171940

Jos
The link on the similar issue isn't working anymore, any idea where the link was transfered to?
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)
mojso
Posts: 92
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dtgbot - Domoticz TeleGram BOT

Post by mojso »

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
User avatar
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

Post by jvdz »

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. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest