Page 1 of 1

Telegram notification error message in log window

Posted: Monday 04 January 2021 21:31
by rgroothuis
I get the following error message in the Domoticz error log:

Code: Select all

2021-01-04 18:11:31.208 Error: HTTP: <!DOCTYPE html>
2021-01-04 18:11:31.208 <html lang="en">
2021-01-04 18:11:31.208 <head>
2021-01-04 18:11:31.208 <meta charset="utf-8">
2021-01-04 18:11:31.208 <title>Error</title>
2021-01-04 18:11:31.208 </head>
2021-01-04 18:11:31.208 <body>
2021-01-04 18:11:31.208 <pre>Cannot GET /hGei7GkeifHifbr/HoekHuis%20Deurbel/Doorbell%20was%20pressed%20at%2018:11:30%2004/01/2021.</pre>
2021-01-04 18:11:31.208 </body>
2021-01-04 18:11:31.208 </html>
The message does arrive on the Telegram. Why do I get this error? And how can I resolve this?

The DZVents code I use to send the Telegram notification:

Code: Select all

domoticz.notify(USAGE_DEVICES[device.name], NotificatonMessage, domoticz.PRIORITY_HIGH)

Re: Telegram notification error message in log window

Posted: Monday 04 January 2021 22:03
by waaren
rgroothuis wrote: Monday 04 January 2021 21:31 I get the following error message in the Domoticz error log:
The message does arrive on the Telegram. Why do I get this error? And how can I resolve this?
  • do you also see this message when sending a test message from the notification setting screen?
  • and when you send domoticz.notify('test', 'test', domoticz.PRIORITY_HIGH) from you script?
  • what is your domoticz version?
  • when did you first noticed this error?
  • were there any recent changes on your system / network

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 10:10
by rgroothuis
waaren wrote: Monday 04 January 2021 22:03
rgroothuis wrote: Monday 04 January 2021 21:31 I get the following error message in the Domoticz error log:
The message does arrive on the Telegram. Why do I get this error? And how can I resolve this?
  • do you also see this message when sending a test message from the notification setting screen?
  • and when you send domoticz.notify('test', 'test', domoticz.PRIORITY_HIGH) from you script?
  • what is your domoticz version?
  • when did you first noticed this error?
  • were there any recent changes on your system / network
All good questions, let me answer them one by one.

When sending the test message I don't see that error message in the log file.

This is the code I used to send the Telegram notification message:

Code: Select all

local VoorDeurSlot = domoticz.devices('Voordeur Status')
local DateTimeEvent = os.date("%X %d/%m/%Y")
domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".", domoticz.PRIORITY_HIGH)
The Domoticz version is 2020.2 from 26-04-2020, the stable version.

I didn't made any significant changes recently. Was playing the the priority level on the Telegram notify but that is all back to PRIORITY_HIGH now.
It is not always happening, not on all Telegram message. Only on some, but I've not discovered the differences yet, if there are any.

I just noticed the following error message in the log:

Code: Select all

2021-01-05 09:23:00.775 Error: HTTP: Internal Server Error
2021-01-05 10:02:00.742 Error: HTTP: Internal Server Error
I will do also a reboot of Domoticz, maybe that solves the problem.

Could it have something to do with the amount of Telegram messages sent in a short time interval?

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 10:27
by waaren
rgroothuis wrote: Tuesday 05 January 2021 10:10 Could it have something to do with the amount of Telegram messages sent in a short time interval?
I don't know but how many and in what time interval?

The error message does not clearly states that the origin is the notification to telegram. To be sure that it comes from there can you try again after changing the line

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".", domoticz.PRIORITY_HIGH)
to

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".",domoticz.PRIORITY_HIGH,nil,nil,domoticz.NSS_TELEGRAM)

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 10:36
by rgroothuis
I will give it a try in a view moments.

I restarted Domoticz and saw the following in the error log:

Code: Select all

