Signal Binding [4.0.0.0;5.0.0.0)

logo

The signal binding allows openHAB to exchange message with other Signal users.

Features :

  • Dedicated account (if you have a spare number, such as landline), or an account linked to your mobile phone number.
  • Register your account in two steps from within openHAB, no command line or extra manipulation (include verification code, QR code)
  • Sending, receiving text messages (individual user for the moment, no group).
  • Sending images
  • Trigger event.
  • A “send” action for your rules.
  • Delivery and read notifications

See documentation in Resources section for setup.

KNOWN ISSUES

  • Don’t (and won’t) work with openHAB 3.X, as the upstream library signal-cli now requires java 17.
  • Vocal validation issue, as stated here. I made a workaround, but the vocal registration will then take at least a minute, so please be patient.
  • Sqlite issues as a karaf dependency and load order. (this should be fixed now).
  • A raspberry pi 32 bits OS (such as openHABian) on a Raspberry PI version 4 can have another issue with sqlite. Please check this link for a solution by modifying the boot/config.txt file to force 32 bits. :
arm_64bit=0
  • unknown other case : despite my efforts there still seems to have errors with sqlite for some people (Errors relating to .so library linking). Expert contributors welcome ! You can also try, If you have sqlite error with incompatible .so, the workaround here.
  • Possible issue with Raspberry pi OS 64 bits and licb6. The 64 bit library included for the raspberry pi is compiled with libc6 version 2.33, which could be higher that yours. A user reports a working binding, but if you experience issue, please let me know. Should be OK now.

Status and future development.

Feedback welcome (do not hesitate to tell me if it works !)
I will hopefully make a pull request, to include it officialy in openHAB.

Contribution welcome ! There is so much to do :

  • Sending image (DONE)
  • Group messaging
  • … suggestions welcome

Changelog

version 4.2.0 - BETA 8.

Bump to signal-cli version 0.13 (with a backport from java 21 to java 17)

version 4.1.0 - BETA 7.

Fix the “signal-cli version is too old for the Signal-Server, please update.” message

version 4.1.0 - BETA 6.

Update signal-cli version to fix error when registering new linked account (accomodate changes in the whisper signal server side)
Renaming feature to avoid kar autodeletion by openHAB ?

version 4.1.0 - BETA 5.

First version explicitely targeting openHAB 4.
Written with java 17 (no more java 11 rewrite)
In the hope of resolving the sqlite error, the binary is now a KAR file, and sqlite is now a dependency feature.

Version 3.4.0 - BETA4

Action for sending image now include an accompanying text
Fix an error that forced to use vocal validation (which is broken)
Try to fix vocal validation with a workaround found on signal-cli forum

Version 3.4.0 - BETA3

Compatiblity with openHAB 3.4.x and openHAB 4.0
New feature : action to send images (see documentation)

Version 3.4.0 - BETA2

WARNING : breaking change ! You must delete and recreate your Thing account.
Full rewrite using the signal-cli library as a code base.
Fix : Connection issue following unknown changes on the whisper server side around the 6 december.
Fix : In all messages sent from the binding, the sender should now be apparent with the name you setup.
Fix : You can now send “note to yoursel” (if you use your full number : notification ON. if you use the special recipient “self” : no notification)
New : Delivery and Read status (both ways)

Version 3.4.0 - BETA1

Fix PushNetworkException - javax.net.ssl.SSLHandshakeException
(And some other too verbose exceptions in log)

Version 3.4.0 - BETA0.1

Fix DeprecatedVersionException

Version 3.4.0 - BETA0

Initial contribution.
Dedicated account, linked account.
Basic messages (send, receive)
Trigger event
Send action

Technical note

I strongly encourage you to contribute if you can, because it could take ages before I have the time to implement other features.
If you want to contribute, here is some information : this binding uses the signal-cli project “lib” part as a codebase, with very little adjustments (available on my personal fork of signal-cli). Signal-cli uses itself the underlying library com.github.turasa:signal-service-java, which is a modified version of the android Signal official library. And deep down below, there is the native library for various architecture (compiled from the official signal repository in rust). I included in the binding the autobuilded ones from exquo/signal-libs-build on github, and libsignal-client on gitlab (no longer needed)

