add home assistant configuration guidelines

This commit is contained in:
2024-05-05 16:29:31 -04:00
parent 7251627477
commit 5940c16d91
3 changed files with 560 additions and 0 deletions

167
hass_trackers/fridge.txt Normal file
View File

@@ -0,0 +1,167 @@
Counters:
```yaml
days_since_fridge_filter_replaced:
name: days_since_fridge_filter_replaced
restore: true
initial: 0
step: 1
icon: mdi:fridge
last_non_zero_days_since_fridge_filter_replaced:
name: last_non_zero_days_since_fridge_filter_replaced
restore: true
initial: 0
step: 1
icon: mdi:fridge
```
Input Buttons:
```yaml
reset_days_since_fridge_filter_replaced:
name: reset_days_since_fridge_filter_replaced
icon: mdi:fridge
undo_reset_days_since_fridge_filter_replaced:
name: undo_reset_days_since_fridge_filter_replaced
icon: mdi:undo
```
Automations:
```yaml
- alias: 'Counter: Increment days_since_fridge_filter_replaced'
description: ''
trigger:
- platform: time
at: 00:00:00
condition: []
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.days_since_fridge_filter_replaced
mode: single
- alias: 'Counter: Reset days_since_fridge_filter_replaced'
description: ''
trigger:
- platform: state
entity_id:
- input_button.reset_days_since_fridge_filter_replaced
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.days_since_fridge_filter_replaced
mode: single
- alias: 'Counter: Update last_non_zero_days_since_fridge_filter_replaced'
description: ''
trigger:
- platform: state
entity_id:
- counter.days_since_fridge_filter_replaced
condition:
- condition: numeric_state
entity_id: counter.days_since_fridge_filter_replaced
above: 0
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_fridge_filter_replaced
mode: single
- alias: 'Counter: Reset last_non_zero_days_since_fridge_filter_replaced'
description: ''
trigger:
- platform: numeric_state
entity_id:
- counter.days_since_fridge_filter_replaced
above: 0
below: 2
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_fridge_filter_replaced
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_fridge_filter_replaced
mode: single
- alias: 'Counter: Undo Reset days_since_fridge_filter_replaced'
description: ''
trigger:
- platform: state
entity_id:
- input_button.undo_reset_days_since_fridge_filter_replaced
condition:
- condition: numeric_state
entity_id: counter.days_since_fridge_filter_replaced
below: 1
action:
- service: counter.set_value
metadata: {}
data:
value: "{{ int(states('counter.last_non_zero_days_since_fridge_filter_replaced'))}}"
target:
entity_id: counter.days_since_fridge_filter_replaced
- service: counter.decrement
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_fridge_filter_replaced
mode: single
```
Dashboard:
```yaml
title: Days Since Fridge Filter Replaced
type: grid
square: false
columns: 1
cards:
- type: grid
square: false
columns: 2
cards:
- name: Reset
show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.reset_days_since_fridge_filter_replaced
show_state: true
- name: Undo
show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.undo_reset_days_since_fridge_filter_replaced
show_state: true
- type: grid
square: false
columns: 2
cards:
- type: entity
entity: counter.days_since_fridge_filter_replaced
state_color: false
name: Days Since
- type: entity
entity: counter.last_non_zero_days_since_fridge_filter_replaced
state_color: false
name: Last Value
- type: history-graph
hours_to_show: 72
entities:
- counter.days_since_fridge_filter_replaced
```

167
hass_trackers/litterbox.txt Normal file
View File

@@ -0,0 +1,167 @@
Counters:
```yaml
days_since_litter_box_changed:
name: days_since_litter_box_changed
restore: true
initial: 0
step: 1
icon: mdi:cat
last_non_zero_days_since_litter_box_changed:
name: last_non_zero_days_since_litter_box_changed
restore: true
initial: 0
step: 1
icon: mdi:undo
```
Input Buttons:
```yaml
reset_days_since_litter_box_changed:
name: reset_days_since_litter_box_changed
icon: mdi:cat
undo_reset_days_since_litter_box_changed:
name: undo_reset_days_since_litter_box_changed
icon: mdi:undo
```
Automations:
```yaml
- alias: 'Counter: Increment days_since_litter_box_changed'
description: ''
trigger:
- platform: time
at: 00:00:00
condition: []
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.days_since_litter_box_changed
mode: single
- alias: 'Counter: Reset days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- input_button.reset_days_since_litter_box_changed
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.days_since_litter_box_changed
mode: single
- alias: 'Counter: Update last_non_zero_days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- counter.days_since_litter_box_changed
condition:
- condition: numeric_state
entity_id: counter.days_since_litter_box_changed
above: 0
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
- alias: 'Counter: Reset last_non_zero_days_since_litter_box_changed'
description: ''
trigger:
- platform: numeric_state
entity_id:
- counter.days_since_litter_box_changed
above: 0
below: 2
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
- alias: 'Counter: Undo Reset days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- input_button.undo_reset_days_since_litter_box_changed
condition:
- condition: numeric_state
entity_id: counter.days_since_litter_box_changed
below: 1
action:
- service: counter.set_value
metadata: {}
data:
value: "{{ int(states('counter.last_non_zero_days_since_litter_box_changed'))}}"
target:
entity_id: counter.days_since_litter_box_changed
- service: counter.decrement
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
```
Dashboard:
```yaml
title: REPLACE ME
type: grid
square: false
columns: 1
cards:
- type: grid
square: false
columns: 2
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.reset_days_since_litter_box_changed
show_state: true
name: Reset
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.undo_reset_days_since_litter_box_changed
show_state: true
name: Undo
- type: grid
square: false
columns: 2
cards:
- type: entity
entity: counter.days_since_litter_box_changed
state_color: false
name: Days Since
- type: entity
entity: counter.last_non_zero_days_since_litter_box_changed
state_color: false
name: Last Value
- type: history-graph
hours_to_show: 72
entities:
- counter.days_since_litter_box_changed
```

