Page 8 of 30
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 20 April 2016 21:57
by blackdog65
Hi guys,
Very impressed and many thanks for the hard work.
It's taken some time and reading, but finally got it up and running.. YAY!
There's one thing missing ( or more likely I missed it. ) Is there any way to list devices by room idx rather than room name?
For example: I have a room called "heating" that contains all my CH, HW, TRV, Stats and Temps in one place. It would be nice to call the list up easily.
Any tips?
Sean
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 22 April 2016 17:12
by jvdz
Hi Sean,
I guess you are talking about the menu functionallity which uses the room definitions as the bases for building the menu structure?
Dtgmenu also has the ability to define menu items manually, but there is no other option available than that.
I am also not sure what you are looking for and how that would function in the current setup. Could elaborate on what you mean?
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 22 April 2016 17:59
by blackdog65
A "room" created in Setup/more-options/plans/roomplans is allocated an Idx (i.e. $Hidden Devices is Idx 1).
With dtgbot I can input "scenes" and get a list of scenes, it would be very useful (to me) to be able to input "rooms" to see a roomplan list or better still, input a roomplan name i.e. "Sitting room" and see that room's devices listed.
As I say, this may well exist but I didn't see it.
Also "define menu items manually"??? NICE! But where/how?
Many thanks for getting back to me
Sean
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 22 April 2016 18:14
by jvdz
Ok, it looks like you are not talking about the dtgmenu functionality but about commands that can be used in the core dtgbot functionality written by simonrg.
I was talking about the menu stuff i wrote and integrated together with simonrg into the dtgbot setup shown earlier in this thread:
http://www.domoticz.com/forum/viewtopic ... 100#p52245
I'll leave it to simonrg to comment on your question.
ps: I am currently looking at changing the DTGMenu setup from the keyboard setup to the newly available in-line keyboard functionality as that makes the whole setup more flexible and dynamic.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 22 April 2016 19:28
by blackdog65
Many thanks again for your help,
the dtg menu looks more useful, is there any documentation yet? I can't find any.
Keep up the great work
Sean
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 24 April 2016 14:33
by blackdog65
Ah... if I change the variable TelegramBotMenu from "on" to "On" it works
Why oh why do I always get tripped up by these tiny errors?
Ok now to release dtgbot on the wife

Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 24 April 2016 18:53
by jvdz
I am still in develop mode, but have most of the basic running for the inline-keyboard functionality of Telegram, available in Bot API 2.0.
Here is a sneak peak of how it currently looks:

- Inline DTGBOT
- Image1.jpg (43.12 KiB) Viewed 2724 times
More to follow soon,
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Sunday 24 April 2016 22:54
by blackdog65
Looking good!
Will multi-position/selector switches work? Currently they just show off and on (in Dutch).
This is rapidly becoming a cool control panel.
Sean
Re: dtgbot - Domoticz TeleGram BOT
Posted: Monday 25 April 2016 17:47
by jvdz
blackdog65 wrote:Will multi-position/selector switches work?
I have the basics also running for the selector switch in the new version.
Hadn't looked at it yet and indeed required some changes in the process.
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Tuesday 26 April 2016 20:20
by blackdog65
Many many thanks! I'll be trying it soon
Sean
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 14:58
by woody4165
Hi and thanks for sharing this!!!
I've followed the guide at "Remote Control of Domoticz by Telegram Bot" but I'm getting error when launching the service:
Code: Select all
sudo service dtgbot start
Failed to start dtgbot.service: Unit dtgbot.service failed to load: No such file or directory.
and the last row in /var/tmp/dtb.log is:
Code: Select all
2016-04-27 14:47:28 - /var/run/dtgbot.pid does not exist, so exiting
What mistake I made during installation?
Thanks
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 15:02
by jvdz
I guess you missed a step in the setup process as defined in the Wiki.

Just check you did all steps listed here:
https://www.domoticz.com/wiki/Remote_Co ... ot_Scripts
and
https://www.domoticz.com/wiki/Remote_Co ... ot_Service
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 15:42
by woody4165
Don't know what I missed, but repeating those three command, now it's working.
Code: Select all
sudo chmod +x dtgbot
sudo update-rc.d dtgbot remove #Remove previous version
sudo update-rc.d dtgbot defaults #Install new version
Thanks.
It's really nice and easy to use.
One question regarding sharing the bot.
If I have a bot and I want to share with my son, but I don't want him to get all the notifications of what I'm doing (mosto probably he will remove it...), is there a way to do it or to have him get another bot connected with dtgbot?
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 15:49
by jvdz
The bot part can be used by multiple people and make sure you put those id's in the Domoticz variable: TelegramBotWhiteListedIDs
This will ensure only those individuals will be able to update Domoticz. When you leave this empty you allow every telegram user potentially to make use of your bot.
As to the notifications: You lost me there as the Bot part is not ablout notifications but rather getting online info or changing Switches/Scenes defined in the rooms/plans. Maybe you can elaborate on what you exactly mean?
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 16:09
by woody4165
Thanks Jos.
So if I understood well, any other person should have their own Apia key, but the chat Id of the bot I'm using, right?
Regarding the last part, I mean I don't want other to see all the commands and notification I get when submit a dtgbot command.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 16:23
by jvdz
The bot has one API key, but each individual has their own ChatId as described here:
https://www.domoticz.com/wiki/Telegram_ ... ur_chat_id
Each chat_id will have their own isolated session with dtgbot & menu. Only devices using the same ChatId will see the total session you have with the bot.
Does that make it any clearer ?

Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 16:53
by woody4165
More clear, thanks.
Only one more things.
Since in the DomoticzData.sh there is a variable "TelegramChatId" where I have put my ChatId, how it works with another person that has another ChatId?
Does it work because he is connected to the same Bot?
Re: dtgbot - Domoticz TeleGram BOT
Posted: Wednesday 27 April 2016 17:23
by jvdz
I don't know why the TelegramChatId environment variable is defined in DomoticzData.sh, and can't find it anywhere being used in the scripts. I still have the code in there from the example file and things are working fine for me. Maybe simonrg knows.
Just put your chatid in the Domoticz variable TelegramBotWhiteListedIDs and things should be fine and safe.
Jos
Re: dtgbot - Domoticz TeleGram BOT
Posted: Thursday 28 April 2016 1:00
by simonrg
TelegramChatId environment variable is there as some people were using Bash scripts which refer to it.
The list of ids in the Domoticz variable TelegramBotWhiteListedIDs, are the ids to which dtgbot will respond to commands from, dtgbot will ignore commands from any other chat ids.
I haven't played with multiple chat ids, but the responses should be visible to anybody who is part of the same conversation, even if they are not whitelisted to issue command.
Re: dtgbot - Domoticz TeleGram BOT
Posted: Friday 29 April 2016 16:06
by woody4165
I see a lots of hits to api.telegram.org even if I have not used it during the day.
I'm using PiHole as local dns as ads blocking and it tells me all the hits done in my network on a daily basis.
At this moment, starting from midnight, I've got more than 1100 hits to api.telegram.org without using even one time Telegram to see or set anything.
What can be all these hits for?
Thanks