-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove theme automation * Update filter sensors * Add climate calendar * Use statistics instead of filter * zigbee2mqtt: update * Add new automation * Add HA restic backup
- Loading branch information
1 parent
6278e61
commit 81089e9
Showing
12 changed files
with
238 additions
and
73 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
...mA5/modules/system/services/home-automation/homeassistant/static/automations/climate.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
- id: "climate" | ||
alias: Climate | ||
description: "" | ||
triggers: | ||
- trigger: calendar | ||
entity_id: calendar.climate | ||
event: start | ||
conditions: | ||
- condition: state | ||
entity_id: input_boolean.vacation_mode | ||
state: "off" | ||
actions: | ||
- variables: | ||
duration: > | ||
{% set start = trigger.calendar_event.start | as_datetime %} | ||
{% set next_midnight = (start + timedelta(days=1)).replace(hour=0, minute=0, second=0, microsecond=0) %} | ||
{% set end = trigger.calendar_event.end | as_datetime %} | ||
{% if end == next_midnight %} | ||
{{ None }} | ||
{% else %} | ||
{{ end - start }} | ||
{% endif %} | ||
summary: | | ||
{{ trigger.calendar_event.summary.split(" ") }} | ||
entities: | | ||
{% set room = summary[0] | lower %} | ||
{{ | ||
{ | ||
"climate": "climate.{{ room }}_ac", | ||
"temperature": "sensor.{{ room }}_temperature_avg" | ||
} | ||
}} | ||
mode: | | ||
{{ summary[1] | lower }} | ||
temp: | | ||
{% if mode == "heat" %} | ||
{{ | ||
{ | ||
"target": 24, | ||
"cmp": "lte", | ||
"cmp_target": 20 | ||
} | ||
}} | ||
{% elif mode == "cool" %} | ||
{{ | ||
{ | ||
"target": 27, | ||
"cmp": "gte", | ||
"cmp_target": 26 | ||
} | ||
}} | ||
{% endif %} | ||
- alias: If temperature condition matches | ||
if: | ||
- condition: template | ||
value_template: |- | ||
{% if temp.cmp == "lte" %} | ||
{{ float(states(entities.temperature)) <= temp.cmp_target }} | ||
{% elif temp.cmp == "gte" %} | ||
{{ float(states(entities.temperature)) >= temp.cmp_target }} | ||
{% endif %} | ||
then: | ||
- action: climate.set_temperature | ||
metadata: {} | ||
data: | ||
hvac_mode: "{{ mode }}" | ||
temperature: "{{ temp.target }}" | ||
target: | ||
entity_id: "{{ entities.climate }}" | ||
alias: Enable climate | ||
- alias: Maybe wait to turn off | ||
if: | ||
- condition: template | ||
value_template: "{{ duration != None }}" | ||
alias: If duration is not empty | ||
then: | ||
- alias: Wait for climate to turn off | ||
wait_template: | | ||
{{ is_state(entities.climate, "off") }} | ||
timeout: "{{ duration }}" | ||
continue_on_timeout: true | ||
- alias: Turn off if timed out | ||
if: | ||
- condition: template | ||
value_template: "{{ not wait.completed }}" | ||
alias: If timed out | ||
then: | ||
- action: climate.turn_off | ||
metadata: {} | ||
data: {} | ||
target: | ||
entity_id: "{{ entities.climate }}" | ||
mode: parallel | ||
max: 10 |
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
12 changes: 0 additions & 12 deletions
12
...ekomA5/modules/system/services/home-automation/homeassistant/static/automations/misc.yaml
This file was deleted.
Oops, something went wrong.
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
8 changes: 4 additions & 4 deletions
8
...system/services/home-automation/homeassistant/static/configuration/customize/sensors.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
sensor.avg_bedroom_temperature: | ||
sensor.bedroom_temperature_avg: | ||
icon: mdi:home-thermometer-outline | ||
|
||
sensor.avg_bedroom_humidity: | ||
sensor.bedroom_humidity_avg: | ||
icon: mdi:cloud-percent-outline | ||
|
||
sensor.avg_ldk_temperature: | ||
sensor.ldk_temperature_avg: | ||
icon: mdi:home-thermometer-outline | ||
|
||
sensor.avg_ldk_humidity: | ||
sensor.ldk_humidity_avg: | ||
icon: mdi:cloud-percent-outline |
43 changes: 0 additions & 43 deletions
43
...es/system/services/home-automation/homeassistant/static/configuration/sensors/filter.yaml
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...ystem/services/home-automation/homeassistant/static/configuration/sensors/statistics.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- platform: statistics | ||
name: Bedroom temperature AVG | ||
unique_id: bedroom_temperature_avg | ||
entity_id: sensor.bedroom_temperature_humidity_1_temperature | ||
state_characteristic: average_step | ||
keep_last_sample: true | ||
percentile: 50 | ||
precision: 2 | ||
max_age: | ||
hours: 1 | ||
|
||
- platform: statistics | ||
name: Bedroom humidity AVG | ||
unique_id: bedroom_humidity_avg | ||
entity_id: sensor.bedroom_temperature_humidity_1_humidity | ||
state_characteristic: average_step | ||
keep_last_sample: true | ||
percentile: 50 | ||
precision: 2 | ||
max_age: | ||
hours: 1 | ||
|
||
- platform: statistics | ||
name: LDK temperature AVG | ||
unique_id: ldk_temperature_avg | ||
entity_id: sensor.ldk_temperature_humidity_1_temperature | ||
state_characteristic: average_step | ||
keep_last_sample: true | ||
percentile: 50 | ||
precision: 2 | ||
max_age: | ||
hours: 1 | ||
|
||
- platform: statistics | ||
name: LDK humidity AVG | ||
unique_id: ldk_humidity_avg | ||
entity_id: sensor.ldk_temperature_humidity_1_humidity | ||
state_characteristic: average_step | ||
keep_last_sample: true | ||
percentile: 50 | ||
precision: 2 | ||
max_age: | ||
hours: 1 |
50 changes: 50 additions & 0 deletions
50
...ekomA5/modules/system/services/home-automation/homeassistant/static/resources/climate.ics
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Custom ICS Generator//EN | ||
CALSCALE:GREGORIAN | ||
|
||
BEGIN:VEVENT | ||
UID:workday-bedroom-heat | ||
DTSTAMP:20241228T000000Z | ||
DTSTART;TZID=Asia/Tokyo:20241101T073000 | ||
DTEND;TZID=Asia/Tokyo:20241101T083000 | ||
RRULE:FREQ=YEARLY;BYMONTH=11,12,1,2,3;BYDAY=MO,TU,WE,TH,FR | ||
SUMMARY:Bedroom Heat | ||
DESCRIPTION: | ||
LOCATION: | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
UID:weekend-bedroom-heat | ||
DTSTAMP:20241228T000000Z | ||
DTSTART;TZID=Asia/Tokyo:20241101T083000 | ||
DTEND;TZID=Asia/Tokyo:20241101T093000 | ||
RRULE:FREQ=YEARLY;BYMONTH=11,12,1,2,3;BYDAY=SA,SU | ||
SUMMARY:Bedroom Heat | ||
DESCRIPTION: | ||
LOCATION: | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
UID:workday-ldk-heat | ||
DTSTAMP:20241228T000000Z | ||
DTSTART;TZID=Asia/Tokyo:20241101T073000 | ||
DTEND;TZID=Asia/Tokyo:20241102T000000 | ||
RRULE:FREQ=YEARLY;BYMONTH=11,12,1,2,3;BYDAY=MO,TU,WE,TH,FR | ||
SUMMARY:LDK Heat | ||
DESCRIPTION: | ||
LOCATION: | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
UID:weekend-ldk-heat | ||
DTSTAMP:20241228T000000Z | ||
DTSTART;TZID=Asia/Tokyo:20241101T083000 | ||
DTEND;TZID=Asia/Tokyo:20241101T120000 | ||
RRULE:FREQ=YEARLY;BYMONTH=11,12,1,2,3;BYDAY=SA,SU | ||
SUMMARY:LDK Heat | ||
DESCRIPTION: | ||
LOCATION: | ||
END:VEVENT | ||
|
||
END:VCALENDAR |
29 changes: 29 additions & 0 deletions
29
machines/geekomA5/modules/system/services/home-automation/restic-backup.nix
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ lib, ... }: | ||
{ | ||
#NOTE - See also global config at | ||
#LINK - machines/geekomA5/modules/system/services/restic.nix | ||
services.restic.backups = { | ||
homeassistant = { | ||
paths = lib.map (rel: "/mnt/store/home-automation/homeassistant/${rel}") [ | ||
"automations" | ||
"configuration" | ||
"custom_components" | ||
"deps" | ||
"local" | ||
"resources" | ||
".storage" | ||
"themes" | ||
"ui_lovelace_minimalist" | ||
"www" | ||
"automations.yaml" | ||
"configuration.yaml" | ||
]; | ||
|
||
pruneOpts = [ | ||
"--keep-daily 7" | ||
"--keep-weekly 4" | ||
"--keep-monthly 6" | ||
]; | ||
}; | ||
}; | ||
} |
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
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