Openhab & Telegram messages delayed and duplicated

Hey guys and girls,

im new here and new to openhab. But I know some languages like java so i’m not a complete beginner at programming. I’m from germany so in case of bad spelling please forgive me.

I just moved into my new house with KNX smarthome and openhab on raspberry 3b as visu.
Everything is setted up and working fine. Having my sitemap done and can control basic stuff like lights, ventilation, heating. Started creating my first rules for ventilation and will do a lot more.

My girlfriend asked me to focus on making the house able to send us messages. We would like to use telegram for that. So I installed the telegram action. Created a bot, got the API and our user IDs. Setted up the telegram.cfg. Everything fine so far.

First use case. When the doorbell ring we would like to receive a message via telegram.
Doorbell is done with a datec actor with binary inputs. Button at the front doors goes to the binary input. Binary input changes to “on” makes two MDT actos change a chanel to “on” for a second to make two speakers in the house tell us that someone is at the door.

So I created a thing for the GA of our doorbell. Created a item and added a rule which sends a telegram message to us when item changes to on.

Working fine basically, but two problems:

  1. Instead of getting one telegram message everyone of us is getting 4 messages.
  2. The messages are delayed for about 0,5 seconds up to 4 seconds from pushing the button until the message arrives.
    Our parcel service guys go away very soon when no one opens the door. So I don’t want to lose these seconds. Especially because the idea behind this feature is for example when I’m in the cellar were I can’t here the doorbell it’s good to know that someone is at the door… but the way to the door is even longer.

Does anyone has an idea what it the problem?

I add the GA, thing, item, telegram.cfg and rule.

GA

THING

 Type switch        : Tuerklingel                     "Türklingel" [ ga="8/0/0" ]  

ITEM

 Switch          Tuerklingel                 "Türklingel"        <motion>             (Einzelobjekte)                ["Switchable"]               {channel="knx:device:bridge:generic:Tuerklingel"}  

telegram.cfg - I distorted API and User IDs for this thread :wink:

 bots=soeren,nati    
//Soeren  
soeren.chatId=1025xxxxxxxx  
soeren.token=922xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    
//Nati  
nati.chatID=273xxxxxxx  
nati.token=922xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  

RULE

rule "Türklingel"  
when    
 Item Tuerklingel received update ON
 then      
sendTelegram("soeren", "Es hat an der Tür geklingelt!")    
 sendTelegram("nati", "Es hat an der Tür geklingelt!")  end  

If you change the trigger to use “changed to ON” instead of “received update ON” does it help with the delay?

Example:

when    
 Item Tuerklingel changed to ON
 then      
1 Like

Thanks man!
Yes it helped, but not with the delay but now I only receive one message instead of 4.
So issue 1 is fixed - Thanks a lot

Delay issue is still present :frowning:

Realize you are getting a signal from the device, packaging that signal into a message, sending the message to Telegram’s servers over there internet (probably in some other country), then it gets sent from there across the internet to your devices. If you are only seeing a <4 second delay I think you are doing pretty good. You will never see sub-second times for any service that had to go through the internet to get to your phone.

I see a similar delay for every similar service I use from Nest to Wyze to Pushbullet.

If you want better performance, you need to keep the message traffic local which ornaments means working something yourself.

2 Likes

Yes I thought this could be the reason but wasn’t sure about that.
But indeed it makes sense.

Will work with the current scenario for some days / weeks and figur out if it’s ok for us or if I have to try something else.

Thank you guys for your help