encours
avant il faut avoir installer l’addon file editor
Vous avez remarquez que les exemples vous demande souvent d’écrire dans le fichier configuration.yaml, mais avec le temps ce fichier devient de plus en plus gros.
voici donc une des solutions pour organiser votre HA.
le fichier configuration.yaml et la méthode des includes.
homeassistant:
default_config:
#############################
######## google ##########
#############################
tts:
- platform: google_translate
service_name: google_say
language: 'fr'
google:
client_id: !secret id_google
client_secret: !secret code_google
#############################
######## include ##########
#############################
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
device_tracker: !include device_tracker.yaml
input_text: !include input_text.yaml
binary_sensor: !include binary_sensor.yaml
sensor: !include sensor.yaml
climate: !include climate.yaml
input_boolean: !include input_boolean.yaml
input_datetime: !include input_datetime.yaml
input_number: !include input_number.yaml
input_select: !include input_select.yaml
notify: !include notify.yaml
alarm_control_panel: !include alarm_control_panel.yaml
light: !include light.yaml
camera: !include camera.yaml
rest_command: !include rest_command.yaml
remote_homeassistant: !include remote_homeassistant.yaml
#############################
######## cameras ##########
#############################
# camera
# ffmpeg:
# ffmpeg_bin: /usr/bin/ffmpeg
#############################
######### http ##########
#############################
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
#############################
######## freebox ##########
#############################
freebox:
host: !secret ID_free
port: !secret port
#############################
###### media player #########
#############################
media_player:
platform: mpd
host: !secret host
#############################
######## divers ##########
#############################
# mobile_app:
# discovery:
recorder:
purge_keep_days: 5
auto_purge: true
maintenant créez des fichiers au même niveau que votre configuration.yaml
les autres fichiers:
group.yaml
automation.yaml
script.yaml
scenes.yaml
attention dans votre configuration.yaml
vous écriviez:
automation:
- alias: Automation Name
initial_state: false
trigger:
...
dans automation.yaml vous ecrirez:
- id: ''
alias: ' '
description: ''
trigger:
- platform: state
entity_id:
condition: []
action:
......
default: []
mode: single
et oui votre fichier est automation.yaml donc plus besoin de préciser qu’il s’agit d’une automation.