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

View File

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

View File

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

View File

@ -105,8 +105,15 @@ template:
{{ state_attr(state_attr('sensor.template_room_ri_phone', 'entity_id') | string, 'distance') }} {{ state_attr(state_attr('sensor.template_room_ri_phone', 'entity_id') | string, 'distance') }}
- trigger: - trigger:
- platform: time_pattern - platform: state
seconds: "/3" entity_id:
- sensor.template_room_bo_phone
- sensor.template_room_ri_phone
not_to:
- unavailable
- unknown
for:
seconds: 5
binary_sensor: binary_sensor:
- unique_id: bos_office_is_occupied - unique_id: bos_office_is_occupied
name: Bo's 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') }} {{ is_state('sensor.template_room_bo_phone', 'bo_s_office') or is_state('sensor.template_room_ri_phone', 'bo_s_office') }}
icon: | icon: |
{% if is_state("binary_sensor.bo_s_office_is_occupied", "on") %} {% if is_state("binary_sensor.bo_s_office_is_occupied", "on") %}
mdi:person mdi:account
{% else %} {% else %}
mdi:person-outline mdi:account-outline
{% endif %} {% endif %}
device_class: occupancy 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') }} {{ is_state('sensor.template_room_bo_phone', 'ri_s_office') or is_state('sensor.template_room_ri_phone', 'ri_s_office') }}
icon: | icon: |
{% if is_state("binary_sensor.ri_s_office_is_occupied", "on") %} {% if is_state("binary_sensor.ri_s_office_is_occupied", "on") %}
mdi:person mdi:account
{% else %} {% else %}
mdi:person-outline mdi:account-outline
{% endif %} {% endif %}
device_class: occupancy 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') }} {{ is_state('sensor.template_room_bo_phone', 'bedroom') or is_state('sensor.template_room_ri_phone', 'bedroom') }}
icon: | icon: |
{% if is_state("binary_sensor.bedroom_is_occupied", "on") %} {% if is_state("binary_sensor.bedroom_is_occupied", "on") %}
mdi:person mdi:account
{% else %} {% else %}
mdi:person-outline mdi:account-outline
{% endif %} {% endif %}
device_class: occupancy 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') }} {{ is_state('sensor.template_room_bo_phone', 'living_room') or is_state('sensor.template_room_ri_phone', 'living_room') }}
icon: | icon: |
{% if is_state("binary_sensor.living_room_is_occupied", "on") %} {% if is_state("binary_sensor.living_room_is_occupied", "on") %}
mdi:person mdi:account
{% else %} {% else %}
mdi:person-outline mdi:account-outline
{% endif %} {% endif %}
device_class: occupancy device_class: occupancy
- unique_id: lounge_room_is_occupied - unique_id: analog_room_is_occupied
name: Lounge Room Is Occupied name: analog Room Is Occupied
state: | 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: | icon: |
{% if is_state("binary_sensor.lounge_room_is_occupied", "on") %} {% if is_state("binary_sensor.analog_room_is_occupied", "on") %}
mdi:person mdi:account
{% else %} {% else %}
mdi:person-outline mdi:account-outline
{% endif %} {% endif %}
device_class: occupancy 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 type: entity
use_entity_picture: false use_entity_picture: false
- entity: binary_sensor.bo_s_office_is_occupied - entity: binary_sensor.bo_s_office_is_occupied
icon: mdi:motion-sensor type: entity
- entity: binary_sensor.bo_s_office_motion
type: entity type: entity
- entity: sensor.ble_temperature_bos_office_a4c1380f0b98 - entity: sensor.ble_temperature_bos_office_a4c1380f0b98
type: entity type: entity

View File

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

View File

@ -1,11 +1,4 @@
items: 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 - icon: mdi:chair-rolling
id: bos_office id: bos_office
mode: storage mode: storage