Note to other developers. What To Do To Update (In the case I’m not responding and the service is broken) :

You should probably update signal-cli, as they probabley fixed it upstream.
Merge the new signal-cli tag version in the openhab_adjustement branch (on my personal fork of signal-cli). Get the source in the signal-cli lib subproject and overwrite the sources in the 3rdparty source directory of the binding project.
Check what libraries has been updated in the signal-cli project (settings.gradle.kts). You may (or may not) update/add the corresponding library in the pom. Try to stick to the version already present in openHAB.
Beware of the transitive dependencies, they may also need update ! Especially the libsignal-client (transitive dependency of signal-service-java).
If the libsignal-client is updated, you also need to update all the signal library binaries (in the src/main/resources/lib). You can follow this link to get new libraries. I personally use those from the user “exquo”. Get the right version ! (same version number as libsignal-client).

Resources

KAR bundle

Source and documentation

22 Likes

Cool binding! I’m on OH 3.3 myself right now, but will give this a go when 3.4 makes an entry in my smart home.
Thanks for sharing :slight_smile:

Hello,

You can totally use it with openHAB 3.3 (there is no breaking change with 3.4)
(In fact, it’s what I’m actually doing on my openHAB system)
You can install it from the marketplace.

I didn’t have any report beside myself, so I hope it will work for you.
:crossed_fingers:

Hello Gwendal,

great to have a binding for Signal. Thanks.
However I am already using the signal-cli script and call it within an openhab alarm rule by using executeCommandLine. This works well but so far I could not find a way to send messages with dynamic values e.g. temperatures.
Therefore my question:
In your example on github your example rule also just sends out a fixed message “Alert”. Does the binding provide the possibility to send dynamically created messages ? If it’s not possible I do not see any advantage of the binding compared to a straight forward way of calling the signal-cli script directly.

Yes, you can craft your text message with anything available in the script langage you use.

For example, item value are of course available in the DSL:

signalAction.sendSignal("+33123456789", "Alert ! " + room__temperature.state + " is low")

(with “room__temperature” your item name)

Do not underestimate the power of NOT having to go with the CLI route and additionnal software to install :sweat_smile:
Plus, I could be wrong, but is the CLI script solution able to receive messages and send them to openHAB easily ?
And, as I mentionned in the readme, I want to add other things that are difficult to do with the signal-script solution (send image for example)

Thanks for your quick reply.

I did not yet try to receive messages with my current solution. The most important point for me is the possibility to add item states to my Signal message. Therefore your answer sounds very good ! I will try to use the binding instead of using the signal-cli script directly.
I guess as I have already finished the Signal registration procedure it should be not too difficult.

One note about the registration : You will have to do it for the binding, wether you use signal-cli or not.

If you have a dedicated number and signal cli is the “main device” for it, then be aware that you won’t be able to also use it simultaneously with the binding : if you do process with the registration with the binding, then signal-cli will loose its access. Because only one “main” device can own a number (signal-cli OR the binding).

You can however use the openHAB binding as a “linked” (secondary) device to a mobile phone device. Signal-cli is also able to work as a secondary device. And you can have several “linked” account to a main account. So signal-cli and the binding can be secondary devices to your main mobile phone.

Take also note that the registration process is different for this two cases, thus the two binding bridge type available.

Yes, I foud in your descriptions that for creating a new Signal thing it is necessary to go through the whole registration process again. I followed your explanation and by registering another dedicated land line it works now without any problems. Two small issues are: 1) in the receiving message the senders phone number is not shown and 2) for sending an alarm message to e.g. 4 mobile numbers I had to add 4 lines with signalAction.sendSignal(“number”, “message”) to my alarm rule. But these are small issues.

Great, I’m happy to see it works for another one !

