windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
265 stars 118 forks source link

Message with options #188

Closed averlon closed 3 years ago

averlon commented 3 years ago

Hi, I have used telegrambot successfully to send messages to the BOT.

But it looks like, my payload setting "msg.payload.options.disable_notification:false" does not work.

Is there a way to set this option when sending a message?

Thanks for help Kallewirsch

averlon commented 3 years ago

was my fault - wron setting

averlon commented 3 years ago

sorry, I have to reopen.

I have tested now several times. There seems to be some time issue.

Result: 1) when sending a message with "msg.payload.options.disable_notification:false" after some time of inactivity of the BOT - it works 2) when sending several messages - it does not work

I have not found out the time issue.

windkh commented 3 years ago

Can you provide an example flow so that I can verify that?

averlon commented 3 years ago

Hi, I have tested now some messages always with a delay of some minutes. 1m, additional 5m, 10m, 15m, ... All messages below 25m did not signal on the mobile phone. Allemessages above a delay of 25m did.

When I paste the message flow here, my BOT settings will become public. Not what I want.

windkh commented 3 years ago

No the credentials are not exported

windkh commented 3 years ago

Well to cut it short. All messages are sent to the TG server. I do not have any control over what the server nor the client itself does.

averlon commented 3 years ago

First Test with a single message.

[{"id":"ed5e7d45.5fc27","type":"inject","z":"33667947.7eff86","name":"av_monitor_manuell","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":660,"wires":[["25047411.0ae034"]]},{"id":"25047411.0ae034","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test ---","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":740,"wires":[["55c2704a.49599","100b3f71.9cbf51"]]},{"id":"55c2704a.49599","type":"telegram sender","z":"33667947.7eff86","name":"sh_khfischbach_bot","bot":"66b2f062.25aba","outputs":1,"x":780,"y":740,"wires":[[]]},{"id":"66b2f062.25aba","type":"telegram bot","botname":"yyyyy","usernames":"","chatids":"","baseapiurl":"https://api.telegram.org","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

I have tried to change my specific settings.

This is the testmessage:

[{"id":"681adda6.106f94","type":"inject","z":"33667947.7eff86","name":"av_monitor_manuell","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1220,"wires":[["252f5f92.e09408"]]},{"id":"252f5f92.e09408","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1220,"wires":[["fb971499.1e76d8","1e827e8e.b061f1"]]},{"id":"fb971499.1e76d8","type":"telegram sender","z":"33667947.7eff86","name":"sh_khfischbach_bot","bot":"66b2f062.25aba","outputs":1,"x":840,"y":1220,"wires":[[]]},{"id":"1e827e8e.b061f1","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":360,"y":1280,"wires":[["623e68fe.c1c1f8"]]},{"id":"623e68fe.c1c1f8","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 1m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1280,"wires":[["fb971499.1e76d8","1cdd952e.b669c3"]]},{"id":"1cdd952e.b669c3","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":360,"y":1340,"wires":[["7f7a52cb.0efbdc"]]},{"id":"7f7a52cb.0efbdc","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 5m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1340,"wires":[["fb971499.1e76d8","f2a646a1.3a706"]]},{"id":"f2a646a1.3a706","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":370,"y":1400,"wires":[["c3e5f2c5.04fcd8"]]},{"id":"c3e5f2c5.04fcd8","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 10m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1400,"wires":[["fb971499.1e76d8","e64a6354.6cc2d"]]},{"id":"e64a6354.6cc2d","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":370,"y":1460,"wires":[["ff15e68c.b6f9c8"]]},{"id":"ff15e68c.b6f9c8","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 15m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1460,"wires":[["fb971499.1e76d8","84ee4de8.25033"]]},{"id":"84ee4de8.25033","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":370,"y":1520,"wires":[["1b7a2e63.ef37aa"]]},{"id":"1b7a2e63.ef37aa","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 20m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1520,"wires":[["fb971499.1e76d8","714e9f69.8a264"]]},{"id":"714e9f69.8a264","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"25","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":370,"y":1580,"wires":[["7e311a43.dda4e4"]]},{"id":"7e311a43.dda4e4","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 25m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1580,"wires":[["fb971499.1e76d8","b005d2ab.e7aaa8"]]},{"id":"b005d2ab.e7aaa8","type":"delay","z":"33667947.7eff86","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":370,"y":1640,"wires":[["3d6e9d21.793a92"]]},{"id":"3d6e9d21.793a92","type":"change","z":"33667947.7eff86","name":"tel_message_kh","rules":[{"t":"set","p":"av_payload","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.chatId","pt":"msg","to":"xxxxx","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"message","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"--- Test --- Test --- mit - 30m","tot":"str"},{"t":"set","p":"payload.options.disable_notification","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1640,"wires":[["fb971499.1e76d8"]]},{"id":"66b2f062.25aba","type":"telegram bot","botname":"yyyyy","usernames":"","chatids":"","baseapiurl":"https://api.telegram.org","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

averlon commented 3 years ago

Well to cut it short. All messages are sent to the TG server. I do not have any control over what the server nor the client itself does.

There is no doubt I believe you. But perhaps you could test yourself and verify or deny. Ringing the bell on the smartphone - or not - is important for me. As you might imagine, I send messages to my smartphone (Android) based on status of HmIP devices. Some are information only, some are critical.

windkh commented 3 years ago

I will try

averlon commented 3 years ago

It seems to be an app issue. In a very quiet environment I can hear a very low level "knock".

Sometimes the normal tone setup in the app is played, sometime only the "knock".

Courious: The Desktop-App of telegram acts in the same way.

windkh commented 3 years ago

Well I guess you will have to set disable_notification to true not to false, or?