-
Notifications
You must be signed in to change notification settings - Fork 1
/
sensors.yaml
27 lines (27 loc) · 894 Bytes
/
sensors.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sensor:
- platform: template
sensors:
greeting:
friendly_name: "Greeting"
value_template: >
{% set current_hour = now().hour %}
{% if current_hour >= 6 and current_hour < 9 %}
God morgen Sebastian
{% elif current_hour >= 9 and current_hour < 12 %}
God formiddag Sebastian
{% elif current_hour >= 12 and current_hour < 18 %}
God ettermiddag Sebastian
{% elif current_hour >= 18 and current_hour < 24 %}
God kveld Sebastian
{% else %}
God natt Sebastian
{% endif %}
current_lights_off:
friendly_name: Lights on and off
unit_of_measurement: "on"
value_template: >
{% set total = 0 %}
{% if is_state('light.gronn_sofalampe_gronn_sofalampe_turned_on', 'on') %}
{% set total = total + 1 %}
{% endif %}
{{total}}