Initially, I was having all sorts of issues trying to get this installed under the Nodered “add-on/wrapper”. Everytime I hit the install button and viewed the log, it would fail with various errors. One by one I worked through them, and through constant communication on github, managed to finally get it installed.
I needed to run several commands within the Nodered container itself which is already sitting under the Home-Assistant supervisor.
In order to do this, I utilised the “exec” node.
I needed to run the following commands:
apk add g++
apk add make
apk add gcc
apk add alpine-sdk
For those of you not familiar with the execution node this allowed me to run commands directly within the Nodered container (add-on). There’s possibly easier ways of doing it via terminal, but I wanted to be sure that I was injecting the commands in to the container directly, and not into the supervisor (home-assistant installation). Here’s an example of the payload:
After running the final commands, the node installed, and I now had 5 fresh nodes to choose from.
Next step was to register the “device” for use with the signal service. This proved equally as frustrating. Initial attempts to register the installation as a signal worthy device were met with 402 errors. Basically the signal servers were denying the attempt. After further research and communication over github, it emerged that we needed to complete a signal captcha. This in itself proved awkward initially. I think my issue was I’d been trying various methods to activate the device that my IP address had been flagged as abusive, or the server was down. I returned to it a few days later, doing the exact same thing and the operation was successful.
In order to get your captcha token from Signal, you need to navigate to https://signalcaptchas.org/registration/generate.html
You then need to oepn the developer tools window and go to the console. Complete the captcha as required. In the console you should see the following: ‘signalcaptcha://03AGdB………..FZA‘ because the scheme does not have a registered handler.
We want everything after // (and before ‘) to be able to plug into our request sms node. With the account configured as follows and the captcha input, fire the flow (I connected to a debug to get some feedback). I received the following information in debug “Signal client: registration code requested via sms.”
Within seconds I received a message on my phone with a code in the format XXX-XXX.
Next I dragged out a register node and selected the account I’d previously configured. Input the code you just received XXX-XXX and fire the flow.
I’ll point out that when I checked the signal app on my phone, my phone had been unregistered. I guess authentication had switched to nodered. I re-authenticated my phone, but then had issues sending messages out. So I repeated the captcha and registered again in nodered. The phone can wait for now.
Next it was a case of testing out some simple messages.
There are two ways of constructing a message – see the examples below.
1) use JSON to send it:
“content”: “This is a test”
2) simply use msg.payload.content and input the message directly (as a string).
In order to receive the message you just hook up a debug to the receive node. Obviously you could use something more elaborate to broadcast or alert, but for now this is fine.
See below for an example where you could essentially send a signal message of on or off to control a lamp (on or off strings would be the outputs of the switch node).
Having gone through the hassle of getting it installed, registered and working, I’m happy to tick this box. There are some drawbacks that I’ve found though.
- By registering my number in nodered it essentially unregistered my phone, so if you wanted to communicate with the home, you’re going to want an additional number to register.
- It was quite painful to get all of this set up. Am sure someone will refine the node further to include the dependencies to allow it to install straight away without the additional execution steps I needed to go through, it might just take some time, or someone will end up forking it. I want to point out that these steps were needed to get it under the node-red add-on in Home-Assistant and not necessary for a clean installation in docker (I tried both ways).
- Another issue I had was that I needed to make sure I only had one signal receive node on the flow. If I had more than one, it meant that I was having issues receiving anything. Again, probably an initial teething problem but something to be mindful of.
As I already have telegram set up in nodered, I think I prefer to use that, as it doesn’t appear to suffer from any of the drawbacks mentioned above. I will say this, that the documentation on using this node is excellent and can be found here. You can see some of the more advanced features that you can add to your flows including attachments and pictures etc, as well as time expiry. For my needs I didn’t want to get into that.
Gausma and Fanuch were very helpful and responsive in helping to resolve some teething problems I had getting it to work.
If your interested in sharing your own solutions, tips and tricks with like minded people perhaps you’d consider joining our facebook group. The aim of this group will hopefully be more show and tell rather than support, but that’s not to say we can’t lend a helping hand!