openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.58k forks source link

Enable OH to communicate with signal messenger #10913

Open DerOetzi opened 3 years ago

DerOetzi commented 3 years ago

Signal messenger is now one of the most popular messengers beside WhatsApp, Threema, Telegramm, which is Open Source.

It would be nice to add a binding for the possibility to send and receive messages by signal.

I'm running a extended docker image for a few years which uses signal-cli to give a option via exec binding. But this project is stucked now because of new travis license model. That is why I thought now, maybe it would be possible to integrate as a action binding.

There is a java library(https://github.com/signalapp/libsignal-client) but I'm not sure about the AGPL-license is compatible to use it inside OH, maybe @kaikreuzer can give us a hint? And the second problem is I don't have the time to do the binding by myself but I hope there is someone in the community who is although interested in doing this. I can give support with use cases and testing.

kaikreuzer commented 3 years ago

Hi @DerOetzi! Funny, I was just reading about signal-cli in the latest c't and thought about the very same :-) I sounded in the article as if it is a Java program, but unfortunately, it has mainly native code, so that it isn't as easy to include as hoped - but it should nonetheless be possible.

I'm not sure about the AGPL-license is compatible to use it inside OH

That's unfortunately indeed a problem as the (A)GPL is not compatible with the EPL. This means that the code of such an add-on would need to be released under (A)GPL as well. As a result, we couldn't include it in the openhab-addons repo, nor include it in the official distro. But with the new community marketplace hopefully coming soon, this would probably still be an option to provide it to our users easily.

And the second problem is I don't have the time to do the binding by myself

I share the same problem - would love to do it, but I doubt to find the time for it anytime soon. So let's hope we find somebody who wants to give it a try!

DerOetzi commented 3 years ago

Maybe one option would be if someone can help me do get my extended container image updated to new structure of the official Dockerimage and we can extend the readme howto use signal-cli with different rules.

DerOetzi commented 1 year ago

@kaikreuzer there is a rest Service wrap arround the Signal-Cli available in docker hub . Would it be an Option to Release an Action add-on for this?

wborn commented 1 year ago

There's a Marketplace add-on nowadays:

https://community.openhab.org/t/signal-binding/138795

Maybe @dalgwen also wants to contribute the code to this repo?

dalgwen commented 1 year ago

Hello,

Thanks wborn for the ping.

I made the marketplace signal binding. Some licenses thought before :

In the first draft of the binding, I used some custom code with the official libsignal client to send and receive message. I had many issues with this, as the signal API is extremely hard to understand, and as the signal server continuously shifted with new versions, breaking compatibility. So in the last release of the binding, I decided to use the signal-cli core library, which is a higher level api (still using libsignal client official underneath), backported to java 11, directly inside the bundle (as a 3rd party). It is not devoid of any issue (especially with the sqlite part and OH compatibility) but it is another subject. There is also a bunch of native library embedded (compiled from rust)

I wasn't aware of the license issue, I'm a little bit disappointed as I was hoping to make a pull request in several weeks/months. In fact, I am also surprised, as the signal-cli project has a GPL V3 license ? How do they manage to stay GPL if the underlying libsignal-client is AGPL ?

Next, about the nature of the integration.

By making this addon, I had one thing in mind : avoiding the installation of any other third party software. So the integration with a signal-cli process running somewhere else is not my main goal. But I'm not opposed to it, as it will fullfill some use case and could help some users with compatibility issue. That said, to be honest, sorry, I don't have time to contribute to this solution. But if someone wants to add to the signal binding the capability to connect to a distant running signal-cli, I will be more than happy to merge the code.