doubts with telegram

Marcelo Rangel5 years ago

replace XXXXXXXXXXXXXXXXX with your telegram token don't touch anything else

<entry key='notificator.types'>web,mail,sms</entry>
    <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
    <entry key='sms.http.url'>https://api.telegram.org/botXXXXXXXXXXXXXXXXXXX/sendMessage?</entry>
    <entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
    <entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
    <entry key='sms.http.template'>
        chat_id={phone}&amp;text={message}
    </entry>
Jose B5 years ago

I change as you indicated, on in each user I set their phone (+55xxxxxxxxxxx) and in notification screen, I added SMS,
but did not work. Pls, What I can to do?

    <!-- + push notification - a configurar-->
            <entry key='notificator.types'>web,mail,sms</entry>   		
            <entry key='notificator.telegram.key'>xxxxxxxxxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</entry>
            <entry key='notificator.telegram.chatId'>999999999</entry>		
    <!--sms via telegram-->
        <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
        <entry key='sms.http.url'>https://api.telegram.org/botXXXXXXXXXXXXXXXXXXXXXXXXXX/sendMessage?</entry>
        <entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
        <entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
        <entry key='sms.http.template'>
            chat_id={phone}&amp;text={message}
        </entry>

I notice in traccar.log:

2019-08-18 08:35:30 WARN: No notificator configured for type :
2019-08-18 08:35:30 WARN: You are using null notificatior, please check your configuration, notification not sent

Marcelo Rangel5 years ago
Jose B5 years ago

bot code is chatId ? (I need ask their chatId?)

Marcelo Rangel5 years ago

Chat id telegram...

"chat":{"id":-zzzzzzzzzz,

-zzzzzzzzzz is your chat id (with the negative sign).

Jose B5 years ago

Unfortunately it did not work.
I've even tested in command prompt ( curl -s -X POST https:// ....) to make sure the codes (tokens and chatid) were right.
Everything ok, but I did not receive SMS.

In traccar.log, It continuing shows:

 WARN: No notificator configured for type :
 WARN: You are using null notificatior, please check your configuration, notification not sent
Marcelo Rangel5 years ago

notification type is SMS is not telegram

Marcelo Rangel5 years ago

In the user phone field, enter the chat ID of the telegram

Macan5 years ago

Jose you cant receive SMS , you will receive message via Telegram.

Jose B5 years ago

OK, I understood. But is not sending messages. I did doble check - tokens are ok.

https://drive.google.com/file/d/1AzE2RwIXsczc-aIOCTOSiTWyEKJnKDct/view?usp=sharing

Marcelo Rangel5 years ago

Bom dia José você é brasileiro cara fala português então cara tá quase tudo que você fez aí tá certo o chat id é colocado no "usuário" telefone do usuário

Jose B5 years ago

Então, eu já fiz isto. Está no campo de telefone do usuario. usei o "-"chat_id, usei o "chat_id" mas não funcionou. (de uma olhada na imagem)
Eu rodei o programa no prompt do DOS sé para saber se os codigos estao certos, e eu recebo sem problemas as mensagens no meu app telegram (sem colocar o "-" na frente do chatid. o problema esta só no traccar que não funciona.

não tem mais onde mexer e fica aparecendo aqueles erros que mandei

o que fazer?

Marcelo Rangel5 years ago

olha eu tava olhando a imagem que você mandou a parte do telegram em cima você tem que comentar caso contrário não vai funcionar tem que deixar só aquilo que eu te passei

Jose B5 years ago

Então:

removido as referencias do telegram e reiniciado o traccar:

            <entry key='notificator.types'>web,mail,sms</entry>
    <!--sms via telegram-->
    <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
    <entry key='sms.http.url'>https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendMessage?</entry>
    <entry key='sms.http.user'>[YOUR ACCOUNT SID]</entry>
    <entry key='sms.http.password'>[YOUR AUTH TOKEN]</entry>
    <entry key='sms.http.template'>
        chat_id={phone}&amp;text={message}
    </entry>
    <!---->

os erros continuam:

    Line 70: 2019-08-18 11:19:36  WARN: No notificator configured for type : 
    Line 71: 2019-08-18 11:19:36  WARN: You are using null notificatior, please check your configuration, notification not sent

o chatid esta no usuario sem o "-"

nao funcionou ainda...

Marcelo Rangel5 years ago

O chat é de tem que ter o negativo na frente