32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
---
|
|
#### Scala-Taverna motion custom Sensor
|
|
- platform: template
|
|
sensors:
|
|
scala_taverna_motion:
|
|
unique_id: scala_taverna_motion
|
|
friendly_name: Scala Taverna Motion Sensor
|
|
value_template: >-
|
|
{% if states('binary_sensor.presenza_bassa_scala_taverna_occupancy') == 'on' or states('binary_sensor.presenza_alta_scala_taverna_occupancy') == 'on' %}
|
|
on
|
|
{% else %}
|
|
off
|
|
{% endif %}
|
|
icon_template: mdi:motion-sensor
|
|
|
|
entities_count:
|
|
friendly_name: "Number of Entities"
|
|
value_template: >-
|
|
{{ states | rejectattr('state', 'eq', 'unavailable') | list | count}}
|
|
na_entities_count:
|
|
friendly_name: "Number of NA Entities"
|
|
value_template: >-
|
|
{{ states | selectattr('state', 'eq', 'unavailable') | map(attribute='entity_id') | list | count }}
|
|
holiday:
|
|
friendly_name: "Holiday"
|
|
value_template: >-
|
|
{% if states.calendar.holidays_in_italy.state == 'on' %}
|
|
{{ states.calendar.holidays_in_italy.attributes.message }}
|
|
{% else %}
|
|
none
|
|
{% endif %}
|