doubts with telegram

Castillo3 years ago

Yes, it is possible to do that.

If it does not work is because a fault in the configuration or integration of Telegram.

Press the button "Test message" and be sure you receive something in Telegram

Test Notifications

LeMrTee3 years ago

Yes I assigned the geofence to the vehicle.

LeMrTee3 years ago

Yes I assigned the geofence to the vehicle. When i click on the test message icon i get the notification on web as shown here success on ui but after a few seconds i get this error here error after a few secs. I am not using actual sms.

Cristian3 years ago

obviously it's a configuration error, check your xml configuration file.

I have this configuration in Traccar version 4.6



<entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
<entry key='sms.http.url'>https://api.telegram.org/bot[_telegram.key_]/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}&text={message}
</entry>

you must replace telegram.key with your telegram key

I hope it helps

Castillo3 years ago

@LeMrTee something in the email configuration is wrong or... Did you setup an email in your account?

sudo nano /opt/traccar/conf/traccar.xml

<entry key='mail.smtp.host'>smtp.gmail.com</entry>
<entry key='mail.smtp.port'>465</entry>
<entry key='mail.smtp.ssl.enable'>true</entry>
<entry key='mail.smtp.from'>YOUR_EMAIL@gmail.com</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>YOUR_EMAIL@gmail.com</entry>
<entry key='mail.smtp.password'>GMAIL_PASSWORD</entry>

@Cristian Why you use SMS Notificator to send messages to Telegram? You have available a dedicated notificator!! See my post, I think you are meshing a bit and new users.

Cristian3 years ago

@Castillo as far as I remember the configuration was done this way at the time so that each user would receive the notifications of the vehicles assigned to him/her and not of all the vehicles entered to the Traccar server.
I used it as you indicate, and all users received notifications of all vehicles, when using telegram as SMS the user receives notifications of their vehicles, that's the difference.

As I said, this for version 4.6

LeMrTee3 years ago

Hi @Cristian. I have very similar configuration like you do.
but it doesn't seem to work. The error it keeps throwing seemed to have something to do with the email config so i decided to just remove it altogether but I realized something funny.. when i try to clear the configuration in my account under attributes as shown here they just come back after a reload.

Cristian3 years ago

the mail configuration I have it in the xml file

Richard Acosta3 years ago

@Cristian
@Castillo

I understood how to "prep" it, my confusion was on how the server knew which user send each notification, that was before I read (maybe somewhere else) it's only for one user.
I tought this could send notifications to all users from the same BOT, like I do when I receive something and want to confirm with the user.
Maybe I'm still not understanding it correctly... :)

Cristian3 years ago

@ Richard Acosta, Si lo que quieres es enviar notificaciones con el mismo bot a diferentes usuarios, si se puede. Solo debes implementar la configuración correcta.

Richard Acosta3 years ago

Yes, but there's not "the right config" anywhere I could find.

Juan Sánchez3 years ago

Hello,

How we can do the same on 4.14?

I try the same without success.

Could you share the correct configuration for 4,14?

Regards,

Cristian3 years ago

1.- I have created the telegram bot
2.- I have the api key of the telegram bot
3.- I have the telegram chaId of the users
4.- Installation from 0 of Traccar version 4.14
5.- Image with the configuration of the XML file https://ibb.co/740PxCm
6.- I assign the chatid to the users in the box for the phone number. https://ibb.co/xhFBJVk
7.- I receive the messages in your Telegram account separately for each user.
8.- It worked for Traccar 4.14

I test as shown in the image https://ibb.co/x3TKvv3 to see if it works.

The configuration allows to have a telegram bot configured at the server level to send notifications to different users.

Juan Sánchez3 years ago

Perfect!!!! Thanks a lot!!!

Castillo3 years ago

Thanks Cristian, now I understand why you use the SMS provider to send message to multiple users. =)