Telegram notificator for multiple users and chat id

Dario5 years ago

I actually have notificator.telegram.key and notificator.telegram.chatid set on traccar.xml server.
It's possible to set user by user?
I tried to set them as user's attribute without succes.
Thanks!

Anders Yuran5 years ago

No

Kobi Samoray5 years ago

I've been using the code from the PRs below for a while:
https://github.com/traccar/traccar/pull/4309
https://github.com/traccar/traccar/pull/4310

Both are functionally usable. 4310 is somewhat hack-ish so I'd rather use 4309 (yeah - I did code 4310 but still believe 4309 is better...).
Either way, neither of these have made it into a Traccar release yet so I use a private build as I find Telegram very useful and reliable.

Dario5 years ago

Thanks for your help, searching a lot more I find this workaround (I think similar to 4310)

   <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/bot****TOKEN*****/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>

from https://www.traccar.org/forums/topic/doubts-with-telegram/ , it looks working but I have to test more (for me chatid it's without - )
Really thanks, I will evaluate 4309!

Kobi Samoray5 years ago

Hi,
Haven't tried this, however we find SMS handy and wouldn't like to drop it

Dario5 years ago

Sure you're right, it's a workaround with lost of sms as drawback, but it's really simple and can send notifications without a sms plan.
But I understand could not be a solution for all kinds of users...
Hope will add this telegram feature (merging 4309 or just adding it), it's useful and cost effective!
Really Thanks!

argaar5 years ago

Dario, you could take the source code and do the change by yourself and then compile the whole project.
I've done the hack in 4309 and everything is working smoothly and me and my brother had our own notification (per event/per user)

Dario5 years ago

Thanks for the feedback, I'll try, however hope could be accepted and merged soon