add extra home-assistant configurations
This commit is contained in:
parent
9f29195343
commit
a1732ea8e0
|
@ -171,8 +171,8 @@ wireguard:
|
||||||
- public_key: 3mkPtY29F3/0WhSIEUkSAHJexJWOJfFzc6LOzBX9Hjc=
|
- public_key: 3mkPtY29F3/0WhSIEUkSAHJexJWOJfFzc6LOzBX9Hjc=
|
||||||
allowed_ips: 10.100.0.2/32
|
allowed_ips: 10.100.0.2/32
|
||||||
# pallet
|
# pallet
|
||||||
- public_key: ZbLgn0EnkKbv8L6nxysix/fRoASNGFIIvEuLn/aLbm4=
|
# - public_key: ZbLgn0EnkKbv8L6nxysix/fRoASNGFIIvEuLn/aLbm4=
|
||||||
allowed_ips: 10.100.0.3/32
|
# allowed_ips: 10.100.0.3/32
|
||||||
|
|
||||||
homeassistant:
|
homeassistant:
|
||||||
version: 2024.1.3
|
version: 2024.1.3
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# https://blog.ceard.tech/2023/01/wifi-sensor-to-device-tracker
|
||||||
|
- id: 'pixel_4a_wifi_to_mqtt_location'
|
||||||
|
alias: 'Pixel 4a wifi to MQTT location'
|
||||||
|
initial_state: 'on'
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: sensor.pixel_4a_wifi_bssid
|
||||||
|
to: ~
|
||||||
|
action:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ 'e6:63:da:e8:c7:e5' in states('sensor.pixel_4a_wifi_bssid') }}"
|
||||||
|
sequence:
|
||||||
|
- service: mqtt.publish
|
||||||
|
data:
|
||||||
|
topic: location/pixel_4a_wifi
|
||||||
|
payload: 'home'
|
||||||
|
retain: true
|
||||||
|
default:
|
||||||
|
- service: mqtt.publish
|
||||||
|
data:
|
||||||
|
topic: location/pixel_4a_wifi
|
||||||
|
payload: 'not_home'
|
||||||
|
retain: true
|
|
@ -0,0 +1,6 @@
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
anyone_home:
|
||||||
|
device_class: occupancy
|
||||||
|
friendly_name: 'Anyone Home'
|
||||||
|
value_template: "{{ states.person | selectattr('state','eq','home') | list | count > 0 }}"
|
|
@ -0,0 +1,5 @@
|
||||||
|
device_tracker:
|
||||||
|
- name: "Pixel 4a wifi"
|
||||||
|
state_topic: 'location/pixel_4a_wifi'
|
||||||
|
source_type: router
|
||||||
|
unique_id: "mqtt_pixel_4a_wifi"
|
13
playbook.yml
13
playbook.yml
|
@ -31,6 +31,19 @@
|
||||||
roles:
|
roles:
|
||||||
- zigbee2mqtt
|
- zigbee2mqtt
|
||||||
- home-assistant
|
- home-assistant
|
||||||
|
tasks:
|
||||||
|
- name: Install home-assistant binary_sensors config
|
||||||
|
copy:
|
||||||
|
src: home-assistant/binary_sensors
|
||||||
|
dest: /opt/homeassistant/config/binary_sensors
|
||||||
|
- name: Install home-assistant mqtt config
|
||||||
|
copy:
|
||||||
|
src: home-assistant/mqtt
|
||||||
|
dest: /opt/homeassistant/config/mqtt
|
||||||
|
- name: Install home-assistant automations
|
||||||
|
copy:
|
||||||
|
src: home-assistant/automations
|
||||||
|
dest: /opt/homeassistant/config/automations
|
||||||
|
|
||||||
- hosts: cups
|
- hosts: cups
|
||||||
roles:
|
roles:
|
||||||
|
|
|
@ -4,6 +4,11 @@ frontend:
|
||||||
themes: !include_dir_merge_named themes
|
themes: !include_dir_merge_named themes
|
||||||
|
|
||||||
automation: !include automations.yaml
|
automation: !include automations.yaml
|
||||||
|
automation extra: !include_dir_merge_list automations
|
||||||
|
|
||||||
|
binary_sensor: !include_dir_merge_list binary_sensors
|
||||||
|
|
||||||
|
mqtt: !include_dir_merge_named mqtt
|
||||||
|
|
||||||
http:
|
http:
|
||||||
use_x_forwarded_for: true
|
use_x_forwarded_for: true
|
||||||
|
|
|
@ -26,6 +26,15 @@
|
||||||
path: /opt/homeassistant/config
|
path: /opt/homeassistant/config
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Create home-assistant extra config directories
|
||||||
|
file:
|
||||||
|
path: '{{ item }}'
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- /opt/homeassistant/config/binary_sensors
|
||||||
|
- /opt/homeassistant/config/mqtt
|
||||||
|
- /opt/homeassistant/config/automations
|
||||||
|
|
||||||
- name: Copy home-assistant config
|
- name: Copy home-assistant config
|
||||||
copy:
|
copy:
|
||||||
src: configuration.yaml
|
src: configuration.yaml
|
||||||
|
|
Loading…
Reference in New Issue