Last active
November 17, 2019 10:22
-
-
Save frog32/a0951119fbb8a2d9d6ffb9dbc6b18f22 to your computer and use it in GitHub Desktop.
hass snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch: | |
- platform: dlink | |
name: coffee | |
host: x.x.x.x | |
username: admin | |
password: !secret dlink_password | |
sensor: | |
- platform: template | |
sensors: | |
coffee_consumption: | |
value_template: "{{float(states.switch.coffee.attributes['power_consumption'].split(' ')[0] if states.switch.coffee else 0)}}" | |
friendly_name: 'Coffee Machine Consumption' | |
unit_of_measurement: 'W' | |
automation: | |
- action: | |
- data: | |
message: Water tank is empty. | |
title: Coffee Machine | |
service: notify.all | |
alias: Coffee Machine tank empty | |
condition: | |
- condition: state | |
entity_id: switch.coffee | |
state: 'on' | |
id: '1514720198787' | |
# heating element was inactive for 15 minutes but machine is still on | |
trigger: | |
- above: '5' | |
below: '500' | |
for: | |
minutes: 15 | |
entity_id: sensor.coffee_consumption | |
platform: numeric_state | |
- action: | |
- data: | |
entity_id: switch.coffee | |
service: switch.turn_on | |
alias: Coffee timer | |
condition: | |
- condition: state | |
entity_id: input_boolean.coffee | |
state: 'on' | |
- condition: template | |
value_template: '{{ (states.input_datetime.coffee.attributes.timestamp | int | timestamp_custom("%H:%M", False)) == (as_timestamp(now()) | int | timestamp_custom("%H:%M", True))}}' | |
id: '1515364229286' | |
trigger: | |
- platform: time | |
minutes: '/1' | |
- platform: state | |
entity_id: switch.coffee | |
to: 'on' | |
for: | |
hours: 12 | |
action: | |
service: notify.notify | |
data: | |
message: Die Kaffee Maschine läuft seit {{ ((now() - states.switch.coffee.last_changed).seconds | |
/ 3600) | round(0) }} stunden | |
title: Kaffee Maschine | |
data: | |
tag: coffee-notification | |
url: https://frog32.duckdns.org/states | |
actions: | |
- action: turn_off_coffee | |
title: Ausschalten | |
icon: https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_power_settings_new_black_24px.svg | |
- alias: turn off coffee machine on turn off button or after 16h | |
trigger: | |
- platform: event | |
event_type: html5_notification.clicked | |
event_data: | |
action: turn_off_coffee | |
- platform: state | |
entity_id: switch.coffee | |
to: 'on' | |
for: | |
hours: 16 | |
action: | |
service: switch.turn_off | |
entity_id: switch.coffee | |
groups: | |
coffee: | |
name: "Kaffeemaschine" | |
control: hidden | |
entities: | |
- switch.coffee | |
- input_boolean.coffee | |
- input_datetime.coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binary_sensor: | |
- platform: template | |
sensors: | |
low_battery_alert: | |
friendly_name: "Battery low" | |
device_class: battery | |
value_template: >- | |
{{ (states.sensor|map(attribute='attributes.battery_level')|list | |
+ states.binary_sensor|map(attribute='attributes.battery_level')|list | |
+ states.plants|map(attribute='attributes.battery')|list) | |
|map('default', 100)|min < 20}} | |
alert: | |
battery: | |
name: Batterien sind fast leer | |
entity_id: binary_sensor.low_battery_alert | |
repeat: | |
- 60 | |
- 1440 | |
skip_first: True | |
notifiers: | |
- all_marc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lovelace ui: | |
entities: | |
- light.advent1 | |
- input_number.advent_speed | |
- input_number.advent_gain | |
- script.advent_rot_weiss | |
show_header_toggle: false | |
theme: Backend-selected | |
title: Weihnachtsbeleuchtung | |
type: entities | |
input_number: | |
advent_speed: | |
name: Speed | |
initial: 100 | |
min: 0 | |
max: 255 | |
advent_gain: | |
name: Gain | |
initial: 100 | |
min: 0 | |
max: 255 | |
light: | |
- platform: mqtt | |
schema: json | |
name: "advent1" | |
state_topic: "home/advent1/status" | |
command_topic: "home/advent1/set" | |
brightness: true | |
color_temp: false | |
effect: true | |
rgb: true | |
white_value: false | |
effect_list: | |
- solid | |
- rainbow | |
- colorloop | |
- gradient | |
- jungle | |
- jungle2 | |
- confetti | |
- lightning | |
- twinkle | |
- twinkle2 | |
scripts: | |
advent_rot_weiss: | |
alias: Rot Weiss | |
sequence: | |
- service: light.turn_on | |
data: | |
entity_id: light.advent1 | |
rgb_color: [255,236,85] | |
- service: light.turn_on | |
data: | |
entity_id: light.advent1 | |
effect: twinkle2 | |
rgb_color: [241,7,0] | |
brightness: 115 | |
- service: input_number.set_value | |
data: | |
entity_id: input_number.advent_speed | |
value: 63 | |
- service: input_number.set_value | |
data: | |
entity_id: input_number.advent_gain | |
value: 106 | |
automation: | |
- action: | |
- data: | |
payload_template: '{"speed": {{ states.input_number.advent_speed.state | int | |
}}, "gain": {{ states.input_number.advent_gain.state | int }} }' | |
topic: home/advent1/set | |
service: mqtt.publish | |
condition: [] | |
id: '1508688054642' | |
trigger: | |
- entity_id: input_number.advent_speed | |
platform: state | |
- entity_id: input_number.advent_gain | |
platform: state | |
alias: Advent options | |
- action: | |
service: light.turn_off | |
entity_id: light.advent1 | |
id: advent_sunrise | |
alias: Sonnenaufgang | |
trigger: | |
- platform: sun | |
event: sunrise | |
- alias: Sonnenuntergang | |
id: advent_sunset | |
trigger: | |
- platform: sun | |
event: sunset | |
action: | |
service: script.turn_on | |
entity_id: script.advent_rot_weiss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment