Signal binding

logo

[WARNING : BREAKING CHANGES]
- version 3.4.0 - BETA 4 Send image action now takes a new string argument in last position (for an accompanying text)
- Since the rewrite (version 3.4.0 - BETA 2), the new data model is not compatible with the old one. This means that you have to register again your bridge thing. You also have to delete / recreate your “linked” bridge thing, because a new parameter is now mandatory (the phone number).


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

  • vocal validation issue, as stated here. I made a workaround, but did not test it ; the vocal registration will then take at least a minute.
  • Sqlite issue for some users. Probably something with the way karaf/osgi load dependancies. Unfortunately despite my efforts I didn’t success in fixing it. Expert contributors welcome ! If you are on raspberry / arm and have sqlite error with incompatible .so, you can try the workaround here.
    - Possible issue with Raspberry pi OS 64 bits. 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.
    The raspberry pi 32 bits OS should be fine, as well as openhabian (feedback welcome)

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 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 openhab-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

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

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, rewritten for java 11 (java 17 pure codebase is used for the next openHAB 4 version). Signal-cli use the underlying library com.github.turasa:signal-service-java. It includes the native library from exquo/signal-libs-build on github, and libsignal-client on gitlab.

Resources

JAR bundle

Source and documentation

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