Erwin, thanks for your comments, if Frans has got this far he has Lua installed, the wiki is a work in progress, but I don't think you will need any packages beyond Lua itself, the rest of the libraries are installed as part of the wiki. So shouldn't need to install the whole lot, I would be interested to know which ones you actually need to install. libssl-dev may well be needed.Asa67 wrote:You problably (just like me) do not have lua installed:
From: https://www.domoticz.com/wiki/Installin ... ion_SystemDon't know if all the packages are needed but it did the trick for me.Code: Select all
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev lua-lgi glib-2.0 make git-core libjansson-dev
@simonrg, thanks for your work !! and maybe you can add the right packages in your - otherwise good - wiki
Greetz Erwin
dtgbot - Domoticz TeleGram BOT
Moderator: leecollings
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I have updated the scripts based on errors / improvements captured today and uploaded it to the initial post (150714dtgbot.tar - http://www.domoticz.com/forum/download/file.php?id=3689). If you have already installed dtgbot then the new scripts will overwrite the original scripts:
There are now 2 log files /var/tmp/dtb.log and /var/tmp/dtb.log.errors - the .errors file will capture Lua crash type errors, so should be helpful in debugging new installations.
Code: Select all
sudo service dtgbot stop
cd ~
tar -xvf ~/temp/150714dtgbot.tar
cd ~/dtgbot/service
sudo mv dtgbot /etc/init.d
cd ..
rmdir service
sudo update-rc.d dtgbot remove
sudo update-rc.d dtgbot defaults
sudo service dtgbot start
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
-
- Posts: 59
- Joined: Sunday 14 June 2015 13:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Again thanks for the effort.
I installed lua as Erwin said with no luck.
/var/tmp/dtb.log.errors:
I will get some sleep (worked last night) I will get a fresh domoticz again and try it all over again. (had some problems with creating folder . I had to use mkdir -p)
I installed lua as Erwin said with no luck.
/var/tmp/dtb.log.errors:
Code: Select all
/usr/bin/lua: /home/pi/dtgbot/dtgbot.lua:183: attempt to index local 'decoded_response' (a nil value)
stack traceback:
/home/pi/dtgbot/dtgbot.lua:183: in function 'idx_from_variable_name'
/home/pi/dtgbot/dtgbot.lua:413: in main chunk
[C]: in ?
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Don't install a fresh Domoticz, lets do some troubleshoting first.fransiefrans wrote:Code: Select all
/usr/bin/lua: /home/pi/dtgbot/dtgbot.lua:183: attempt to index local 'decoded_response' (a nil value) stack traceback: /home/pi/dtgbot/dtgbot.lua:183: in function 'idx_from_variable_name' /home/pi/dtgbot/dtgbot.lua:413: in main chunk [C]: in ?
The simplest explanation for your error is that you haven't created any User Variables in Domoticz which I guess if this was a recent install might be the case, but unlikely.
I assume your Domoticz doesn't need a password to access, this would give the same error. If it is password protected then you would need include this in the ip address i.e. username:[email protected].
If you go to the command line and type lua it will display the version Lua 5.2.x, what does yours say? If you have tried the Google Hangouts you might have changed the default to 5.1 in which go into ~/dtgbot/dtgbot and change /usr/bin/lua for /usr/bin/lua5.2.
Also from your previous post your ip address was DomoticzIP: 192.168.2.7, but the Wiki instructions use 127.0.0.1.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
-
- Posts: 59
- Joined: Sunday 14 June 2015 13:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Dear Simon,
My Domoticz is password protected!!
I added the username:password in the /etc/profile.d/DomoticzData.sh file and started dtgbot.
Checked status and its running
Thank you for the great support!
My Domoticz is password protected!!
I added the username:password in the /etc/profile.d/DomoticzData.sh file and started dtgbot.
Checked status and its running
Thank you for the great support!
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Great, thanks for sticking with it, I am adding what we find out to the wiki, so will hopefully this will make it easier for other people who install dtgbot.fransiefrans wrote:Dear Simon,
My Domoticz is password protected!!
I added the username:password in the /etc/profile.d/DomoticzData.sh file and started dtgbot.
Checked status and its running
Thank you for the great support!
What I don't know is whether the long install list that Erwin suggested was needed or not? I was expecting you to only need Lua 5.2.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
-
- Posts: 59
- Joined: Sunday 14 June 2015 13:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I wouldn't know. I guess we will find out when someone else will try your methode.
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Thanks simonrg! It works great.
One question. I have changed the scripts in the bash folder so these send the message to TelegramChatId as defined in DomoticzData.sh. This way I can let the bot send the answers to a group in Telegram.
But I can't get this working for the scripts in the lua folder as these don't have a Send(Msg)To variable. I can send a message to the group for the commands in the lua folder, but the answer is sent back to the sender instead of being sent back to the group.
Any ideas how I can change that for these scripts? Should I make the changes in dtgbot.lua?
One small remark regarding the wiki on http://www.domoticz.com/wiki/Telegram_Bot.
On the bottom of the page at the LUA exampe is says:
but that should be:
So the " after text= should be removed.
One question. I have changed the scripts in the bash folder so these send the message to TelegramChatId as defined in DomoticzData.sh. This way I can let the bot send the answers to a group in Telegram.
But I can't get this working for the scripts in the lua folder as these don't have a Send(Msg)To variable. I can send a message to the group for the commands in the lua folder, but the answer is sent back to the sender instead of being sent back to the group.
Any ideas how I can change that for these scripts? Should I make the changes in dtgbot.lua?
One small remark regarding the wiki on http://www.domoticz.com/wiki/Telegram_Bot.
On the bottom of the page at the LUA exampe is says:
Code: Select all
os.execute('curl --data chat_id='..chatid..' --data-urlencode "text="'..message..'" "https://api.telegram.org/bot'..token..'/sendMessage" ')
Code: Select all
os.execute('curl --data chat_id='..chatid..' --data-urlencode "text='..message..'" "https://api.telegram.org/bot'..token..'/sendMessage" ')
Not using Domoticz anymore
-
- Posts: 113
- Joined: Thursday 20 November 2014 22:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Norway
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Is it possible to set up dtgbot to send a small weatherstatus/forecast every weekday around 6am and weekends around 8am? Something like "It's 8c and raining today, better bring your umbrella!"?
2xRaspberry Pi Model 2 w/RaZberry z-wave chip (master/slave)|Fibaro Wall Plug|Fibaro Universal Dimmer 500W|Aeon Labs Multisensor|RFXtrx433E|Nexa WMR-1000|Nexa Pe-3|Nexa Remote|Nexa LGDR3500|Lightify Gateway|Lightify RGBW bulb
-
- Posts: 135
- Joined: Monday 27 January 2014 14:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
In the 'old' Telegram setup it was possible to send photos and messages to multiple receipients by adding the Firstname_Lastname. Telegram Bot sends to chat_id. How to send to more than one contacts?
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
Raspberry Pi Type B2
RFXCOMtrx433e
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
I am using a group for this.Heisenberg wrote:In the 'old' Telegram setup it was possible to send photos and messages to multiple receipients by adding the Firstname_Lastname. Telegram Bot sends to chat_id. How to send to more than one contacts?
Not using Domoticz anymore
-
- Posts: 135
- Joined: Monday 27 January 2014 14:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
G3rard, could you please tell where to find the group option or how to set up? I may have missed the instructions but can't find how to do it.
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
Raspberry Pi Type B2
RFXCOMtrx433e
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
dtgbot - Domoticz TeleGram BOT
Add the bot to the group and then send a message from the group, eg /temperature. Then you can find the id of the group, either with the explanation from the wiki or in the log file.
See also my earlier post, I have this working for the bash scripts, not yet for the lua scripts. I think simonrg can help us out with that .
See also my earlier post, I have this working for the bash scripts, not yet for the lua scripts. I think simonrg can help us out with that .
Not using Domoticz anymore
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
great job....!!
Now a native support possible?
And perhaps in the option for all the messages.....?
Now a native support possible?
And perhaps in the option for all the messages.....?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 82
- Joined: Tuesday 17 September 2013 13:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9269
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
strange i get when i use doorbell
this in console
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
dont know what i did grong
greetz BigDog
this in console
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
dont know what i did grong
greetz BigDog
1X Raspberry4B : Domoticz Version 2023.1 [Linux 5.10.63-v7l+ armv7l]
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
-
- Posts: 82
- Joined: Tuesday 17 September 2013 13:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9269
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
In telegram it works but in console not..
1X Raspberry4B : Domoticz Version 2023.1 [Linux 5.10.63-v7l+ armv7l]
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
-
- Posts: 82
- Joined: Tuesday 17 September 2013 13:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9269
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
i have tryed to use it stand alone that a scipt runs on the doorbel that sends a picture to me tro Telegram..
but it wount work
doorbell.sh dont work it gives a 403 command
can someone share me the script ?
OR the command to run the script in console or domoticz on command string in a switch
becose it wont work
Hope you guys can help
Greetz BigDog
but it wount work
doorbell.sh dont work it gives a 403 command
can someone share me the script ?
OR the command to run the script in console or domoticz on command string in a switch
becose it wont work
Hope you guys can help
Greetz BigDog
1X Raspberry4B : Domoticz Version 2023.1 [Linux 5.10.63-v7l+ armv7l]
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
-
- Posts: 82
- Joined: Tuesday 17 September 2013 13:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9269
- Location: The Netherlands
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Moderator edit: *snip*, please don't make multiple posts about your problem. Keep it at one topic: http://domoticz.com/forum/viewtopic.php?f=23&t=7371
Last edited by ThinkPad on Thursday 23 July 2015 9:29, edited 2 times in total.
Reason: Snipped post, please don't make multiple posts about your problem
Reason: Snipped post, please don't make multiple posts about your problem
1X Raspberry4B : Domoticz Version 2023.1 [Linux 5.10.63-v7l+ armv7l]
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
Is there any specific reason for the dependency on lua 5.2? The standard domoticz image contains lua 5.1
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 329
- Joined: Tuesday 16 July 2013 22:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8807
- Location: North East England
- Contact:
Re: dtgbot - Domoticz TeleGram BOT
The dependency is due to the way in which it is pulling in functions to make it compatible with the XPMM (Google Hangouts) bot.pvm wrote:Is there any specific reason for the dependency on lua 5.2? The standard domoticz image contains lua 5.1
I suppose there is no reason it shouldn't run in Domoticz with some modifications to the code. The bot would be a Lua time script which would issue a get updates every minute, but this would mean you the response would be very slow, i.e. only once every minute. Whereas as currently the code issues a long polling http request, it sends a request which either returns as soon as the next message is recieved, or times out after 60 seconds in which case the bot issues another long polling http request, so the processing load of the bot is very low and but it is still responsive.
How / what / why were you thinking of using the Lua inside Domoticz?
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
Who is online
Users browsing this forum: No registered users and 0 guests