first of all: thank you very much for the Telegram action, @paolo_denti ! It is really helpful and I enjoy using it.
I would like to contribute to the action by trying to add more functionalities, e.g., adding a bilateral support for sending actions to the bot, etc.
Do you think this could be a good idea? Did someone try something simliar? Are there any known issues with that?
As far as I know, the telegram action can only be used to send something from openhab to the bot. If you want to send something from the bot to openhab, you must either poll updates or configure a webhook.
I did the latter and created a php script (hosted on my own webspace) as webhook. That script just uses the REST API of my openhab server to set the value of the string item VoiceCommand. This works very well and allows input such as “switch on light in living room”
For general applicability, openhab server configuration, credentials, etc. must be configured and stored somewhere, e.g. for myopenhab and ideally via an OAuth token. But I don’t know how and where such data could be stored. IIRC, it is not possible for a bot to store any data (maybe that changed in the meantime?! I only checked that a few months ago). So I think that a dedicated server is needed which holds that data. But I assume that other users don’t want to enter their openhab credentials to a thrid party server…
Long story short, I don’t think that two-way communication is generally applicable at the moment.