Use Signal Messenger for Notifications

I updated the hassio addon, but I’m not able to send messages yet. It seems the official integration still have some problems: https://github.com/home-assistant/home-assistant/issues/30838

2 Likes

@mbitard, Great add-on! Thank you so much for writing it!

When I try to create a hassio snapshot, the signal backup ends up being rather large:

tar -tvf 6ad2973f.tar
drwx------ root/root         0 2020-01-23 21:03:00 ./
-rw-r--r-- root/root 164192076 2020-01-23 21:02:59 ./4a36bbd1_signal.tar.gz
-rw-r--r-- root/root       145 2020-01-23 21:02:59 ./addons_local.tar.gz
-rw-r--r-- root/root       858 2020-01-23 20:56:30 ./core_check_config.tar.gz
-rw-r--r-- root/root      1130 2020-01-23 20:56:30 ./core_configurator.tar.gz
-rw-r--r-- root/root      6945 2020-01-23 20:56:30 ./core_ssh.tar.gz
-rw-r--r-- root/root     35411 2020-01-23 21:03:00 ./homeassistant.tar.gz
-rw-r--r-- root/root       138 2020-01-23 21:02:59 ./share.tar.gz
-rw-r--r-- root/root      1119 2020-01-23 21:03:00 ./snapshot.json
-rw-r--r-- root/root      3146 2020-01-23 21:02:59 ./ssl.tar.gz

Looking deeper into signal.tar.gz, it looks like it’s including many top-level directories:

tar --exclude='*/*' -tvf layer.tar
drwxrwxr-x 0/0               0 2020-01-23 20:41 etc/
drwxr-xr-x 0/0               0 2019-12-02 03:06 lib/
drwxr-xr-x 1000/1000         0 2020-01-23 20:42 libmatthew-java-0.8.1/
drwxr-xr-x 0/0               0 2020-01-23 20:41 run/
drwxrwxrwt 0/0               0 2020-01-23 20:42 tmp/
drwxr-xr-x 0/0               0 2020-01-23 20:40 usr/
drwxr-xr-x 0/0               0 2019-12-02 03:06 var/

Any ideas?

@waybeyond, It appears I need to add snapshot_exclude to the config.json and exclude all the not needed stuff.

I did not know about that, thanks!

I created an issue here to track that

1 Like

Excellent! Thank you! Again, great add-on :slight_smile:

FYI, you can know use the official signal component with my hassion addon.

I’m currently working on sending messages to homeassistant using signal, so I’ll be able to better interact with home assistant

3 Likes

I’m kind of stuck with the conversation service, I created a new topic here: [API] Calling conversation/process does not return the speech text if someone is willing to help :slight_smile:

Nevermind, I found a solution.

For those who want to try it, update the addon.

Then configure your conversations:

conversation:
  intents:
    Test:
      - Test
      - This is a test

Then configure your Intents:

intent_script:
  Test:
    speech:
      text: "Hello there"

And by sending Test or This is a test via signal, you should get Hello there as a reply.

I’ll update the README soon, let me know if something does not work or if you spot limitations.

1 Like

That looks like a great alternative to the java cli :slight_smile: Thanks !
Does it provide the same functionalities or there are limitations ?

Is anyone already working on packaging that version as an addon ?

Not sure about the functionality, basically it does send messages :wink:

I need to have a look at the docs regarding HA addons, then i can probably think about creating builds for this too. But generally, the gateway is more flexible and HA usage is just one option.

1 Like

Thanks Stefan :slight_smile:
Installed “Signal Web Gateway” docker image and got it running quickly with your published detailed instructions.
What I like is that it is really lightweight (image is 22.4MB, RAM/CPU usage extremely low, do not require a jdk) and message are sent extremely fast.
Switched all my telegram notification to signal :slight_smile:

What I meant is like for example the conversation service that Michael put together that seems very interesting.
Also does “Signal Web Gateway” allow to send picture using the post json method ? Tried with file: but does not go through.

On a side note:
After testing your api, I also tried the addon from Michael but unfortunately it didn’t yet work for me “Failed to install addon, [object Object]”. Then it did install. But I saw it required to install the java cli and do other preparation step, so I stopped there for the moment. I should try using the signal-cli that is in the underlying docker image but don’t want to mess up the signal registration I already did.

I went with the java version because it was the only I could find that allowed bidirectional communication, and I wanted to add the conversation service. IMHO, that explains why you see a higher load on my addon, because the service is always running and listening to messages. So it’s not really comparable to the go version, which “does stuff” only when you want to send messages.

2 Likes

Great! Now I can even talk to home assistant!

Hello,

Hope someone can help me out / I can help others out.

I initially struggled with the “User is not registered” error in the logs of the hassio addon.

It turns out, this error does not make clear whether the file generated by signal-cli has been found or not. In fact, it appears to simply be saying “cannot find this file in the specified directory”. As it turns out, assuming this is your configuration of the addon:

phone_number: 'NUMBER'
signal_config_path: /config/.signal

Then the actual expected path would be /config/.signal/data/NUMBER

Having sorted this out, when I send test messages to NUMBER from my personal number, I can see it coming through in the logs, and get a message in return - “Something bad happened”. edit: having configured an intent_script: and conversation: in configuration.yaml, I get a successful Hello there! back as expected.

This is all good and well, but I am unable to use notify.signal successfully to send a message. I am also unable to run signalmessenger.get_groups.

I get the following error when running notify.signal:

HTTPConnectionPool(host='4a36bbd1-signal', port=5000): Max retries exceeded with url: /message (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xad892270>: Failed to establish a new connection: [Errno -3] Try again'))

Any tips?

edit: I have made an issue on GitHub, see here

Sorry, I did not get a notification about this message.
I replied to you on the github issue, it’s a better place anyway!

Having gotten it all working, I feel like I’m missing something obvious - is there a way to use, for example, AppDaemon to code responses (and actions) to messages from users?

Not knowing anything about the current state/capabilities of the plugins or the coversation integration - I am wondering if the inbound message is perhaps passed as an event you could perhaps capture with AppDaemon and write your intents/actions there? Just a thought.

-pd

I fixed the issue with the huge snapshot by the way! https://github.com/agileek/hassio-addons/issues/5

3 Likes

The message is sent directly to the conversation/process intent. You can use the intent_script to trigger any action and do what you want with it no?

@mbitard I’m having issue with receiving the message on HA. I can send just fine (and can see in the Addon’s log that message is sent), but if I send message back to HA, I don’t see anything in the Addon’s log. Any idea? Thanks

Hello, can you open an issue here please: https://github.com/agileek/hassio-addons/issues it’ll be easier to track your problem and it could help other people :wink:

Put in the issue as many details as possible (version of the addon, of home assistant, …)

Thanks!