When you say “the receiving message”, do you mean with the channel “receive” for the conversation thing, or with the trigger channel “receivetrigger” for the bridge thing ? It could be the wanted behaviour, depending on the context :

  • For the channel “receive” for the conversation thing, only the message is transmitted (because you cannot receive, in this channel, message for other recipient than the one set for this conversation thing).
  • For the trigger channel “receivetrigger”, and only for this, the sender and the message received are concatened with ‘|’

Yes, don’t know when, but I would like to add a group conversation feature for this.

“the senders phone number is not shown” means after sending out a message by openHAB to a mobile phone the receiving mobile shows the message correctly but as sender not the landline number which I have registered but instead “unknown”. In my former solution with signal-cli the landline number was shown. (again: it’s a small issue!)
In my alarm rule I have five lines. The first line with val signalAction = getActions(“signal”,“signal:signalaccountbridge:Identifier”) and four lines (for 4 mobile numbers) each with signalAction.sendSignal(“number”, “message” + item.state). I did not link the trigger channel “receivetrigger” to an item (because I do not yet need to receive messages by openHAB).

Hello Gwendal,
do you know if there is Markdown support via Signal, or if emojis are possible with :dog, at the moment I’m still missing a bit of local test partners, which I can penetrate a bit :slight_smile:

Hello,

AFAIK, there is no markdown with signal.
But emoji are supported, provided that your rules are written and read with unicode support.
This is the case, for example, of the rules written from the GUI.

I just tested this :

And it works, i get the emoji on my phone.

Thank you for your test and for your answer, I just installed signal on my wife’s cell phone :grinning:

Really cool binding. It works out of the box with an unused line number. But as already mentioned, the sender number is not show on my mobile device. And the received message on the “Signal Conversation” thing is always NULL. The bridge trigger is receiving the messages.

Thanks for the binding! Works as described. :slight_smile:
Looking forward to have the number shown (or at least some kind of name) as there is no way for me to change it from unknown contact as you can’t even add it as contact to have it named.
Group messsage would be a nice feature as well.

Hi Thank you for the binding.This would make it so much easier for my openHab running in a docker container.
However sadly I was not able to get it working.
Added a new landline account as follows:
Put in number+capcha as described → get the call put in pin number and saved.
I get following Error:


Same if I add the thing within the .things-file.

So I tried linked device (used my landline on an old phone to create the signal account).
If scan the qr-code in openHab I get the error “No device found” within my signal app.
This also happens if I try to link my main mobile account (not the landline).
Linking the accounts on the windows app works without a problem.

could this be a location error? I’m from Austria…
Thanks for any help!

Just noticed i get the “Illegal key size” error also when trying the linked device:

Hello @Markgraf, @csowada, @Piffer,

This is very strange, because I don’t have this issue.
But you all seem to have it, and so I cannot hide behind behind my case :sweat_smile:

Has one of you tried the linked account ? I’m curious and would like to know if you have the same behaviour with it.

I found some reference to issues like yours, and it could be related to a lack of profile declaration. I tried to add code to push a profile but I have some issue with authentication (again… I hate the signal protocol). I hope I will find a solution, I will try again as soon as possible.

Another possibility : do you have a contact on the receiving phone with the phone number of the signal account used by openHAB (international format) ? Because I do (but I don’t know if it’s relevant).

1 Like

Hello @dhbl,

I think your issue is related to this.

Please ensure that you pass the CRYPTO_POLICY argument as stated here.

(If you get others issues after fixing the crypto one, you may have to delete the USERDATA/signal folder, and process with another registration, to get rid of a bad initialization)

1 Like

Thank you very much!

I currently don’t have the ability to test a linked account as I don’t want to use my main number.

I used my landline number for creating the signal account with the binding and of course I have that one added as contact. If I want to add the (unknown) contact on my phone it usually populates the number and name already, but in this case it’s just blank. If you pm me your number I could send you a test message from this account so you can see how it appears. Not sure if this would help in any way though.