Error in Project 11

I’m getting this error mentioned below.
The current sensor value is: 267

Sensor

value has exceede threshold URL

This is the Telegran https://api.telegran.org/bot5094942929:

This is the Telegran response

AAGOUU? J2PSFht9nFkXlZami53.jgd? Tug/sendMessage

“ok”:false,“error_code”:100,“description”:“Bad Request: chat_id is empty”)

This is the Telegran status: False

@suriyasam16

Correction in the chat ID,

Remove ‘t.me/’ and keep the rest. Somewhat like @temperature_alert...

Even after I removed those things, I’m getting the same error

@suriyasam16

You’re looking at the wrong file then. The chat_id was defined in your main code file.

Either put ‘telegram_chat_id’ while defining the variable in the main code.

Or,

Change ‘telegram_chat_id’ to ‘chat_id’ in the conf.py.

If both does not work, then send a snap of the MAIN FILE.

@suriyasam16

The telegram chat id you have entered is not valid it shouldn’t start with @t.me

Also in error it says the “chat_id” is empty which means you have to check the variable name you have given in your conf.py file is same as what you have called in you main file for sending message with telegram.

  1. Don’t enter ‘t.me’ at the beginning of your telegram_chat_id instead just add the rest of the id.

  2. In your main code i.e telegram_alert.py make sure that in the ‘send_telegram_message()’ function chat_id gets the correct id from the conf.py file.

  3. If the problem still persists then check whether you are typing the correct chat id by verifying it again on telegram chat settings. Make sure all characters that you have typed in the conf.py code match with the chat id through telegram.


I’m getting the same error. My conf.py code is:
bolt_api_key = “Jc4e1616-1ce2-48a2-a809-84e384abcff”
device id = “BOLTxxxxx”
telegram_chat_id = “@temperature_alert_1612
telegram_bot_id= “bot5094942929 AGO7J2P5Fht9nPkXulZamu53xxxx?xxx”
threshold = 250

@suriyasam16

You have written “chart_id” instead of “chat_id” inside the data variable in the send_telegram_message() function definition.

Please go through the code and check for similar typing mistakes.