2021-01-05 10:27:00.622 Error: WebServer(HTTP) startup failed on address 0.0.0.0 with port: 80: bind: Address already in use
2021-01-05 10:27:00.622 Error: WebServer(HTTP) check privileges for opening ports below 1024
2021-01-05 10:27:00.627 Error: [web:443] missing SSL DH parameters from file ./server_cert.pem
2021-01-05 10:27:00.633 Error: No servers are configured. Hence mydomoticz will not be started either (if configured)
2021-01-05 10:27:05.976 Error: OpenZWave: Type_Notification, NodeID not found internally!. HomeID: 0, NodeID: 255 (0xff)
I don't understand the first message about address already in use. This is in my view not correct, port 80 is available. When I type in the Domoticz IP address (http) then it redirects me to https. So Domoticz is listing on port 80.

When in a script I do a "https://192.168.0.100/json.htm?type=lightlog&idx=98" I get a "2021-01-05 10:34:11.726 Error: HTTP: Internal Server Error" error message.

Code: Select all

            domoticz.openURL(
            {
                url = 'https://192.168.0.100/json.htm?type=lightlog&idx=98',
                callback = 'Garagedeur-98',
            })
Something it wrong with the HTTP server, looks like it.

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 10:51
by rgroothuis
I was able to reproduce:

The code:

Code: Select all

            domoticz.openURL(
            {
                url = 'https://192.168.0.100/json.htm?type=lightlog&idx=98',
                callback = 'Garagedeur-98',
            })
Is sometimes (not always) generating the following error:

Code: Select all

2021-01-05 10:49:13.061 Error: Error opening url: https://192.168.0.100/json.htm?type=lightlog&idx=98
2021-01-05 10:49:13.126 Error: dzVents: Error: (3.0.2) DeviceChangeNotifications: HTTP/1.1 response: 60 ==>> SSL peer certificate or SSH remote key was not OK
2021-01-05 10:49:13.126 Error: dzVents: Error: (3.0.2) DeviceChangeNotifications: There was a problem handling the request.

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 10:53
by rgroothuis
waaren wrote: Tuesday 05 January 2021 10:27
rgroothuis wrote: Tuesday 05 January 2021 10:10 Could it have something to do with the amount of Telegram messages sent in a short time interval?
I don't know but how many and in what time interval?

The error message does not clearly states that the origin is the notification to telegram. To be sure that it comes from there can you try again after changing the line

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".", domoticz.PRIORITY_HIGH)
to

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".",domoticz.PRIORITY_HIGH,nil,nil,domoticz.NSS_TELEGRAM)
This seems to solve the problem. When trying to reproduce the Telegram error with this updated code/line the error message is gone.

Should I change all notify code lines and add the extra parameters?

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 11:03
by waaren
rgroothuis wrote: Tuesday 05 January 2021 10:53 This seems to solve the problem. When trying to reproduce the Telegram error with this updated code/line the error message is gone.

Should I change all notify code lines and add the extra parameters?
What this change does is limit the notification to telegram only. If you leave out the subsystem parameter from the command, the notification will go to ALL configured and active notification subsystems.
So in this case it looks like one of the other notification systems generates the error message.

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 11:27
by rgroothuis
waaren wrote: Tuesday 05 January 2021 11:03
rgroothuis wrote: Tuesday 05 January 2021 10:53 This seems to solve the problem. When trying to reproduce the Telegram error with this updated code/line the error message is gone.

Should I change all notify code lines and add the extra parameters?
What this change does is limit the notification to telegram only. If you leave out the subsystem parameter from the command, the notification will go to ALL configured and active notification subsystems.
So in this case it looks like one of the other notification systems generates the error message.
Interesting, good to know. I do have a follow-up question, how does sending a Telegram notification message trigger other notifications? I don't understand how to debug this. Can you explain in more detail?

Re: Telegram notification error message in log window

Posted: Tuesday 05 January 2021 11:46
by waaren
rgroothuis wrote: Tuesday 05 January 2021 11:27 Interesting, good to know. I do have a follow-up question, how does sending a Telegram notification message trigger other notifications? I don't understand how to debug this. Can you explain in more detail?
This code does not specify a notificaton subsystem so it will send a notification to all configured and active notification subsystems.

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".", domoticz.PRIORITY_HIGH)
This code specifies telegram as target notification subsystem and will therefore send a notification only to telegram.

Code: Select all

domoticz.notify(VoorDeurSlot.name, DateTimeEvent .. ": Front door status is now: \"" .. VoorDeurSlot.state .. "\".",domoticz.PRIORITY_HIGH,nil,nil,domoticz.NSS_TELEGRAM)