Use Signal Messenger for Notifications

Got it to work, but can’t send a photo notification.

here is the telegram photo notification I use for sending photo via telegram

alias: Telegram motion alert
description: Send motion alert to telegram
trigger:
  - platform: state
    entity_id:
      - binary_sensor.gate_line_crossing
    to: 'on'
condition: []
action:
  - service: telegram_bot.send_photo
    data:
      username: camera username
      password: camera password 
      authentication: digest
      url: camera still image URL 
      caption: sent from HA
mode: single

but it doesn’t work with signal I tried following

alias: Signal messenger photo
description: ''
trigger:
  - platform: state
    entity_id:
      - binary_sensor.gate_line_crossing
    to: 'on'
condition: []
action:
  - service: notify.signal
    data:
      message: Person detected on Front Camera!
      data:
        verify_ssl: false
        username: camera username
        password: camera password
        authentication: digest
        urls: camera url
mode: single

Hi,
how can i pass a recipient by template to Signal Messanger?
I tried this:
notify:

  • name: signal_to_variable
    platform: signal_messenger
    url: “http://10.10.10.10:8080
    number: “+49xxxxxxxx” # the sender number
    recipients: “{{ states(‘input_text.notify_recipient_helper’) }}”
Logger: homeassistant.core
Source: components/signal_messenger/notify.py:104
First occurred: 18:22:25 (1 occurrences)
Last logged: 18:22:25

Error executing service: <ServiceCall notify.signal_to_variable (c:01G8KBEN9W69E47XEK44WB3M5N): message=Template("Test123 by Ralf@HA")>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 229, in _async_notify_message_service
    await self.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 205, in async_send_message
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 109, in send_message
    raise ex
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 104, in send_message
    self._signal_cli_rest_api.send_message(
  File "/usr/local/lib/python3.10/site-packages/pysignalclirestapi/api.py", line 221, in send_message
    raise exc
  File "/usr/local/lib/python3.10/site-packages/pysignalclirestapi/api.py", line 216, in send_message
    raise SignalCliRestApiError(json_resp["error"])
pysignalclirestapi.api.SignalCliRestApiError: Failed to send message: No valid characters found.

I just installed this and I’m having troubles configuring group messages. What should I use as my group id?? For example:

                
[{"name":"MY GROUP","id":"group.OWNlZEE3ekFuTGpXa2h6VjBuekkybC96VzExTVNPMXXXTRudEttTTU2dz0=","internal_id":"9cedA7zAXXXkhzV0nz
I2l/zW11MSO1U3e4ntKmM56w=","members":["+165XXX"],"blocked":false,"pending_invites":[],"pending_requests":["+14XX9","+13129
6XX"],"invite_link":"","admins":["+1650XX"]}]r
                                                                                                        

Is the group id group.OWNlZEE3ekFuTGpXa2h6VjBuekkybC96VzExTVNPMXXXTRudEttTTU2dz0= or 9cedA7zAXXXkhzV0nzI2l/zW11MSO1U3e4ntKmM56w= or something else?

There is an issue with signal see here.
If you use the docker version of signal-cli-rest-ap you can pull bbernhard/signal-cli-rest-api:0.112-dev wich has a fix included.

How does one force a new line in a message?

    New Media Added:
    
    In Library:
   
    On:

That would be a \n for ‘newline’.

Thanks, I tried it multiple ways and doesn’t seem to work. Perhaps because it’s following:

New Media Added:
{{state_attr('sensor.plexserver_library_tv_recordings','last_added_item')}} \n

In an attempt to get it to work with \n, I noticed if I hit the enter key twice where I want the space it adds 1 space. Doesn’t seem right but…

Try something like:

  data:
    message: >
      Status: {{state_attr('sensor.plexserver_library_tv_recordings','last_added_item')}}

      Something else: {{ more jinja }}

That works, but only if I hit the enter key twice in the automation setup. so it ends up looking like the below:

I have a feeling this is a result of Signal not having any html or markdown support, but IDK…

Thanks for your help.

So this:

data:
    message: >
      Status: {{state_attr('sensor.plexserver_library_tv_recordings','last_added_item')}}

      
      Something else: {{ more jinja }}

Gives me this

1 Like

Hello Community,

I am in the process of converting my home automation from Fhem to HA.
At the moment I am integrating Signal.
After desperately trying to register a landline number (Failed to register: [413] Rate limit exceeded), I had to switch to a mobile number.
Basically Signal works now.
However, I can only enter the receivers statically in the configuration. It would be nicer if I could enter the receiver in the automation under Target, but the entry is unfortunately ignored.
As a workaround, I have now added a second signal notify device for another receiver.
Is there a nicer solution for this problem, or do I have to create a separate Notify-Device for each separate receiver?

Thanks in advance

Best regards
rubinho

I believe, currently you would need to create separate notify statements in your yaml file.

thank you for the answer.
Even if I would have preferred to read something else. :slight_smile:

1 Like

I had this working previously. I am reset it up and was getting an unknown error. I fixed that by adding a + to my sender number in the home assistant yaml config. it looks like it is working when sending from home assistant. But I never get the message. using - group.XXXXXXXXXXX as the recipient. Here are the logs from Signal Api Docker container:

Hi,
iam trying to register my Landline Line, but always i get a “invalid captcha given”
I use the Addon Version of HA

I use for the registration this command:

Blockquote
curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+49xxxxxxxxxxxx' -d '{"captcha":"<CAPTCHA_HERE>", "use_voice": true}'

What is the code, i have to insert in the command for the captcha?

I tried:

Blockquote
signal-hcaptcha.5fad97ac-7d06-4e44-b18a-b950b20148ff.registration.P1_eyJ0eXAiOiJKV1QiLCJhbG...............
or
signalcaptcha://signal-hcaptcha.5fad97ac-7d06-4e44-b18a-b950b20148ff.registration.P1_eyJ0eX..............

what i am doing wrong, has anybody a tip?

Hi

Have you tried this method for getting a captcha first?

Yes i do.Maybe it has to do with the fact that I copy and paste the wrong captcha code from the Firefox console. I once used the code that starts with “signalcaptcha://” and the one that starts with “signal-hcaptcha.5fad…”. But I always get the error that the captcha code is invalid.

signalcaptcha:// is not part of the code, it precedes it. Just to make sure, since you said that the code starts with that. It doesn’t.

did you ever figure this out? I want to ensure I can configure group messages before I embark on this journey.

Yes, I got it to work but it was so long ago that I don’t remember how. It has been working well for a long time and I use it daily.

1 Like