Telegram - Example - Rule in UI

  • Platform information: Windows
    • openHAB version: 3.4
  • Issue of the topic: Example needed for Telegram in the UI

hi all, i created a simple rule which switches on lights - this is working without any problems. To test Telegram, i want to add an action, which sends me a message, whenever this rule is applied.

First a added the telegram thing:

Bot-Token and Chat-id are correct (test it working if send a test message with a browser)

Is the thing configuration correct?
Has anybody an example how i can add this to my rule?


I can’t help with the setting up of the Thing but it shows as ONLINE in your screenshot so it’s probably working just fine.

To use it in a rule will depend on the scripting language you choose. I don’t know if Telegram supports being called directly from a pure UI rule. You can check by clicking “add action” and then “show all” and see if the Telegram actions are listed.

In the likely event it’s not, you’ll need to add an “Inline Script” Action, choose the language of choice and then follow that language for how to call the Telegram action. For example, for Blockly there is a library you need to install (add-on store → automation → block libraries) and then you will have support for Telegram in Blockly. For Rules DSL see the Telegram docs: Telegram - Bindings | openHAB. For JS Scripting see the add-on docs: JavaScript Scripting - Automation | openHAB.