mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
Update signal_messenger.markdown (#26441)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
6f05a80ce1
commit
bc92ef3c19
@ -65,6 +65,40 @@ recipients:
|
||||
type: string
|
||||
{% endconfiguration %}
|
||||
|
||||
|
||||
## Sending messages to Signal to trigger events
|
||||
|
||||
You can use Signal Messenger REST API as a Home Assistant trigger. In this example, we will make a simple chatbot. If you write anything to your Signal account linked to Signal Messenger REST API, the automation gets triggered, with the condition that the number (attribute source) is correct, to take action by sending a Signal notification back with a "Message received!".
|
||||
|
||||
To accomplish this, edit the configuration of Home Assistant, adding a [RESTful resource](/integrations/rest/) as follows:
|
||||
|
||||
```yaml
|
||||
- resource: "http://127.0.0.1:8080/v1/receive/<number>"
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
sensor:
|
||||
- name: "Signal message received"
|
||||
value_template: "{{ value_json[0].envelope.dataMessage.message }}" #this will fetch the message
|
||||
json_attributes_path: $[0].envelope
|
||||
json_attributes:
|
||||
- source #using attributes you can get additional information, in this case, the phone number.
|
||||
```
|
||||
You can create an automation as follows:
|
||||
|
||||
```yaml
|
||||
...
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.signal_message_received
|
||||
attribute: source
|
||||
to: "<yournumber>"
|
||||
action:
|
||||
- service: notify.signal
|
||||
data:
|
||||
message: "Message received!"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
A few examples on how to use this integration as actions in automations.
|
||||
|
Loading…
x
Reference in New Issue
Block a user