Add REST command setup instructions - service registration method (v2.0.4)
This commit is contained in:
93
README.md
93
README.md
@@ -7,7 +7,6 @@ Send voice notifications via SIP phone calls from Home Assistant.
|
||||
- 📞 Place SIP calls from automations
|
||||
- 🔊 Play audio from HTTP/HTTPS URLs (MP3, WAV, etc.)
|
||||
- 🗣️ Text-to-speech support
|
||||
- ⚡ One-step installation (add-on includes integration)
|
||||
- 🔧 Configurable call duration
|
||||
|
||||
## Installation
|
||||
@@ -18,7 +17,7 @@ Settings → Add-ons → Add-on Store → ⋮ (menu) → Repositories
|
||||
|
||||
Add URL:
|
||||
```
|
||||
https://git.aymerick.fr/openclaw-bot/ha-sip-notifier
|
||||
https://git.aymerick.fr/Aymerick/ha-sip-notifier
|
||||
```
|
||||
|
||||
### 2. Install the "SIP Voice Notifier" add-on
|
||||
@@ -46,9 +45,28 @@ default_duration: 30
|
||||
|
||||
### 4. Start the add-on
|
||||
|
||||
Click Start. The service `sip_notifier.send_notification` will be automatically available!
|
||||
Click Start.
|
||||
|
||||
### 5. Restart Home Assistant (if needed)
|
||||
### 5. Add the service to Home Assistant
|
||||
|
||||
**IMPORTANT:** Add this to your `/config/configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
rest_command:
|
||||
sip_notification:
|
||||
url: "http://088d3b92-sip-notifier:8099/send_notification"
|
||||
method: POST
|
||||
content_type: "application/json"
|
||||
payload: >
|
||||
{
|
||||
"destination": "{{ destination }}",
|
||||
{% if audio_url is defined %}"audio_url": "{{ audio_url }}",{% endif %}
|
||||
{% if message is defined %}"message": "{{ message }}",{% endif %}
|
||||
"duration": {{ duration | default(30) }}
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Restart Home Assistant
|
||||
|
||||
Settings → System → Restart
|
||||
|
||||
@@ -57,7 +75,7 @@ Settings → System → Restart
|
||||
### Play Audio from URL
|
||||
|
||||
```yaml
|
||||
service: sip_notifier.send_notification
|
||||
service: rest_command.sip_notification
|
||||
data:
|
||||
destination: "+15551234567"
|
||||
audio_url: "https://example.com/alert.mp3"
|
||||
@@ -67,7 +85,7 @@ data:
|
||||
### Text-to-Speech
|
||||
|
||||
```yaml
|
||||
service: sip_notifier.send_notification
|
||||
service: rest_command.sip_notification
|
||||
data:
|
||||
destination: "+15551234567"
|
||||
message: "Emergency! Water leak detected!"
|
||||
@@ -84,11 +102,49 @@ automation:
|
||||
entity_id: binary_sensor.water_leak
|
||||
to: "on"
|
||||
action:
|
||||
service: sip_notifier.send_notification
|
||||
data:
|
||||
destination: "+15551234567"
|
||||
message: "EMERGENCY! Water leak detected in basement!"
|
||||
duration: 45
|
||||
- service: rest_command.sip_notification
|
||||
data:
|
||||
destination: "+15551234567"
|
||||
message: "EMERGENCY! Water leak detected in basement!"
|
||||
duration: 45
|
||||
```
|
||||
|
||||
## Optional: Friendlier Service Name
|
||||
|
||||
Add a script to make it easier to use:
|
||||
|
||||
```yaml
|
||||
script:
|
||||
sip_voice_notification:
|
||||
alias: "Send Voice Notification"
|
||||
fields:
|
||||
destination:
|
||||
description: "Phone number"
|
||||
required: true
|
||||
audio_url:
|
||||
description: "Audio URL"
|
||||
required: false
|
||||
message:
|
||||
description: "TTS message"
|
||||
required: false
|
||||
duration:
|
||||
description: "Duration"
|
||||
default: 30
|
||||
sequence:
|
||||
- service: rest_command.sip_notification
|
||||
data:
|
||||
destination: "{{ destination }}"
|
||||
audio_url: "{{ audio_url | default('') }}"
|
||||
message: "{{ message | default('') }}"
|
||||
duration: "{{ duration }}"
|
||||
```
|
||||
|
||||
Then use:
|
||||
```yaml
|
||||
service: script.sip_voice_notification
|
||||
data:
|
||||
destination: "+15551234567"
|
||||
message: "Test message"
|
||||
```
|
||||
|
||||
## SIP Providers
|
||||
@@ -101,13 +157,22 @@ automation:
|
||||
- Cost: ~$0.009/min
|
||||
- Canadian provider, good value
|
||||
|
||||
## Documentation
|
||||
## Troubleshooting
|
||||
|
||||
Full documentation available in the add-on README.
|
||||
### Service not found
|
||||
|
||||
1. Check you added `rest_command` to configuration.yaml
|
||||
2. Restart Home Assistant
|
||||
3. Check for syntax errors in configuration.yaml
|
||||
|
||||
### Call fails
|
||||
|
||||
Check add-on logs:
|
||||
Settings → Add-ons → SIP Voice Notifier → Log
|
||||
|
||||
## Support
|
||||
|
||||
Issues and questions: https://git.aymerick.fr/openclaw-bot/ha-sip-notifier/issues
|
||||
Repository: https://git.aymerick.fr/Aymerick/ha-sip-notifier
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user