Initial commit (reset history)

This commit is contained in:
Alexis Rolland
2026-06-19 22:49:23 +02:00
commit 6d7df39f8a
10 changed files with 1556 additions and 0 deletions
+350
View File
@@ -0,0 +1,350 @@
# automations-alarm.yaml Alarmo & Sécurité
# Automatisations liées au système d'alarme
# Version anonymisée — noms, pièces et identifiants remplacés
# ─────────────────────────────────────────────
# DÉCLENCHEMENT ALARME
# ─────────────────────────────────────────────
- alias: Notification déclenchement alarme
description: Envoie un message de notification quand l'alarme est déclenchée
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: triggered
actions:
- action: telegram_bot.send_message
data:
message: "Alarme déclenchée !"
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- alias: Notification alarme mode absence prolongée
description: Notifie les contacts d'urgence en mode absence prolongée
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
from: armed_vacation
to: triggered
actions:
- action: notify.mobile_app_contact_1
data:
message: "Alarme déclenchée !"
title: "Alarme domicile"
- action: notify.mobile_app_contact_2
data:
title: "Alarme domicile"
message: "ALARME DÉCLENCHÉE"
- alias: Snapshots caméra principale sur alarme
description: Envoie plusieurs photos + vidéo de la caméra principale sur déclenchement
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: triggered
actions:
- repeat:
count: 3
sequence:
- action: camera.snapshot
data:
filename: /config/www/tmp1.jpg
target:
entity_id: camera.camera_principale
- action: telegram_bot.send_photo
data:
verify_ssl: true
file: /config/www/tmp1.jpg
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- delay:
seconds: 1
- action: camera.record
data:
filename: /config/www/clip1.mp4
duration: 10
target:
entity_id: camera.camera_principale
- action: telegram_bot.send_video
data:
verify_ssl: true
file: /config/www/clip1.mp4
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- alias: Snapshots caméra secondaire sur alarme
description: Envoie plusieurs photos + vidéo de la caméra secondaire sur déclenchement
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: triggered
actions:
- repeat:
count: 3
sequence:
- action: camera.snapshot
data:
filename: /config/www/tmp2.jpg
target:
entity_id: camera.camera_secondaire
- action: telegram_bot.send_photo
data:
verify_ssl: true
file: /config/www/tmp2.jpg
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- delay:
seconds: 1
- action: camera.record
data:
filename: /config/www/clip2.mp4
duration: 10
target:
entity_id: camera.camera_secondaire
- action: telegram_bot.send_video
data:
verify_ssl: true
file: /config/www/clip2.mp4
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
# ─────────────────────────────────────────────
# ARMEMENT / DÉSARMEMENT
# ─────────────────────────────────────────────
- alias: Notification armement alarme
description: Confirme l'armement par notification
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: armed_away
actions:
- action: telegram_bot.send_message
data:
message: "Alarme armée."
title: "Alarme activée"
target: !secret telegram_chat_user1
- action: telegram_bot.send_message
data:
message: "Alarme armée."
title: "Alarme activée"
target: !secret telegram_chat_user2
- alias: Notification désarmement alarme
description: Confirme le désarmement par notification
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: disarmed
actions:
- action: telegram_bot.send_message
data:
message: "Alarme désactivée."
title: "Alarme désactivée"
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- alias: Désarmement via commande Telegram
description: Désarme l'alarme via commande bot Telegram
triggers:
- trigger: event
event_type: telegram_callback
event_data:
command: /desactive_alarme
actions:
- action: alarmo.disarm
data:
entity_id: alarm_control_panel.alarmo
- alias: Armement via commande Telegram
description: Arme en mode absence prolongée via commande bot Telegram
triggers:
- trigger: event
event_type: telegram_callback
event_data:
command: /arme_alarme
actions:
- action: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: vacation
# ─────────────────────────────────────────────
# SURVEILLANCE À DISTANCE
# ─────────────────────────────────────────────
- alias: Surveillance à distance
description: Envoie des photos de toutes les caméras sur commande Telegram /garde_alarme
triggers:
- trigger: event
event_type: telegram_callback
event_data:
command: /garde_alarme
actions:
- repeat:
count: 5
sequence:
- action: camera.snapshot
data:
filename: /config/www/tmp1.jpg
target:
entity_id: camera.camera_principale
- action: telegram_bot.send_photo
data:
verify_ssl: true
file: /config/www/tmp1.jpg
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
- action: camera.snapshot
data:
filename: /config/www/tmp2.jpg
target:
entity_id: camera.camera_secondaire
- action: telegram_bot.send_photo
data:
verify_ssl: true
file: /config/www/tmp2.jpg
target:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
# ─────────────────────────────────────────────
# SIRÈNE ZIGBEE
# ─────────────────────────────────────────────
- alias: Contrôle sirène Zigbee
description: Publie le mode sirène (burglar/stop) selon l'état de l'input_boolean
triggers:
- trigger: state
entity_id: input_boolean.sirene_switch
actions:
- action: mqtt.publish
data:
topic: zigbee2mqtt/sirene/set
payload_template: >
{% if is_state('input_boolean.sirene_switch', 'on') %}
{"warning": {"mode": "burglar"}}
{% else %}
{"warning": {"mode": "stop"}}
{% endif %}
# ─────────────────────────────────────────────
# INTÉGRATIONS CONDITIONNELLES
# ─────────────────────────────────────────────
- alias: Détection Frigate selon état alarme
description: Active/désactive la détection Frigate selon l'état de l'alarme
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
actions:
- if:
- condition: state
entity_id: alarm_control_panel.alarmo
state: disarmed
then:
- type: turn_off
device_id: DEVICE_ID_CAMERA_1
entity_id: switch.frigate_detect_camera_1
domain: switch
- type: turn_off
device_id: DEVICE_ID_CAMERA_2
entity_id: switch.frigate_detect_camera_2
domain: switch
else:
- type: turn_on
device_id: DEVICE_ID_CAMERA_1
entity_id: switch.frigate_detect_camera_1
domain: switch
- type: turn_on
device_id: DEVICE_ID_CAMERA_2
entity_id: switch.frigate_detect_camera_2
domain: switch
- alias: Extinction lumières à l'armement
description: Éteint toutes les lumières quand l'alarme passe en mode arming
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
from: disarmed
to: arming
actions:
- type: turn_off
device_id: DEVICE_ID_LUMIERE_1
entity_id: switch.lumiere_1
domain: switch
- type: turn_off
device_id: DEVICE_ID_LUMIERE_2
entity_id: switch.lumiere_2
domain: switch
- type: turn_off
device_id: DEVICE_ID_LUMIERE_3
entity_id: light.lumiere_3
domain: light
- type: turn_off
device_id: DEVICE_ID_LUMIERE_4
entity_id: light.lumiere_4
domain: light
- alias: Éclairage plantes en absence
description: Active l'éclairage des plantes à pleine puissance quand absent depuis 5 min
triggers:
- trigger: state
entity_id: alarm_control_panel.alarmo
to: armed_away
for:
minutes: 5
actions:
- type: turn_on
device_id: DEVICE_ID_LUMIERE_PLANTES_1
entity_id: light.lumiere_plantes_1
domain: light
brightness_pct: 100
- type: turn_on
device_id: DEVICE_ID_LUMIERE_PLANTES_2
entity_id: light.lumiere_plantes_2
domain: light
brightness_pct: 100
# ─────────────────────────────────────────────
# CLAVIER PHYSIQUE (BLUEPRINT)
# ─────────────────────────────────────────────
- alias: Clavier physique avec Alarmo
description: Armement/désarmement via clavier Zigbee à code PIN
use_blueprint:
path: Bygood91/frient_keypad_with_alarmo.yaml
input:
z2m_keypad_path: zigbee2mqtt/clavier
z2m_keypad_path_set: zigbee2mqtt/clavier/set
pin_list: !secret alarmo_pin
control_panel: alarm_control_panel.alarmo
pin_control_panel: !secret alarmo_pin
action_arming:
- device_id: DEVICE_ID_ALARMO
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: arm_away
action_disarmed:
- device_id: DEVICE_ID_ALARMO
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: disarm
code: !secret alarmo_pin
action_alarm:
- device_id: DEVICE_ID_ALARMO
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: trigger
action_armed_night:
- device_id: DEVICE_ID_ALARMO
domain: alarm_control_panel
entity_id: alarm_control_panel.alarmo
type: arm_night
+73
View File
@@ -0,0 +1,73 @@
# humidity-sensor.yaml ESPHome
# Capteur d'humidité du sol sur ESP32
# Mesure la résistance du sol via deux sondes métalliques
esphome:
name: capteur-plantes
friendly_name: Capteur Plantes
esp32:
board: esp32dev
framework:
type: arduino
# Logs série
logger:
# API Home Assistant
api:
encryption:
key: !secret esphome_api_key
# OTA updates
ota:
- platform: esphome
password: !secret esphome_ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Capteur-Plantes Fallback"
password: !secret esphome_ap_password
captive_portal:
# ─────────────────────────────────────────────
# CAPTEUR D'HUMIDITÉ DU SOL
# Principe : lecture analogique de la résistance du sol
# Sol sec = haute résistance = valeur haute
# Sol humide = faible résistance = valeur basse
# ─────────────────────────────────────────────
sensor:
- platform: adc
pin: GPIO34
name: "Humidité Sol Plante 1"
id: soil_moisture_raw
update_interval: 60s
unit_of_measurement: "%"
accuracy_decimals: 1
attenuation: auto
# Calibration : ajuster min/max selon votre sol et vos sondes
filters:
- calibrate_linear:
- 3.0 -> 0.0 # Sol sec (ajuster selon calibration)
- 1.1 -> 100.0 # Sol saturé (ajuster selon calibration)
- clamp:
min_value: 0
max_value: 100
on_value:
then:
- if:
condition:
sensor.in_range:
id: soil_moisture_raw
below: 30.0
then:
- logger.log: "Sol sec ! Arrosage nécessaire."
# Température interne ESP32 (monitoring)
- platform: internal_temperature
name: "Température ESP32"
update_interval: 300s
+148
View File
@@ -0,0 +1,148 @@
# config.yaml Frigate NVR
# Version anonymisée — IPs et credentials remplacés
# Documentation : https://docs.frigate.video/configuration/
# ─────────────────────────────────────────────
# MQTT Connexion au broker Mosquitto local
# ─────────────────────────────────────────────
mqtt:
enabled: true
host: 192.168.1.X # IP du serveur HAOS
port: 1883
user: mqtt
password: "{FRIGATE_MQTT_PASSWORD}" # Variable d'env ou secrets Frigate
topic_prefix: frigate
client_id: frigate
stats_interval: 60
# ─────────────────────────────────────────────
# DÉTECTEUR D'OBJETS
# CPU par défaut — décommenter pour accélération matérielle
# ─────────────────────────────────────────────
detectors:
cpu1:
type: cpu
num_threads: 3
# Pour Coral USB (recommandé si disponible) :
# detectors:
# coral:
# type: edgetpu
# device: usb
# ─────────────────────────────────────────────
# BASE DE DONNÉES
# ─────────────────────────────────────────────
database:
path: /config/frigate.db
# ─────────────────────────────────────────────
# STOCKAGE Enregistrements et clips
# ─────────────────────────────────────────────
record:
enabled: true
retain:
days: 3
mode: motion # N'enregistre que les segments avec mouvement
events:
retain:
default: 10 # Jours de rétention des événements (clips)
mode: motion
snapshots:
enabled: true
bounding_box: true # Encadre l'objet détecté
crop: false
retain:
default: 10
# ─────────────────────────────────────────────
# CAMÉRAS
# ─────────────────────────────────────────────
cameras:
# Caméra principale (pièce de vie)
camera_principale:
enabled: true
ffmpeg:
inputs:
- path: rtsp://admin:{CAMERA_PASSWORD}@192.168.1.X:554/stream1
roles:
- detect
- record
# Optimisations décodage (réduire la charge CPU)
input_args: preset-rtsp-restream
output_args:
record: preset-record-generic-audio-copy
detect:
enabled: false # Activé/désactivé dynamiquement par Home Assistant
width: 1920
height: 1080
fps: 5
objects:
track:
- person
filters:
person:
min_area: 5000 # Ignorer les petites détections (faux positifs)
max_area: 100000
threshold: 0.7
motion:
threshold: 25
contour_area: 100
mask:
- 0,0,0,200,400,200,400,0 # Masquer zone statique si besoin
record:
retain:
days: 3
snapshots:
retain:
default: 10
# Caméra secondaire (entrée / autre pièce)
camera_secondaire:
enabled: true
ffmpeg:
inputs:
- path: rtsp://admin:{CAMERA_PASSWORD}@192.168.1.X:554/stream1
roles:
- detect
- record
input_args: preset-rtsp-restream
output_args:
record: preset-record-generic-audio-copy
detect:
enabled: false
width: 1920
height: 1080
fps: 5
objects:
track:
- person
filters:
person:
min_area: 5000
threshold: 0.7
motion:
threshold: 25
contour_area: 100
record:
retain:
days: 3
snapshots:
retain:
default: 10
# ─────────────────────────────────────────────
# UI FRIGATE
# ─────────────────────────────────────────────
ui:
live_mode: mse # mse | webrtc | jsmpeg
timezone: Europe/Paris
use_experimental_ui: false
@@ -0,0 +1,128 @@
# configuration.yaml Home Assistant OS
# Version anonymisée — secrets externalisés dans secrets.yaml
# ─────────────────────────────────────────────
# CORE
# ─────────────────────────────────────────────
# Charge les intégrations par défaut (UI, historique, log, etc.)
default_config:
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# ─────────────────────────────────────────────
# HTTP Proxy inverse Cloudflare
# L'accès distant passe par le tunnel Cloudflared (sortant).
# L'administration passe par WireGuard hébergé sur le serveur Proxmox.
# ─────────────────────────────────────────────
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24 # Réseau interne add-on Cloudflared
# Pas de WireGuard sur HAOS — le serveur VPN est sur le Proxmox (LXC dédié)
# ─────────────────────────────────────────────
# NOTIFICATIONS Bot Telegram
# ─────────────────────────────────────────────
telegram_bot:
- platform: polling
api_key: !secret telegram_bot_token
allowed_chat_ids:
- !secret telegram_chat_user1
- !secret telegram_chat_user2
notify:
- platform: telegram
name: user1
chat_id: !secret telegram_chat_user1
- platform: telegram
name: user2
chat_id: !secret telegram_chat_user2
# ─────────────────────────────────────────────
# INPUT BOOLEANS Switchs virtuels dashboard
# ─────────────────────────────────────────────
input_boolean:
# Scènes lumière
sunset_switch:
name: Scène lumière ambiante
initial: off
led_bar_switch:
name: Barre LED
initial: off
# Appareils IR
ventilo_switch:
name: Ventilateur
initial: off
diffuseur_switch:
name: Diffuseur arômes
initial: off
# Alarme & Sécurité
sirene_switch:
name: Sirène
initial: off
camera_privacy_switch:
name: Caméra privacy
initial: off
# Maître automatisations
master_automatisations:
name: Automatisations On/Off
initial: on
# ─────────────────────────────────────────────
# SENSORS
# ─────────────────────────────────────────────
sensor: !include sensors.yaml
# ─────────────────────────────────────────────
# TEMPLATE Switch caméra avec inversion privacy
# Le switch HA représente l'état "caméra visible"
# alors que l'entité physique est un switch "privacy" (logique inversée)
# ─────────────────────────────────────────────
template:
- switch:
- name: Caméra
unique_id: camera_privacy_template
state: "{{ is_state('switch.camera_privacy', 'off') }}"
icon: >
{% if is_state('switch.camera_privacy', 'off') %}
mdi:cctv
{% else %}
mdi:cctv-off
{% endif %}
turn_on:
- action: switch.turn_off
target:
entity_id: switch.camera_privacy
turn_off:
- action: switch.turn_on
target:
entity_id: switch.camera_privacy
# ─────────────────────────────────────────────
# HOMEKIT (optionnel)
# Expose certaines entités vers Apple Home
# ─────────────────────────────────────────────
# homekit:
# - name: HAOS Bridge
# port: 21063
# filter:
# include_domains:
# - light
# - switch
# - climate
# - alarm_control_panel
@@ -0,0 +1,66 @@
# configuration.yaml Zigbee2MQTT
# Version anonymisée — clés réseau et mots de passe remplacés
# Adaptateur : Sonoff Zigbee 3.0 USB Dongle Plus V2 (ember)
version: 5
mqtt:
base_topic: zigbee2mqtt
server: mqtt://core-mosquitto:1883
user: mqtt
password: !secret mqtt_password # À définir dans secrets.yaml
serial:
baudrate: 115200
rtscts: false
# Adapter le port selon votre installation :
port: /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_XXXXXXXXXXXXXXXX-if00-port0
adapter: ember
advanced:
log_level: info
channel: 11
network_key: GENERATE # Générer via : zigbee2mqtt/bridge/request/options
pan_id: GENERATE # Générer automatiquement
frontend:
enabled: true
port: 8099
homeassistant:
enabled: true
legacy_action_sensor: false
base_topic: zigbee2mqtt
force_disable_retain: false
include_device_information: false
keepalive: 60
maximum_packet_size: 1048576
reject_unauthorized: true
server: mqtt://core-mosquitto:1883
user: mqtt
version: 4
experimental_event_entities: false
# Appareils Zigbee enregistrés
# Les adresses MAC sont propres à chaque installation
devices:
'0xXXXXXXXXXXXXXXXX':
friendly_name: ir blaster 1
'0xXXXXXXXXXXXXXXXX':
friendly_name: ir blaster 2
'0xXXXXXXXXXXXXXXXX':
friendly_name: sirene
'0xXXXXXXXXXXXXXXXX':
friendly_name: capteur fuite 1
'0xXXXXXXXXXXXXXXXX':
friendly_name: Lampe rouge
'0xXXXXXXXXXXXXXXXX':
friendly_name: Bouton entree
'0xXXXXXXXXXXXXXXXX':
friendly_name: clavier
'0xXXXXXXXXXXXXXXXX':
friendly_name: Lampesdb2
'0xXXXXXXXXXXXXXXXX':
friendly_name: Lampesdb1
'0xXXXXXXXXXXXXXXXX':
friendly_name: bouton sdb