Skip to content

Instantly share code, notes, and snippets.

View GuySie's full-sized avatar

Guy Sie GuySie

View GitHub Profile
@GuySie
GuySie / cyd-thermostat.yaml
Created November 23, 2023 11:50
ESPHome CYD Thermostat example
# ============================================================
# Edit substitutions for your naming, devices and passwords here.
#
# This code assumes you have a climate thermostat entity and a separate temperature sensor. If you want to use the temperature sensor in your thermostat you need to change the code.
# thermostat_entity: Your climate entity that this device will control.
# temperature_entity: Your thermometer sensor that measures the current temperature in the room. Only used for graph and display.
substitutions:
name: cyd-thermostat
friendly_name: "CYD Thermostat Control"
{%- set raindata = state_attr("sensor.nodered_rain_buienalarm","data")["precip"] %}
{%- for fifteenminutes in raindata|batch(3) %}
{%- if loop.index > 8 %}{{""}}
{%- else %}
{%- set rainintensity = fifteenminutes|max %}
{%- if rainintensity < 0.1 %}{{"▁"}}
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}}
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}}
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}}
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}}
@GuySie
GuySie / ep1.yaml
Created February 25, 2023 15:12
Everything presence one 1.1.3
substitutions:
name: "everything-presence-one-123abc"
room: "Living Room"
friendly_name: "Everything Presence One"
project_name: "Everything Smart Technology.Everything Presence One"
project_version: "1.1.3"
temperature_offset: "-3"
humidity_offset: "5"
temperature_update_interval: "60s"
illuminance_update_interval: "30s"
@GuySie
GuySie / NodeRED-HA-musicbutton-flows.txt
Created January 24, 2023 22:36
NodeRED - Music shortcut/dimmer button flows
[{"id":"7c7232fd8e42c51c","type":"server-events","z":"4dfc0988.b18588","name":"Filter Deconz events","server":"","version":2,"eventType":"deconz_event","exposeToHomeAssistant":false,"eventData":"","haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":130,"y":2960,"wires":[["e4a3ebeb785f3bab"]]},{"id":"e4a3ebeb785f3bab","type":"switch","z":"4dfc0988.b18588","name":"Select switch","property":"payload.event.unique_id","propertyType":"msg","rules":[{"t":"eq","v":"b4:e3:f9:ff:fe:5a:a0:da","vt":"str"},{"t":"eq","v":"b4:e3:f9:ff:fe:86:34:d1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":2960,"wires":[["c9cc6ebbc55d8438"],["
@GuySie
GuySie / ui-lovelace.yaml
Last active July 10, 2023 18:54
My setup for the HA Minimalist UI theme framework https://github.com/UI-Lovelace-Minimalist/UI
---
button_card_templates: !include_dir_merge_named "../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/"
title: "UI Lovelace Minimalist"
theme: "minimalist-desktop"
background: "var(--background-image)"
# views: !include_dir_merge_list "views/"
views:
- title: "Home View"
path: 0
@GuySie
GuySie / HA-mini-graph-card-temperature.txt
Created December 13, 2021 20:49
YAML code for Home Assistant mini-graph-card temperature card for Aqara multi-sensor, with night indicator
align_header: left
align_icon: left
entities:
- entity: sensor.multi_bedroom_temperature
- entity: sensor.multi_bedroom_humidity
show_graph: false
show_state: true
- entity: sensor.multi_bedroom_pressure
show_graph: false
show_state: true
@GuySie
GuySie / HA-night-state-template.txt
Created December 13, 2021 20:36
Night State template for Home Assistant's configuration.yaml to create a 1/0 night entity
sensor:
- platform: template
sensors:
nightstate:
friendly_name: Night State
value_template: "{% if is_state('sun.sun', 'below_horizon') %}1{% else %}0{% endif %}"
@GuySie
GuySie / HA-IKEA-VINDRIKTNING-mini-graph-card.txt
Last active January 20, 2022 16:25
YAML code for a modded IKEA VINDRIKTNING sensor in Home Assistant
align_header: left
align_icon: left
entities:
- entity: sensor.ikea_vindriktning_pm25
- color: gray
entity: sensor.nightstate
name: Night
show_legend: false
show_line: false
show_points: false
@GuySie
GuySie / HA-ESPhome-IKEA-vindriktning.txt
Last active November 28, 2023 15:21
IKEA vindriktning ESPhome Home Assistant
esphome:
name: vindriktning
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
@GuySie
GuySie / NodeRED-HA-Buienradar-and-Buienalarm-complication.txt
Created August 2, 2021 11:58
NodeRED sensor based Home Assistant Apple Watch Buienradar + Buienalarm Complication
{%- if state_attr("sensor.nodered_rain_buienradar","data") %}
{%- set buienradarraw = state_attr("sensor.nodered_rain_buienradar","data").split('\r\n') %}
{%- set raindata = namespace(list=[]) -%}
{%- for n in buienradarraw -%}
{%- set raindata.list = raindata.list + [n[0:3]] %}
{%- endfor -%}
{%- for fifteenminutes in raindata.list|batch(3) %}
{%- if loop.index > 8 %}{{""}}
{%- else %}
{%- set rainvalue = fifteenminutes|max|int %}