Skip to content
Snippets Groups Projects
Commit 42882761 authored by 3d's avatar 3d
Browse files

update HA config yaml

parent 3f52d091
No related branches found
No related tags found
No related merge requests found
# Loads default set of integrations. Do not remove.
default_config:
......@@ -71,24 +70,93 @@ rest_command:
url: "https://api.warpzone.ms/setstatus?newstatus=CLOSED&update_key={{ warpai_status_update_key }}"
method: GET
# https://www.home-assistant.io/integrations/telegram/
telegram_bot:
- platform: polling
api_key: "{{ telegram_statusbot_token }}"
allowed_chat_ids:
- -1001893089134
- -1001341516106
notify:
- platform: telegram
name: zonenstatus
chat_id: -1001893089134
- platform: telegram
name: stromverbrauch
chat_id: -1001341516106
## Automatisierungen ################################################################
# helper to store zonenstatus
input_select:
zonenstatus:
options:
- open
- closed
icon: mdi:door-open
# current time for
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
automation zonenstatus:
# set zonenstatus
- alias: zonenstatus_set
description: Speichert Zonenstatus in einem Helper
trigger:
- platform: state
entity_id:
- binary_sensor.switch02
from: "off"
to: "on"
- platform: state
entity_id:
- binary_sensor.switch02
from: "on"
to: "off"
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: "on"
sequence:
- service: input_select.select_option
data:
option: open
target:
entity_id: input_select.zonenstatus
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: "off"
sequence:
- service: input_select.select_option
data:
option: closed
target:
entity_id: input_select.zonenstatus
mode: single
- alias: Zonenstatus
description: Sendet den Zonenstatus per MQTT und REST
# send zonenstatus to MQTT, REST
- alias: zonenstatus_send_MQTT_REST
description: Sendet den Zonenstatus per MQTT und REST für Shutdown und SpaceAPI
trigger:
- platform: state
entity_id:
- binary_sensor.switch02
- platform: time_pattern
seconds: /10
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: 'on'
entity_id: input_select.zonenstatus
state: 'open'
sequence:
- service: mqtt.publish
data:
......@@ -98,8 +166,8 @@ automation zonenstatus:
data: {}
- conditions:
- condition: state
entity_id: binary_sensor.switch02
state: 'off'
entity_id: input_select.zonenstatus
state: 'closed'
sequence:
- service: mqtt.publish
data:
......@@ -108,3 +176,35 @@ automation zonenstatus:
- service: rest_command.set_zone_status_closed
data: {}
mode: single
# send zonenstatus to telegram
- alias: zonenstatus_send_telegram
description: Sendet den Zonenstatus per Telegram-Bot
trigger:
- platform: state
entity_id:
- input_select.zonenstatus
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: open
sequence:
- service: telegram_bot.send_message
data:
target: -1001893089134
timeout: 30
message: Die warpzone ist seit {{ '{{' }} states('sensor.time') {{ '}}' }} geöffnet!
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: closed
sequence:
- service: telegram_bot.send_message
data:
target: -1001893089134
timeout: 30
message: Die warpzone ist seit {{ '{{' }} states('sensor.time') {{ '}}' }} geschlossen!
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