Control Openhab with messages


Does anyone know any methods to send command to openhab via messages? (mail,facebook etc.)
I just found something with telegram: Control OpenHAB2 with Telegram and simple python script - #28 by Belgadon
Information about gotify usage would be very appreciated :slight_smile:

The thread you have found is several years old. The current version of the telegram binding supports receiving some messages out of the box. You can see an example near the bottom of the binding docs:

I personally use the API for my Nexcloud Talk app with the html binding and custom rules to send and receive messages from my OH server. There is not, to my knowledge, any available direct Gotify integration, but Gotify also has a well documented API and you could use rules, and/or the html binding to send/receive messages using that platform.

If you are using the Android app, then the microphone icon will allow you to give a voice command which is converted to text and relayed to OH for processing in rules as well.

Depending on your comfort with setting it up, you can also just use MQTT so relay messages to/from OH. This is a less ideal solution, however, because if you need to be able to send these messages remotely, then you will need to make sure you can securely access the MQTT server remotely, which is not a standard MQTT setup.

1 Like

Thanks for info.
For now, I don’t know how to send message from android to be readable by Openhab to use it.

There is a section in the app docs to get you started:

1 Like

Unfortunately I can’t find information how to send message using gotify and have it interpreteded by openhab. For example:
I’m sending message → room: light ON
to turn my lights on.

You are not going to find this information. No one has done this yet (or if they have, they haven’t posted about it). But that doesn’t mean it can’t be done, it just means that you’ll be breaking new ground.

Go to the Gotify documentation and find their API page. Part of their API includes getting messages, so it is possible to have OH make the http calls required to get the Gotify API to return message data. Depending on the authorization/token options it may be easier to do this with the http binding or with a rule, I don’t know. This will take some work understanding their API and how to format the calls correctly.

Once you can get the messages into OH you’ll need to write your own rule to interpret the message. Maybe that’s a custom interpretation you want to implement or maybe it is just sending the message information to one of OH’s built in interpreters; either way you’re still going to have to make that happen.

The android app documentation link I posted above has nothing to do with Gotify. That link has information about how to set up the openHAB andriod app to record and send voice commands to OH.