-
Notifications
You must be signed in to change notification settings - Fork 2
/
configuration.yaml
65 lines (62 loc) · 1.92 KB
/
configuration.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Da inserire nella sezione sensor:
# Prodotto da conferire in base al giorno
# Giorni:
# 0 = Lunedì, 1 = Martedì, 2 = Mercoledì, ecc...
# Sostituire il prodotto da conferire in base al giorno della settimana
sensor:
- platform: template
sensors:
raccoltadifferenziata:
entity_id: sensor.date
friendly_name: "Dalle 20 alle 07" #Orario di conferimento
value_template: >-
{% if now().weekday() == 0 -%}
Plastica e Indifferenziato
{%- elif now().weekday() == 1 -%}
Umido
{%- elif now().weekday() == 2 -%}
Carta e Cartone
{%- elif now().weekday() == 3 -%}
Indifferenziata
{%- elif now().weekday() == 4 -%}
Umido
{%- elif now().weekday() == 5 -%}
Non puoi conferire nulla oggi
{%- elif now().weekday() == 6 -%}
Umido
{%- endif %}
# Giorno della settimana
- platform: template
sensors:
giornosettimana:
entity_id: sensor.date
friendly_name: "Giorno della Settimana"
value_template: >-
{% if now().weekday() == 0 -%}
Lunedì
{%- elif now().weekday() == 1 -%}
Martedì
{%- elif now().weekday() == 2 -%}
Mercoledì
{%- elif now().weekday() == 3 -%}
Giovedì
{%- elif now().weekday() == 4 -%}
Venerdì
{%- elif now().weekday() == 5 -%}
Sabato
{%- elif now().weekday() == 6 -%}
Domenica
{%- endif %}
#Automazione che ogni 2 ore verifica il giorno della settimana e il prodotto da conferire
#Da inserire nella sezione automation:
automation:
- alias: 'differenziata_updater'
trigger:
- platform: time_pattern
minutes: '/120'
seconds: 0
action:
- service: homeassistant.update_entity
entity_id: sensor.giornosettimana
- service: homeassistant.update_entity
entity_id: sensor.raccoltadifferenziata