Signal Binding [5.1.3.0;6.0.0.0)

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

VERY IMPORTANT : The signal-cli bundled with the current version of the signal binding is faulty. You have several possibilities in the settings page:

  • manage the version by yourself (use the “local” or “network” kind and provide signal-cli by your own mean)
  • Or (simpler) use the “managed” kind, and write 0.14.5 in the “Kind related configuration parameter” to force the signal binding to download and use a newer version.

Also please note :
STILL WAITING FOR TEST on raspberry, windows, macos. May work (or not). Feedback welcome.

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
  • (should) Work out of the box for the following platforms: linux (x64, arm, NOT musl), Windows, Macos (arm, NOT x64). For the others, please provide a signal-cli installation by yourself and use the “local” or “network” configuration.

See documentation in Resources section for setup.

KNOWN ISSUES

  • Registration process with a phone call to get the verification code may be difficult. You may encounter “Cannot verify message: Timeout while waiting for response”, and it may be a false error. After entering the verification code, deactivating and reactivating the account could be enough to make it work.
  • Configuration initialization (I made a mistake with the default parameter). You need to go the settings page and do some modifications for the bundle to register the right parameter for the “kind” (i.e. you probably want MANAGED for an automated download). If you don’t do so, then you have a silly issue with the binding trying to execute a directory.Fixed, feedback welcome.
  • Works only with Java 25. As time of write, not directly compatible with the Java runtime running openHAB (Java 21). (look alpha 15 section for more information). Fixed, feedback welcome.
  • If you just updated, you may need to register again your number
  • New registration behavior is not optimal. I sometimes had error messages during verification process, but sometimes it was false error, because restarting openHAB make it work nonetheless. Please do so and sorry for the inconvenience (do not hesitate to look at the end of this thread, as several users has detailed their process). Feedback welcome.

Status and future development.

Fix all these alpha issues.
Then I will hopefully make a pull request, to include it officially in openHAB.

Contribution welcome ! :

  • Sending image (DONE)
  • Group messaging
  • Auto discovery of already configured account in signal-cli
  • … suggestions welcome

Changelog

Version 5.1.3 BETA 16

At last, this version is “usable”, without tinkering.
Auto download native graalVM signal-cli version (Java25 not needed anymore)
Fix registering issues
Upgrade version to openHAB 5.1.3 needed

Version 5.0.0 ALPHA 15

There will be bugs ! I appreciate if you want to test it and give feedbacks, but do not except a hassle free experience. Sorry for the inconvenience.

First release using the full signal-cli binary as an external process, and not only the library as a dependency.
You may (or may not) have to register again your account (I had to, but I don’t know if it’s because I made a mistake or if it is mandatory). Feedback on this subject is also welcome.
The registering process is now based on Actions (see the documentation).

Good news:

  • The binding can (theoretically) manage and install signal-cli without manual intervention. This is the default.
  • You could alternatively choose to provide it the path to a binary on your system.
  • Or even use a remote one (TCP).

You configure this behavior at the binding level. Look at the documentation.

BUT, bad news, the managed version, unfortunately, is not completely autonomous. There is a caveat, as signal-cli 14+ works with Java25+ only. You have to provide the binding a path to the JDK25+ home. To do so, write, in the “configuration” parameter, the following :
JAVA_HOME=/your_path/to/the/jdk25/
(of course, adjust it to a valid path)
Warning : make sure that the openHAB user can access the JDK (read/execute).

I appreciate feedbacks. I appreciate even more feedbacks AND insights. If you are a developer or competent enough, please provide me with the maximum information you can give (and if you have a fix, may you be blessed, please open a PR !)

Version 5.0.0 BETA 14

(dropped - does not work, was for testing purpose only)

version 5.0.0 - BETA 13

Bumping signal-cli version to 0.13.18
openhab 5 only

version 4.3.0 - BETA 12

Bumping signal-cli version to 0.13.10
Remove warnings

version 4.2.0 - BETA 11

Fix linking account is failed (exceptions.MissingCapabilitiesException: StatusCode: 409) by bumping signal-cli version to 0.13.6

version 4.2.0 - BETA 10.

Bump to signal-cli version 0.13.4
i686 32 bits support

version 4.2.0 - BETA 9.

Bump to signal-cli version 0.13.3
musl arch support attempt
Adding (very simple draft) reaction emoji support
Adding reponse status to “send” action

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 and communicate with it with JSON-RPC.
  • about the managed mode: the binding downloads binaries from the openHAB JFrog artifactory: one download for the release (a GraalVM binary), and one download for libsignal (the native signal lib). Both depend on the system architecture running openHAB.
  • I push new versions to JFrog manually. I build them on my fork with github actions, because signal-cli doesn’t provide graalvm binaries for architecture other than linux x64. I also have to take the right libsignal version from another repository and upload them alongside.
  • feel free to open a PR to my fork. A note on AI: If you want to use AI, I’m OK with that, with one absolute caveat: if you don’t understand what the AI did/coded, AND if you didn’t do a review with code quality in mind, then please understand that it is probably of no value to me (I may have done it myself, I know how to use AI and also how to do crappy code :sweat_smile:). As many open source project encoutered issue with AI, I am also one of those thinking that the reviewer time is now a precious bottleneck.

Resources

JAR bundle

Source and documentation

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).

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)

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.