-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensor.yaml
executable file
·52 lines (49 loc) · 1.69 KB
/
sensor.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
---
# Weather
- platform: darksky
api_key: !secret dark_sky_api_password
language: 'de'
forecast:
- 0
monitored_conditions:
- summary
- temperature
- hourly_summary
- temperature_high
- wind_speed
- humidity
- pressure
- temperature_low
- precip_intensity
- icon
# HA stats
- platform: systemmonitor
resources:
- type: memory_use_percent
- type: processor_use
- type: disk_use_percent
arg: /
- platform: mqtt
name: garage_door_time_in_state
state_topic: 'garadget/garage/status'
value_template: '{{ value_json.time }}'
- platform: template
sensors:
garage_door_status:
friendly_name: 'Torstatus'
value_template: '{{ states.cover.garage.state }}'
icon_template: '{% if is_state("cover.garage", "closed") %}mdi:garage{% else %}mdi:garage-open{% endif %}'
next_trash:
friendly_name: 'KNX Nächste Müllleerung Fixed length 14'
value_template: '{{ states("sensor.trash_appointment")[0:14] }}'
trash_appointment:
friendly_name: 'Nächste Müllleerung'
value_template: >
{% set trash_date = as_datetime(strptime(state_attr("calendar.marvin_fam_wichmann_de", "start_time"), "%Y-%m-%d %H:%M:%S")).strftime("%d.%m") %}
{% set trash = state_attr("calendar.marvin_fam_wichmann_de", "message") | replace("Kämpfelbach: ", "") %}
{{ trash + " - " + trash_date }}
trash_appointment_days:
friendly_name: 'Tage bis zur nächsten Müllleerung'
value_template: >
{% set trash_date = as_local(as_datetime(strptime(state_attr("calendar.marvin_fam_wichmann_de", "start_time"), "%Y-%m-%d %H:%M:%S"))) %}
{{ (trash_date - as_local(utcnow())).days | int }}