initial commit

This commit is contained in:
2022-12-20 21:26:47 +01:00
commit 2962a6db69
722 changed files with 63886 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
platform: template
sensors:
harmonyhub_status:
friendly_name: "Harmony Hub Status"
value_template: "{{ states.remote.harmony_hub.attributes.current_activity }}"

View File

@@ -0,0 +1,115 @@
---
trigger:
platform: time_pattern
minutes: "/1"
sensor:
- name: e-ink Display Data
unique_id: e_ink_display_data
icon: ios:display-2
availability: true
state: "OK"
attributes:
greeting: >
{%- if now() > today_at('18:00') %}
Good evening
{%- elif now() > today_at('12:00') %}
Good afternoon
{%- elif now() > today_at('5:00') %}
Good morning
{%- else %}
Good night
{%- endif %}
weather_condition_now: >
{% set cond_now = states('weather.forecast_home') %}
{% if states('sun.sun') == 'below_horizon' %}
{% if cond_now == 'sunny' %} night {% elif cond_now == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond_now }} {% endif %}
{% else %}
{{ cond_now }}
{% endif %}
weather_condition_0: >
{% set cond0 = state_attr('weather.forecast_home', 'forecast')[0].condition %}
{% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
{% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
{% set cond0_time = as_timestamp(state_attr('weather.forecast_home', 'forecast')[0].datetime) %}
{% if cond0_time > next_setting and cond0_time < next_rising %}
{% if cond0 == 'sunny' %} night {% elif cond0 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond0 }} {% endif %}
{% else %}
{{ cond0 }}
{% endif %}
weather_temperature_0: >
{{ state_attr('weather.forecast_home', 'forecast')[0].temperature | round }}
weather_timestamp_0: >
{{ as_timestamp(state_attr('weather.forecast_home', 'forecast')[0].datetime) | timestamp_custom('%a') }}
weather_condition_1: >
{% set cond1 = state_attr('weather.forecast_home', 'forecast')[1].condition %}
{% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
{% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
{% set cond1_time = as_timestamp(state_attr('weather.forecast_home', 'forecast')[1].datetime) %}
{% if cond1_time > next_setting and cond1_time < next_rising %}
{% if cond1 == 'sunny' %} night {% elif cond1 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond1 }} {% endif %}
{% else %}
{{ cond1 }}
{% endif %}
weather_temperature_1: >
{{ state_attr('weather.forecast_home', 'forecast')[1].temperature | round }}
weather_timestamp_1: >
{{ as_timestamp(state_attr('weather.forecast_home', 'forecast')[1].datetime) | timestamp_custom('%a') }}
weather_condition_2: >
{% set cond2 = state_attr('weather.forecast_home', 'forecast')[2].condition %}
{% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
{% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
{% set cond2_time = as_timestamp(state_attr('weather.forecast_home', 'forecast')[2].datetime) %}
{% if cond2_time > next_setting and cond2_time < next_rising %}
{% if cond2 == 'sunny' %} night {% elif cond2 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond2 }} {% endif %}
{% else %}
{{ cond2 }}
{% endif %}
weather_temperature_2: >
{{ state_attr('weather.forecast_home', 'forecast')[2].temperature | round }}
weather_timestamp_2: >
{{ as_timestamp(state_attr('weather.forecast_home', 'forecast')[2].datetime) | timestamp_custom('%a') }}
weather_condition_3: >
{% set cond3 = state_attr('weather.forecast_home', 'forecast')[3].condition %}
{% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
{% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
{% set cond3_time = as_timestamp(state_attr('weather.forecast_home', 'forecast')[3].datetime) %}
{% if cond3_time > next_setting and cond3_time < next_rising %}
{% if cond3 == 'sunny' %} night {% elif cond3 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond3 }} {% endif %}
{% else %}
{{ cond3 }}
{% endif %}
weather_temperature_3: >
{{ state_attr('weather.forecast_home', 'forecast')[3].temperature | round }}
weather_timestamp_3: >
{{ as_timestamp(state_attr('weather.forecast_home', 'forecast')[3].datetime) | timestamp_custom('%a') }}
afval_today: >
{{ states('sensor.afvalinfo_thuis_afval_voor_vandaag') }}
afval_tomorrow: >
{{ states('sensor.afvalinfo_thuis_afval_voor_morgen') }}
travel_Best_time: >
{{ state_attr('sensor.werk_best','duration') | round(2) }}
travel_Best_name: >
{{ state_attr('sensor.werk_best','friendly_name') }}
travel_ASML_time: >
{{ state_attr('sensor.werk_asml','duration') | round(2) }}
travel_ASML_name: >
{{ state_attr('sensor.werk_asml','friendly_name') }}
travel_GGD_time: >
{{ state_attr('sensor.werk_ggd','duration') | round(2) }}
travel_GGD_name: >
{{ state_attr('sensor.werk_ggd','friendly_name') }}
sun_next_rising: >
{{ state_attr('Sun.sun', 'next_rising') }}
sun_next_setting: >
{{ state_attr('Sun.sun', 'next_setting') }}
moon_phase_icon: >
{{ state_attr('sensor.moon_phase', 'icon') }}
media_playing_status: >
{{ states('media_player.keuken') }}
media_playing_title: >
{{ state_attr('media_player.keuken', 'media_title') | title }}
media_playing_artist: >
{{ state_attr('media_player.keuken', 'media_artist') | title }} (on {{ state_attr('media_player.office_sonos', 'media_channel') | title }})

View File

@@ -0,0 +1,22 @@
---
sensor:
- unique_id: ha_uptime_phrase
name: Ha uptime phrase
icon: mdi:history
state: >-
{%- set up = now().timestamp()-as_timestamp(states('sensor.uptime')) %}
{%- macro phrase(name,divisor,mod=None) %}
{%- set value = ((up//divisor) % (mod if mod else divisor))|int %}
{%- set end = 's' if value > 1 else '' %}
{{- '{} {}{}'.format(value,name,end) if value|int > 0 else ''}}
{%- endmacro %}
{%- set values = [phrase('week',60*60*24*7),
phrase('day',60*60*24,7),
phrase('hour',60*60,24),
phrase('min',60),
phrase('sec',1,60)]
|select('!=','')|list %}
{{values[:-1]|join(', ') ~ ' and ' ~ values[-1] if values|length > 1 else
values|first}}

View File

@@ -0,0 +1,36 @@
---
sensor:
- name: Temperatuur_Slaapkamer_Luuk
unique_id: kamer_luuk_temperatuur
unit_of_measurement: "°C"
device_class: temperature
state: >
{{ state_attr('climate.kamer_luuk','current_temperature') }}
- name: Temperatuur_Zolder_Werkkamer
unique_id: Temperatuur_Zolder_Werkkamer
unit_of_measurement: "°C"
device_class: temperature
state: >
{{ state_attr('climate.ac_zolder','current_temperature') }}
- name: Temperatuur_Badkamer
unique_id: Temperatuur_Badkamer
unit_of_measurement: "°C"
device_class: temperature
state: >
{{ state_attr('climate.Badkamer','current_temperature') }}
- name: Temperatuur_Woonkamer
unique_id: Temperatuur_Woonkamer
unit_of_measurement: "°C"
device_class: temperature
state: >
{{ state_attr('climate.woonkamer','current_temperature')}}
- name: Temperatuur_Hal
unique_id: Temperatuur_Hal
unit_of_measurement: "°C"
device_class: temperature
state: >
{{ state_attr('climate.speel_hal', 'current_temperature') }}