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. # Loads default set of integrations. Do not remove.
default_config: default_config:
...@@ -71,24 +70,93 @@ rest_command: ...@@ -71,24 +70,93 @@ rest_command:
url: "https://api.warpzone.ms/setstatus?newstatus=CLOSED&update_key={{ warpai_status_update_key }}" url: "https://api.warpzone.ms/setstatus?newstatus=CLOSED&update_key={{ warpai_status_update_key }}"
method: GET 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 ################################################################ ## 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: 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 # send zonenstatus to MQTT, REST
description: Sendet den Zonenstatus per MQTT und REST - alias: zonenstatus_send_MQTT_REST
description: Sendet den Zonenstatus per MQTT und REST für Shutdown und SpaceAPI
trigger: trigger:
- platform: state - platform: time_pattern
entity_id: seconds: /10
- binary_sensor.switch02
condition: [] condition: []
action: action:
- choose: - choose:
- conditions: - conditions:
- condition: state - condition: state
entity_id: binary_sensor.switch02 entity_id: input_select.zonenstatus
state: 'on' state: 'open'
sequence: sequence:
- service: mqtt.publish - service: mqtt.publish
data: data:
...@@ -98,8 +166,8 @@ automation zonenstatus: ...@@ -98,8 +166,8 @@ automation zonenstatus:
data: {} data: {}
- conditions: - conditions:
- condition: state - condition: state
entity_id: binary_sensor.switch02 entity_id: input_select.zonenstatus
state: 'off' state: 'closed'
sequence: sequence:
- service: mqtt.publish - service: mqtt.publish
data: data:
...@@ -108,3 +176,35 @@ automation zonenstatus: ...@@ -108,3 +176,35 @@ automation zonenstatus:
- service: rest_command.set_zone_status_closed - service: rest_command.set_zone_status_closed
data: {} data: {}
mode: single 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