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,17 @@
openhasp:
plate01:
objects:
- obj: "p1b2" # switch, checkbox or btn with toggle true
properties:
"val": '{{ 1 if is_state("light.lamp_zolder_werkbank", "on") else 0 }}'
"text": '{{ "\uE6E8" if is_state("light.lamp_zolder_werkbank", "on") else "\uE335" | e }}'
event:
"down":
- service: homeassistant.toggle
entity_id: "light.lamp_zolder_werkbank"
- obj: "p0b1"
properties:
"text": "{{ states('sensor.zolder_temperatuur') }}"
- obj: "p0b2"
properties:
"text_color": "{% if -30 <= state_attr('openhasp.plate01','rssi') |int %}green{% elif -31 > state_attr('openhasp.plate01','rssi') |int >= -50 %}orange{% elif -51 > state_attr('openhasp.plate01','rssi') |int >= -80 %}tomato{% else %}red{% endif %}"

View File

@@ -0,0 +1,22 @@
template:
- 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,176 @@
# mqtt:
# sensor:
# - name: "zigbee2mqtt"
# state_topic: "zigbee2mqtt/bridge/state"
# Input select for Zigbee2MQTT debug level
input_select:
zigbee2mqtt_log_level:
name: Zigbee2MQTT Log Level
options:
- debug
- info
- warn
- error
initial: info
icon: mdi:format-list-bulleted
# Input number for joining time remaining (in minutes)
input_number:
zigbee2mqtt_join_minutes:
name: "Zigbee2MQTT join minutes"
initial: 2
min: 1
max: 5
step: 1
mode: slider
# Input text to input Zigbee2MQTT friendly_name for scripts
input_text:
zigbee2mqtt_old_name:
name: Zigbee2MQTT Old Name
initial: ""
zigbee2mqtt_new_name:
name: Zigbee2MQTT New Name
initial: ""
zigbee2mqtt_remove:
name: Zigbee2MQTT Remove
initial: ""
# Input boolean to set the force remove flag for devices
input_boolean:
zigbee2mqtt_force_remove:
name: Zigbee2MQTT Force Remove
initial: false
icon: mdi:alert-remove
# Scripts for renaming & removing devices
script:
zigbee2mqtt_rename:
alias: Zigbee2MQTT Rename
sequence:
service: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/request/device/rename
payload_template: >-
{
"from": "{{ states.input_text.zigbee2mqtt_old_name.state | string }}",
"to": "{{ states.input_text.zigbee2mqtt_new_name.state | string }}"
}
zigbee2mqtt_remove:
alias: Zigbee2MQTT Remove
sequence:
service: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/request/device/remove
payload_template: >-
{
"id": "{{ states.input_text.zigbee2mqtt_remove.state | string }}",
"force": {% if states.input_boolean.zigbee2mqtt_force_remove.state == "off" %}false{% else %}true{% endif %}
}
# Timer for joining time remaining (254 sec)
timer:
zigbee_permit_join:
name: Time remaining
duration: 254
mqtt:
sensor:
# Sensor for monitoring the bridge state
- name: Zigbee2MQTT Bridge state
unique_id: zigbee2mqtt_bridge_state_sensor
state_topic: "zigbee2mqtt/bridge/state"
icon: mdi:router-wireless
# Sensor for Showing the Zigbee2MQTT Version
- name: Zigbee2MQTT Version
unique_id: zigbee2mqtt_version_sensor
state_topic: "zigbee2mqtt/bridge/info"
value_template: "{{ value_json.version }}"
icon: mdi:zigbee
# Sensor for Showing the Coordinator Version
- name: Zigbee2MQTT Coordinator Version
unique_id: zigbee2mqtt_coordinator_version_sensor
state_topic: "zigbee2mqtt/bridge/info"
value_template: "{{ value_json.coordinator.meta.revision }}"
icon: mdi:chip
- name: Zigbee2mqtt Networkmap
unique_id: zigbee2mqtt_networkmap_sensor
# if you change base_topic of Zigbee2mqtt, change state_topic accordingly
state_topic: zigbee2mqtt/bridge/networkmap/raw
value_template: >-
{{ now().strftime('%Y-%m-%d %H:%M:%S') }}
# again, if you change base_topic of Zigbee2mqtt, change json_attributes_topic accordingly
json_attributes_topic: zigbee2mqtt/bridge/networkmap/raw
# Sensor for monitoring the bridge state
# - name: Zwave2MQTT Bridge state
# unique_id: zwave2mqtt_bridge_state_sensor
# state_topic: "zigbee2mqtt/bridge/state"
# icon: mdi:router-wireless
# Switch for enabling joining
switch:
- name: "Zigbee2MQTT Main join"
unique_id: zigbee2mqtt_main_join_switch
state_topic: "zigbee2mqtt/bridge/info"
value_template: "{{ value_json.permit_join | lower }}"
command_topic: "zigbee2mqtt/bridge/request/permit_join"
payload_on: "true"
payload_off: "false"
automation:
# Automation for sending MQTT message on input select change
- alias: Zigbee2MQTT Log Level
initial_state: "on"
trigger:
platform: state
entity_id: input_select.zigbee2mqtt_log_level
action:
- service: mqtt.publish
data:
payload_template: "{{ states('input_select.zigbee2mqtt_log_level') }}"
topic: zigbee2mqtt/bridge/request/config/log_level
# Automation to start timer when enable join is turned on
- id: zigbee_join_enabled
alias: Zigbee Join Enabled
trigger:
platform: state
entity_id: switch.zigbee2mqtt_main_join
to: "on"
action:
service: timer.start
entity_id: timer.zigbee_permit_join
data_template:
duration: "{{ '00:0%i:00' % (states('input_number.zigbee2mqtt_join_minutes') | int ) }}"
# Automation to stop timer when switch turned off and turn off switch when timer finished
- id: zigbee_join_disabled
alias: Zigbee Join Disabled
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.zigbee_permit_join
- platform: state
entity_id: switch.zigbee2mqtt_main_join
to: "off"
action:
- service: timer.cancel
data:
entity_id: timer.zigbee_permit_join
- service: switch.turn_off
entity_id: switch.zigbee2mqtt_main_join
- id: "zigbee2mqtt_create_notification_on_successful_interview"
alias: Zigbee Device Joined Notification
trigger:
platform: mqtt
topic: "zigbee2mqtt/bridge/event"
condition:
condition: template
value_template: '{{trigger.payload_json.type == "device_interview" and trigger.payload_json.data.status == "successful" and trigger.payload_json.data.supported}}'
action:
- service: persistent_notification.create
data_template:
title: Device joined the Zigbee2MQTT network
message: "Name: {{trigger.payload_json.data.friendly_name}},
Vendor: {{trigger.payload_json.data.definition.vendor}},
Model: {{trigger.payload_json.data.definition.model}},
Description: {{trigger.payload_json.data.definition.description}}"

