Passe directement à la méthode package
:
sur le même principe que ce post :
cela donnerais :
#fichier config/packages/cuisine/mqtt_fenetre.yaml
sensor:
- platform: mqtt
object_id: "fenetre_open_cuisine_contact"
name: "Cuisine - Fenêtre"
device_class: window
icon: mdi:window-closed-variant
payload_on: false
payload_off: true
availability_topic: "zigbee2mqtt/bridge/state"
value_template: "{{value_json.contact}}"
state_topic: "zigbee2mqtt/fenetre_open_cuisine"
binary_sensor:
- platform: mqtt
state_topic: "home-assistant/window/contact/cuisine"
et par exemple :
#fichier config/packages/salon/mqtt_fenetre.yaml
sensor:
- platform: mqtt
object_id: "fenetre_open_salon_contact"
name: "Salon - Fenêtre"
device_class: window
icon: mdi:window-closed-variant
payload_on: false
payload_off: true
availability_topic: "zigbee2mqtt/bridge/state"
value_template: "{{value_json.contact}}"
state_topic: "zigbee2mqtt/fenetre_open_salon"
binary_sensor:
- platform: mqtt
state_topic: "home-assistant/window/contact/salon"
Bref : comme dit un peu partout :
Elle permet de tout mélanger de façon à tout ranger… (j’adore cette phrase… lol)