diff --git a/Makefile b/Makefile index 4bf04ee..7befaf8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: default all ui-minimalist config sensors +.PHONY: default all ui-minimalist config sensors automations NAMESPACE := home-assistant POD_ID := $(shell kubectl -n home-assistant get pod --selector=app.kubernetes.io/name=home-assistant --template "{{range .items}}{{.metadata.name}}{{\"\n\"}}{{end}}") @@ -6,7 +6,7 @@ CONFIG_FILES := configuration.yaml secrets.yaml input_boolean.yaml ui-lovelace.y default: all -all: ui-minimalist config sensors +all: ui-minimalist config sensors automations config: for FILE in $(CONFIG_FILES); do \ @@ -18,3 +18,6 @@ ui-minimalist: sensors: kubectl cp sensors $(NAMESPACE)/$(POD_ID):/config + +automations: + kubectl cp automations $(NAMESPACE)/$(POD_ID):/config diff --git a/automations/shoppinglist.yaml b/automations/shoppinglist.yaml new file mode 100644 index 0000000..ad4a798 --- /dev/null +++ b/automations/shoppinglist.yaml @@ -0,0 +1,11 @@ +alias: shopping list alert +trigger: + - platform: zone + zone: zone.coop + entity_id: + - person.jonas +action: + - service: notify.gotify_1 + data: + title: Inköpslitan! + message: Glöm inte bort att kolla inköpslistan diff --git a/configuration.yaml b/configuration.yaml index 14b6895..4ea3d0c 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -54,8 +54,18 @@ http: mqtt: discovery_prefix: homeassistant +notify: + - name: gotify_1 + platform: rest + resource: http://gotify/message + method: POST_JSON + headers: + X-Gotify-Key: !secret gotify_app_key + message_param_name: message + title_param_name: title + zone: !secret zones -automation: !include automations.yaml +automation: !include_dir_list automations script: !include scripts.yaml scene: !include scenes.yaml input_boolean: !include input_boolean.yaml