View File

@@ -0,0 +1,27 @@
timer:
wasdroger_delayed_job_completion_timer:
name: wasdroger - Delayed Job Completion Timer
duration: "00:15:00" # <- Notice the time here. Leave as it is (15 min)
restore: true
icon: mdi:tumble-dryer
input_boolean:
wasdroger_job_cycle:
name: wasdroger - Job Cycle
icon: mdi:tumble-dryer
wasdroger_automation_self_trigger:
name: wasdroger - Automation Self-trigger
icon: mdi:tumble-dryer
input_select:
wasdroger_state_machine:
name: wasdroger - State Machine
options:
- unplugged
- idle
- paused
- detached_overload
- job_ongoing
- job_completed
icon: mdi:tumble-dryer

View File

@@ -0,0 +1,95 @@
template:
- trigger:
platform: time_pattern
minutes: "/1"
sensor:
- name: Weatherman Data
unique_id: "0a7476cc-d6c1-40ba-8ae1-606518c34Aaaf"
state: "OK"
attributes:
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') }}
travel_Best_name: >
{{ state_attr('sensor.werk_best','friendly_name') }}
travel_ASML_time: >
{{ state_attr('sensor.werk_asml','duration') }}
travel_ASML_name: >
{{ state_attr('sensor.werk_asml','friendly_name') }}
travel_GGD_time: >
{{ state_attr('sensor.werk_ggd','duration') }}
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') }}