diff --git a/config/homeassistant/automations/irrigation_a.yml b/config/homeassistant/automations/irrigation_a.yml new file mode 100644 index 0000000..cd830de --- /dev/null +++ b/config/homeassistant/automations/irrigation_a.yml @@ -0,0 +1,23 @@ +- alias: "Trigger irrigation A on" + initial_state: 'on' + trigger: + - platform: time + at: + - "13:25:00" + - "18:00:00" + - "04:00:00" + action: + - service: homeassistant.turn_on + entity_id: switch.irrigation_switch_a + +- alias: "Trigger irrigation A off" + initial_state: 'on' + trigger: + - platform: time + at: + - "13:30:00" + - "18:30:00" + - "04:30:00" + action: + - service: homeassistant.turn_off + entity_id: switch.irrigation_switch_a diff --git a/config/homeassistant/automations/irrigation_b.yml b/config/homeassistant/automations/irrigation_b.yml new file mode 100644 index 0000000..4082d1e --- /dev/null +++ b/config/homeassistant/automations/irrigation_b.yml @@ -0,0 +1,21 @@ +- alias: "Trigger irrigation B on" + initial_state: 'on' + trigger: + - platform: time + at: + - "19:00:00" + - "05:00:00" + action: + - service: homeassistant.turn_on + entity_id: switch.irrigation_switch_b + +- alias: "Trigger irrigation B off" + initial_state: 'on' + trigger: + - platform: time + at: + - "19:30:00" + - "05:30:00" + action: + - service: homeassistant.turn_off + entity_id: switch.irrigation_switch_b diff --git a/config/homeassistant/automations/irrigation_c.yml b/config/homeassistant/automations/irrigation_c.yml new file mode 100644 index 0000000..1d5271a --- /dev/null +++ b/config/homeassistant/automations/irrigation_c.yml @@ -0,0 +1,21 @@ +- alias: "Trigger irrigation C on" + initial_state: 'on' + trigger: + - platform: time + at: + - "20:00:00" + - "06:00:00" + action: + - service: homeassistant.turn_on + entity_id: switch.irrigation_switch_c + +- alias: "Trigger irrigation C off" + initial_state: 'on' + trigger: + - platform: time + at: + - "20:30:00" + - "06:30:00" + action: + - service: homeassistant.turn_off + entity_id: switch.irrigation_switch_c diff --git a/config/homeassistant/configuration.yaml b/config/homeassistant/configuration.yaml index 0b508df..0350145 100644 --- a/config/homeassistant/configuration.yaml +++ b/config/homeassistant/configuration.yaml @@ -6,7 +6,7 @@ default_config: tts: - platform: google_translate -automation: !include automations.yaml +automation: !include_dir_list automations script: !include scripts.yaml scene: !include scenes.yaml @@ -14,6 +14,54 @@ scene: !include scenes.yaml recorder: db_url: postgresql://homeassistant:homeassistant@ha_postgres/ha +# Mqtt +mqtt: + switch: + - unique_id: irrigation_switch_a + name: "Irrigation switch A" + state_topic: "outside/irrigation/state/zoneA" + command_topic: "outside/irrigation/command/zoneA" + availability: + - topic: "outside/irrigation/is_available" + payload_available: "available" + payload_on: "on" + payload_off: "off" + state_on: "on" + state_off: "off" + optimistic: false + qos: 0 + retain: true + + - unique_id: irrigation_switch_b + name: "Irrigation switch B" + state_topic: "outside/irrigation/state/zoneB" + command_topic: "outside/irrigation/command/zoneB" + availability: + - topic: "outside/irrigation/is_available" + payload_available: "available" + payload_on: "on" + payload_off: "off" + state_on: "on" + state_off: "off" + optimistic: false + qos: 0 + retain: true + + - unique_id: irrigation_switch_c + name: "Irrigation switch C" + state_topic: "outside/irrigation/state/zoneC" + command_topic: "outside/irrigation/command/zoneC" + availability: + - topic: "outside/irrigation/is_available" + payload_available: "available" + payload_on: "on" + payload_off: "off" + state_on: "on" + state_off: "off" + optimistic: false + qos: 0 + retain: true + # Nginx setup http: use_x_forwarded_for: true diff --git a/docker-compose.yml b/docker-compose.yml index d29747b..d35838c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,5 @@ version: '3.6' - # # ISOLATED NETWORKS # @@ -203,7 +202,7 @@ services: photoprism: # https://docs.photoprism.app/getting-started/docker-compose/#command-line-interface image: photoprism/photoprism:latest - #restart: unless-stopped + restart: unless-stopped container_name: photoprism security_opt: - seccomp:unconfined