226
home-assistant.md Normal file
View File

@@ -0,0 +1,226 @@
# Home Assistant
- [Home Assistant](#home-assistant)
- [Setup and Configuration](#setup-and-configuration)
- [Cert](#cert)
- [Door Lock](#door-lock)
- [Philips Hue Lights](#philips-hue-lights)
- [Shelly](#shelly)
- [Trackers](#trackers)
## Setup and Configuration
### Cert
```bash
openssl req -sha256 -addext "subjectAltName = DNS:homeassistant.reeselink.com" -newkey rsa:4096 -nodes -keyout secrets/ha-privkey.pem -x509 -days 3650 -out secrets/ha-fullchain.pem
scp secrets/ha-* root@homeassistant.reeselink.com:~/ssl/
```
configuration.yaml
```yaml
http:
ssl_certificate: "/ssl/ha-fullchain.pem"
ssl_key: "/ssl/ha-privkey.pem"
use_x_forwarded_for: true
trusted_proxies:
- 10.1.0.0/16
```
### Door Lock
1. Install Z-wave
2. Install z-wave JS module
3. Add device -> How do you want to add your device -> Legacy Secure
4. Enter programming pin on lock -> 0
### Philips Hue Lights
1. I configure all philips hue lights through zigbee directly connected to HA
hue lights support color_temp in mireds, here are some mired-kelvin conversions:
| Kelvin | Mired |
| ------ | ----- |
| 6000 | 167 |
| 4000 | 250 |
| 2600 | 385 |
### Shelly
1. Outbound Websocket `wss://homeassistant.reeseapps.com/api/shelly/ws`
### Trackers
Trackers allow for a simple "days since x" Setup with a reset and undo button.
Copy each of these into a text editor and find/replace "days_since_litter_box_changed"
with the name of the entity you want to track
Counters:
```yaml
days_since_litter_box_changed:
name: days_since_litter_box_changed
restore: true
initial: 0
step: 1
icon: mdi:cat
last_non_zero_days_since_litter_box_changed:
name: last_non_zero_days_since_litter_box_changed
restore: true
initial: 0
step: 1
icon: mdi:undo
```
Input Buttons:
```yaml
reset_days_since_litter_box_changed:
name: reset_days_since_litter_box_changed
icon: mdi:cat
undo_reset_days_since_litter_box_changed:
name: undo_reset_days_since_litter_box_changed
icon: mdi:undo
```
Automations:
```yaml
- alias: 'Counter: Increment days_since_litter_box_changed'
description: ''
trigger:
- platform: time
at: 00:00:00
condition: []
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.days_since_litter_box_changed
mode: single
- alias: 'Counter: Reset days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- input_button.reset_days_since_litter_box_changed
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.days_since_litter_box_changed
mode: single
- alias: 'Counter: Update last_non_zero_days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- counter.days_since_litter_box_changed
condition:
- condition: numeric_state
entity_id: counter.days_since_litter_box_changed
above: 0
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
- alias: 'Counter: Reset last_non_zero_days_since_litter_box_changed'
description: ''
trigger:
- platform: numeric_state
entity_id:
- counter.days_since_litter_box_changed
above: 0
below: 2
condition: []
action:
- service: counter.reset
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
- alias: 'Counter: Undo Reset days_since_litter_box_changed'
description: ''
trigger:
- platform: state
entity_id:
- input_button.undo_reset_days_since_litter_box_changed
condition:
- condition: numeric_state
entity_id: counter.days_since_litter_box_changed
below: 1
action:
- service: counter.set_value
metadata: {}
data:
value: "{{ int(states('counter.last_non_zero_days_since_litter_box_changed'))}}"
target:
entity_id: counter.days_since_litter_box_changed
- service: counter.decrement
metadata: {}
data: {}
target:
entity_id: counter.last_non_zero_days_since_litter_box_changed
mode: single
```
Dashboard:
```yaml
title: REPLACE ME
type: grid
square: false
columns: 1
cards:
- type: grid
square: false
columns: 2
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.reset_days_since_litter_box_changed
show_state: true
name: Reset
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: input_button.undo_reset_days_since_litter_box_changed
show_state: true
name: Undo
- type: grid
square: false
columns: 2
cards:
- type: entity
entity: counter.days_since_litter_box_changed
state_color: false
name: Days Since
- type: entity
entity: counter.last_non_zero_days_since_litter_box_changed
state_color: false
name: Last Value
- type: history-graph
hours_to_show: 72
entities:
- counter.days_since_litter_box_changed
```