1
0
Fork 0

Home Assistant Git Exporter

main
31c0fe9c6dbd74bcdde92e1d2aaa03e1d272f75f 2022-05-12 13:08:48 +10:00
parent 60ff7bc076
commit 7be90e411e
7 changed files with 55 additions and 33 deletions

View File

@ -1,7 +1,7 @@
check:
check_for_ips: false
check_for_secrets: true
enabled: false
enabled: true
dry_run: false
exclude:
- '*.db'
@ -38,7 +38,7 @@ export:
repository:
branch_name: main
commit_message: Home Assistant Git Exporter
password: '!secret git_export_password'
password: '!secret git_export_token'
pull_before_push: true
url: '!secret git_export_url'
username: '!secret git_export_password'
username: '!secret git_export_token'

View File

@ -2,10 +2,10 @@ automation:
- id: f0ca9ef44d3b606864eea88a4704baf60d33614b
alias: Export HA config to git repo
trigger:
# every hour, but not on the hour
- platform: time_pattern
hours: "*"
minutes: 25
action:
- service: hassio.addon_start
data:
addon: "core_letsencrypt"
addon: "243ffc37_git-exporter"

View File

@ -339,7 +339,7 @@ sensor:
events:
- state: ABC Jazz (Jazz Music) # Default background music
start: "8:00:00"
end: "23:00:00"
end: "21:00:00"
- state: Triple R 102.7 (Variety) # https://www.rrr.org.au/explore/programs/radiotherapy
start: "10:00:00"

View File

@ -105,8 +105,15 @@ template:
{{ state_attr(state_attr('sensor.template_room_ri_phone', 'entity_id') | string, 'distance') }}
- trigger:
- platform: time_pattern
seconds: "/3"
- platform: state
entity_id:
- sensor.template_room_bo_phone
- sensor.template_room_ri_phone
not_to:
- unavailable
- unknown
for:
seconds: 5
binary_sensor:
- unique_id: bos_office_is_occupied
name: Bo's Office Is Occupied
@ -114,9 +121,9 @@ template:
{{ is_state('sensor.template_room_bo_phone', 'bo_s_office') or is_state('sensor.template_room_ri_phone', 'bo_s_office') }}
icon: |
{% if is_state("binary_sensor.bo_s_office_is_occupied", "on") %}
mdi:person
mdi:account
{% else %}
mdi:person-outline
mdi:account-outline
{% endif %}
device_class: occupancy
@ -126,9 +133,9 @@ template:
{{ is_state('sensor.template_room_bo_phone', 'ri_s_office') or is_state('sensor.template_room_ri_phone', 'ri_s_office') }}
icon: |
{% if is_state("binary_sensor.ri_s_office_is_occupied", "on") %}
mdi:person
mdi:account
{% else %}
mdi:person-outline
mdi:account-outline
{% endif %}
device_class: occupancy
@ -138,9 +145,9 @@ template:
{{ is_state('sensor.template_room_bo_phone', 'bedroom') or is_state('sensor.template_room_ri_phone', 'bedroom') }}
icon: |
{% if is_state("binary_sensor.bedroom_is_occupied", "on") %}
mdi:person
mdi:account
{% else %}
mdi:person-outline
mdi:account-outline
{% endif %}
device_class: occupancy
@ -150,20 +157,44 @@ template:
{{ is_state('sensor.template_room_bo_phone', 'living_room') or is_state('sensor.template_room_ri_phone', 'living_room') }}
icon: |
{% if is_state("binary_sensor.living_room_is_occupied", "on") %}
mdi:person
mdi:account
{% else %}
mdi:person-outline
mdi:account-outline
{% endif %}
device_class: occupancy
- unique_id: lounge_room_is_occupied
name: Lounge Room Is Occupied
- unique_id: analog_room_is_occupied
name: analog Room Is Occupied
state: |
{{ is_state('sensor.template_room_bo_phone', 'lounge_room') or is_state('sensor.template_room_ri_phone', 'lounge_room') }}
{{ is_state('sensor.template_room_bo_phone', 'analog_room') or is_state('sensor.template_room_ri_phone', 'analog_room') }}
icon: |
{% if is_state("binary_sensor.lounge_room_is_occupied", "on") %}
mdi:person
{% if is_state("binary_sensor.analog_room_is_occupied", "on") %}
mdi:account
{% else %}
mdi:person-outline
mdi:account-outline
{% endif %}
device_class: occupancy
automation:
- id: 20ca57c492451f62ab86cabb9e1e8fee00811e45
alias: Restart ESPresense regularly # ESPresense seems to just stop reporting sometimes. Restarting regularly is a workaround.
trigger:
- platform: state
entity_id:
- sensor.espresense_bedroom_uptime
- sensor.espresense_living_room_uptime
- sensor.espresense_bos_office_count
- sensor.espresense_ris_office_uptime
- sensor.espresense_analog_room_uptime
not_from:
# after restarting it will go unavailable then back to previous uptime, until it receives a new uptime.
# so skipping `not_from` will result in boot loops
- unavailable
- unknown
variables:
button: "button.{{ trigger.to_state.entity_id | replace('_uptime', '_restart') | replace('sensor.', '') }}"
condition: "{{ trigger.to_state.state | int > 3600 }}" # one hour
action:
- service: button.press
target:
entity_id: "{{ button }}"

View File

@ -10,7 +10,8 @@ config:
type: entity
use_entity_picture: false
- entity: binary_sensor.bo_s_office_is_occupied
icon: mdi:motion-sensor
type: entity
- entity: binary_sensor.bo_s_office_motion
type: entity
- entity: sensor.ble_temperature_bos_office_a4c1380f0b98
type: entity

View File

@ -1,3 +0,0 @@
config:
title: Outdoors
views: []

View File

@ -1,11 +1,4 @@
items:
- icon: mdi:greenhouse
id: lovelace_shed
mode: storage
require_admin: true
show_in_sidebar: true
title: Shed
url_path: lovelace-shed
- icon: mdi:chair-rolling
id: bos_office
mode: storage