Update sensor.fritzbox_callmonitor.markdown (#2685)

* Update sensor.fritzbox_callmonitor.markdown

Added a configuration example for callmonitor push notifications

* Update sensor.fritzbox_callmonitor.markdown

Added raw/endraw as suggested by @fabaff. Elaborated notification text a bit more.
This commit is contained in:
nodomain 2017-06-09 17:47:04 +02:00 committed by Fabian Affolter
parent e2d68f265f
commit d9735889a5

View File

@ -56,3 +56,30 @@ sensor:
- '+4989'
- '089'
```
### {% linkable_title Send notifications on state change %}
This example shows how to send notifications whenever the sensor's state changes. You will get notified both when you receive a call and also when a call is placed.
```yaml
# Example configuration.yml entry.
automation:
- alias: "Notify about phone state"
trigger:
- platform: state
entity_id: sensor.phone
action:
- service: notify.notify
data:
title: "Phone"
message: >-
{% raw %}{% if is_state("sensor.phone", "idle") %}
Phone is idle
{% elif is_state("sensor.phone", "dialing") %}
Calling {{ states.sensor.phone.attributes.to_name }} ({{ states.sensor.phone.attributes.to }})
{% elif is_state("sensor.phone", "ringing") %}
Incoming call from {{ states.sensor.phone.attributes.from_name }} ({{ states.sensor.phone.attributes.from }})
{% else %}
Talking to {{ states.sensor.phone.attributes.with_name }} ({{ states.sensor.phone.attributes.with }})
{% endif %}{% endraw %}
```