Traccar.xml Telegram

paulo andre jannke 7 years ago

Hello
Could anyone give me an example of how to set up the telegram? in version 4.4 I placed and sent alerts, but only for the bot chat group, it was not sent to separate users.
Now stopped at 4.5 should have changed something on traccar.xml

shyy 7 years ago

this is woking for me

<entry key='notificator.telegram.key'>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</entry>
<entry key='notificator.telegram.chatId'>yyyyyyyyyyyyyyyyyyy</entry>
IoSonoPiero 7 years ago

Hello @shyy, can you tell me, please, where can I found some resource to configure Telegram?
How can I obtain key and chatId?

Jose B 7 years ago

hi

Key_ID => created follow: https://core.telegram.org/api/obtaining_api_id
ChatID I=> created follow: https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id

But, and now? How make this worked? How send a specific message per user?

Anyone can help?

Jose B 7 years ago

I mean:
it works: by sending a message through the browser, at: https://api.telegram.org/bot<MY_TOKEN>/sendMessage?chat_id=<MY_ID>&text=teste

In traccar log I have: WARN: Telegram API error - HTTP 400 Bad Request - BadRequestException (...)

JB

gabrielcz 7 years ago

any clue how to setup telegram?
I update to 4.5 and keep looking.
regards,

Александр 6 years ago

Небольшая инструкция как я подключал Telegram

В файле opt/traccar/conf/traccar.xml добавить следующие строки

<entry key='notificator.types'>web,mail,telegram</entry>
<entry key='notificator.telegram.chatId'>-888398996</entry>
<entry key='notificator.telegram.key'>765112785:AAHoRzesUk5f4YCBjtz0U88X2XVcTCBG1b8</entry>

далее необходимо получить chatId и Key

  1. Создаете бота зайдя в @BotFather
    Во вкладке API Token узнаете Key
765112785:AAHoRzesUk5f4YCBjtz0U88X2XVcTCBG1b8
  1. Создаете группу и добавляете туда @my_bot
    После чего набираете /my_id
    Он вам дас id группы

Your group Chat ID : -888398996
Title : Gps

  1. Заходим в фаил /etc/resolv.conf
    Добавляем строку nameserver 4.2.2.1

далее проверяем

curl -X POST "https://api.telegram.org/bot765112785:AAHoRzesUk5f4YCBjtz0U88X2XVcTCBG1b8/sendMessage" -d "chat_id=-888398996&text=my sample text"

получаем сообщение OK

{"ok":true,"result":{"message_id":105,"from":{"id":765112785,"is_bot":true,"first_name":"Bot_gps","username":"gps_bot"},"chat":{"id":-888398996,"title":"Gps","type":"group","all_members_are_administrators":true},"date":1565795133,"text":"my sample text"}}

Теперь заходите в уведомления и настраиваете и в нужных уведомлениях добавьте notificatorTelegram

Igor Baev 6 years ago

Привет, а возможно ли использовать IPV6 для уведомлений телеграм?

homa 4 years ago

Hi! How about different telegramm alerts for each users? It is possible?

homa 4 years ago