From d9735889a5544076b4983961fe189c5abfb7d6f9 Mon Sep 17 00:00:00 2001 From: nodomain Date: Fri, 9 Jun 2017 17:47:04 +0200 Subject: [PATCH] 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. --- .../sensor.fritzbox_callmonitor.markdown | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source/_components/sensor.fritzbox_callmonitor.markdown b/source/_components/sensor.fritzbox_callmonitor.markdown index d5b07182dc6..7266f9943fa 100644 --- a/source/_components/sensor.fritzbox_callmonitor.markdown +++ b/source/_components/sensor.fritzbox_callmonitor.markdown @@ -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 %} +```