Skip to content
Snippets Groups Projects
Commit 4398fe0f authored by void's avatar void
Browse files

automatisierung für zonenstatus

parent 080e34eb
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
- include: ../functions/get_secret.yml - include: ../functions/get_secret.yml
with_items: with_items:
- { path: "{{ basedir }}/warpai_status_update_key", length: -1 }
- { path: "{{ basedir }}/homeassistant_admin_password", length: 12 } - { path: "{{ basedir }}/homeassistant_admin_password", length: 12 }
- { path: "{{ basedir }}/influxdb_password", length: 12 } - { path: "{{ basedir }}/influxdb_password", length: 12 }
- { path: "{{ basedir }}/influxdb_token", length: 32 } - { path: "{{ basedir }}/influxdb_token", length: 32 }
- name: "create folder struct for {{ basedir }}" - name: "create folder struct for {{ basedir }}"
...@@ -22,10 +23,7 @@ ...@@ -22,10 +23,7 @@
dest: "{{ basedir }}/{{ item }}" dest: "{{ basedir }}/{{ item }}"
with_items: with_items:
- docker-compose.yml - docker-compose.yml
- config/automations.yaml
- config/configuration.yaml - config/configuration.yaml
- config/scenes.yaml
- config/scripts.yaml
register: config_files register: config_files
......
...@@ -61,3 +61,50 @@ binary_sensor: ...@@ -61,3 +61,50 @@ binary_sensor:
name: "Switch02" name: "Switch02"
count: 3 count: 3
scan_interval: 5 scan_interval: 5
# https://www.home-assistant.io/integrations/rest_command/
rest_command:
set_zone_status_open:
url: "https://api.warpzone.ms/setstatus?newstatus=OPEN&update_key={{ warpai_status_update_key }}"
method: GET
set_zone_status_closed:
url: "https://api.warpzone.ms/setstatus?newstatus=CLOSED&update_key={{ warpai_status_update_key }}"
method: GET
## Automatisierungen ################################################################
automation zonenstatus:
- alias: Zonenstatus
description: Sendet den Zonenstatus per MQTT und REST
trigger:
- platform: state
entity_id:
- binary_sensor.switch02
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: 'on'
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status
payload: OPEN
- service: rest_command.set_zone_status_open
data: {}
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: 'off'
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status
payload: CLOSED
- service: rest_command.set_zone_status_closed
data: {}
mode: single
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment