openhab-addons icon indicating copy to clipboard operation
openhab-addons copied to clipboard

[telegram] Send messages silently

Open jwsp1 opened this issue 3 years ago • 8 comments

I'd like to send messages silently but it seems this is not implemented in the binding yet.

jwsp1 avatar Sep 17 '20 17:09 jwsp1

@ZzetT While this is easy code-wise (just need to add .withNotification(true|false) to sendMessage, the questin is how to integrate that into the actions. It would be easy if we make it a bot-configuration option, but is this flexible enough? If we want to decide on a per-message-basis, we would have to introduce another set of action-methods. I'm not sure if that is the way to go.

J-N-K avatar Dec 28 '20 15:12 J-N-K

I'd prefer a configuration on a per-message-basis because you can easily mute all incoming messages on a chat in Telegram. But sometimes you want to send messages with low prio (=muted) while keeping the opportunity to send it with higher prio (=notification) in the same chat, e.g. when something more important happens.

While this is easy code-wise (just need to add .withNotification(true|false) to sendMessage

This means that it's already possible? If so, I would welcome an entry in readme.

jwsp1 avatar Dec 28 '20 15:12 jwsp1

I don't think this is in, but would be awesome to have.

LeeNX avatar Jun 14 '21 08:06 LeeNX

@J-N-K

What are your thoughts on doing this with a channel? If two rules both ran at the exact same time and 1 turned the silent channel turned ON and the other rule turned it OFF, the result would not be predictable, maybe no noise for both will occur. This is not optimal as it may be an urgent message that does not make a sound anymore.

Possible ways forward are:

  1. Use config (do not like this way)
  2. Use channel that rules or user can make all notifications silent with (I think its worth considering this before looking at the next option)
  3. Overload the functions and make documentation a pain and cause a huge number of breaking changes unless a double up of the actions are created to leave all OLD actions alone, and create all new ones like suggested here https://github.com/openhab/openhab-addons/issues/8018

Skinah avatar Aug 18 '21 10:08 Skinah

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/telegram-send-silent-message-from-bot/137048/2

openhab-bot avatar Jul 01 '22 17:07 openhab-bot

@J-N-K Did you see my last post? I am happy to make some changes to the code for this, but want some feedback on which way to head with this.

https://www.openhab.org/addons/bindings/telegram/#actions-to-send-messages-to-all-configured-chats

The actions all come in two formats with the LONG being for chatIDs...

foo(String) foo(Long, String)

Then to complicate it they often have String... as the last argument. This prevents tacking the boolean on the end does it not?

foo(String, String...)

foo(String, String..., boolean) Does this work?

This will be a pain to document and this binding is already a huge pain to learn and make choices with. So I'm leaning towards a channel as a quick solution. Thoughts?

Skinah avatar Feb 22 '24 04:02 Skinah

I think it will be fine to have an action method that has this setting as parameter. It is straight forward, non breaking and not difficult to maintain.

lsiepel avatar Apr 13 '24 08:04 lsiepel

Hi guys, are there any news about this issue?

lorenzo93 avatar Apr 25 '24 16:04 lorenzo93