Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • infrastruktur/ansible-warpzone
  • specki/ansible-warpzone
2 results
Show changes
Showing
with 2597 additions and 17 deletions
version: "3"
services:
app:
image: esphome/esphome:2022.10
image: esphome/esphome:latest
restart: always
volumes:
- "{{ basedir }}/config/:/config"
......
esphome:
name: "{{ devicename }}"
friendly_name: "{{ devicename }}"
esp32:
board: esp32dev
framework:
type: arduino
esphome:
name: "{{ devicename }}"
platform: ESP8266
......@@ -14,6 +14,7 @@ captive_portal:
# Enable OTA
ota:
- platform: esphome
# Enable logging
logger:
......@@ -25,8 +26,8 @@ logger:
web_server:
# local: true
# Activates prometheus /metrics endpoint
prometheus:
# Activates api for home assistant
api:
# MQTT config
mqtt:
......
......@@ -27,8 +27,8 @@ logger:
web_server:
# local: true
# Activates prometheus /metrics endpoint
prometheus:
# Activates api for home assistant
api:
# MQTT config
mqtt:
......
---
- name: "create folder struct for {{ servicename }}"
ansible.builtin.file:
path: "{{ item }}"
state: "directory"
recurse: yes
owner: 33
group: 33
with_items:
- "{{ basedir }}/audio_files/"
- name: copy config files for {{ servicename }}
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
mode: '0755'
with_items:
- docker-compose.yml
register: config_files
- name: "stop {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
---
services:
app:
image: gitlab-registry.warpzone.ms/nandxor/fridge-audioserver:latest
restart: always
environment:
PDIG: 1001
PUDI: 1001
volumes:
- "{{ basedir }}/audio_files:/var/www/html/audio"
ports:
- "5000:80"
labels:
- traefik.enable=false
networks:
- default
- web
networks:
web:
external: true
volumes:
audio_files:
<Files *.php>
deny from all
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/grafana_secret_key", length: 32 }
- { path: "{{ basedir }}/grafana_admin_pass", length: 12 }
- { path: "/srv/mqtt/influxdb_token", length: -1 }
- name: "create folder struct for {{ servicename }} 1"
file:
path: "{{ item }}"
state: "directory"
with_items:
- "{{ basedir }}"
- name: "create folder struct for {{ servicename }} 2"
file:
path: "{{ item }}"
state: "directory"
owner: 472
group: 0
with_items:
- "{{ basedir }}/data/"
- "{{ basedir }}/provisioning/"
- "{{ basedir }}/provisioning/dashboards/"
- "{{ basedir }}/provisioning/dashboards/pixelflut/"
- "{{ basedir }}/provisioning/datasources/"
- name: "create config files for {{ servicename }}"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
- grafana.ini
- provisioning/dashboards/dashboards.yml
- provisioning/dashboards/pixelflut/breakwater.json
- provisioning/datasources/datasources.yml
register: config_files
- name: "stop {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
services:
app:
image: grafana/grafana:latest
restart: always
volumes:
- "{{ basedir }}/grafana.ini:/etc/grafana/grafana.ini"
- "{{ basedir }}/provisioning/:/etc/grafana/provisioning/"
- "{{ basedir }}/data/:/var/lib/grafana"
labels:
- traefik.enable=true
- traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
- traefik.http.routers.{{ servicename }}.entrypoints=websecure
- traefik.http.services.{{ servicename }}.loadbalancer.server.port=3000
networks:
- default
- web
networks:
web:
external: true
##################### Grafana Configuration ##################################
#
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
instance_name = {{ inventory_hostname }}
#
#################################### Server ####################################
[server]
# Protocol (http, https, socket)
protocol = http
# The ip address to bind to, empty will bind to all interfaces
;http_addr =
# The http port to use
http_port = 3000
# The public facing domain name used to access grafana from a browser
domain = {{ domain }}
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false
# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = https://{{ domain }}
# Log web requests
;router_logging = false
# the path relative working path
;static_root_path = public
# enable gzip
;enable_gzip = false
# https certs & key file
;cert_file =
;cert_key =
# Unix socket path
;socket =
#################################### Security ####################################
[security]
# disable creation of admin user on first start of grafana
disable_initial_admin_creation = false
# default admin user, created on startup
admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings
admin_password = {{ grafana_admin_pass }}
# default admin email, created on startup
admin_email = admin@localhost
# used for signing
secret_key = {{ grafana_secret_key }}
# Auto-login remember days
;login_remember_days = 7
;cookie_username = grafana_user
;cookie_remember_name = grafana_remember
# Set to true if you host Grafana behind HTTPS. Default is false.
cookie_secure = true
# Sets the SameSite cookie attribute and prevents the browser from sending this
# cookie along with cross-site requests. The main goal is mitigate the risk of
# cross-origin information leakage. It also provides some protection against cross-site
# request forgery attacks (CSRF), read more here. Valid values are lax, strict and none.
# Default is lax.
cookie_samesite = none
# disable gravatar profile images
;disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port separated by spaces)
;data_source_proxy_whitelist =
# Allow Embedding
allow_embedding = true
[snapshots]
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots-origin.raintank.io
;external_snapshot_name = Publish to snapshot.raintank.io
# remove expired snapshot
;snapshot_remove_expired = true
# remove snapshots after 90 days
;snapshot_TTL_days = 90
#################################### Users ####################################
[users]
# disable user signup / registration
allow_sign_up = false
# Allow non admin users to create organizations
allow_org_create = false
# Set to true to automatically assign new users to the default organization (id 1)
auto_assign_org = true
# Default role new users will be automatically assigned (if disabled above is set to true)
auto_assign_org_role = Viewer
# Background text for the user field on the login page
login_hint = Fallback account
# Default UI theme ("dark" or "light")
default_theme = dark
[auth]
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false
disable_login_form = false
# Auto Login via OAuth
# oauth_auto_login = true
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false
# Use email lookup in addition to the unique ID provided by the IdP
oauth_allow_insecure_email_lookup = false
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
enabled = true
# specify organization name that should be used for unauthenticated users
org_name = Main Org.
#################################### SMTP / Emailing #####################
[smtp]
enabled = false
;host = localhost:25
;user =
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
;password =
;cert_file =
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
;ehlo_identity =
;startTLS_policy =
;enable_tracing = false
#################################### Logging ##########################
[log]
# Either "debug", "info", "warn", "error", "critical", default is "info"
level = debug
#################################### Unified Alerting ####################
[unified_alerting]
# Enable the Alerting sub-system and interface.
enabled = false
# Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled.
disabled_orgs =
# Specify the frequency of polling for admin config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
admin_config_poll_interval = 60s
# Specify the frequency of polling for Alertmanager config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
alertmanager_config_poll_interval = 60s
# Enable or disable alerting rule execution. The alerting UI remains visible.
execute_alerts = true
# Alert evaluation timeout when fetching data from the datasource.
# The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
evaluation_timeout = 30s
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. The default value is 1.
max_attempts = 1
# Minimum interval to enforce between rule evaluations. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
min_interval = 10s
# This is an experimental option to add parallelization to saving alert states in the database.
# It configures the maximum number of concurrent queries per rule evaluated. The default value is 1
# (concurrent queries per rule disabled).
max_state_save_concurrency = 1
# If the feature flag 'alertingSaveStatePeriodic' is enabled, this is the interval that is used to persist the alerting instances to the database.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
state_periodic_save_interval = 5m
# Disables the smoothing of alert evaluations across their evaluation window.
# Rules will evaluate in sync.
disable_jitter = false
# Retention period for Alertmanager notification log entries.
notification_log_retention = 5d
# Duration for which a resolved alert state transition will continue to be sent to the Alertmanager.
resolved_alert_retention = 15m
[unified_alerting.screenshots]
# Enable screenshots in notifications. You must have either installed the Grafana image rendering
# plugin, or set up Grafana to use a remote rendering service.
# For more information on configuration options, refer to [rendering].
capture = false
# The timeout for capturing screenshots. If a screenshot cannot be captured within the timeout then
# the notification is sent without a screenshot. The maximum duration is 30 seconds. This timeout
# should be less than the minimum Interval of all Evaluation Groups to avoid back pressure on alert
# rule evaluation.
capture_timeout = 10s
# The maximum number of screenshots that can be taken at the same time. This option is different from
# concurrent_render_request_limit as max_concurrent_screenshots sets the number of concurrent screenshots
# that can be taken at the same time for all firing alerts where as concurrent_render_request_limit sets
# the total number of concurrent screenshots across all Grafana services.
max_concurrent_screenshots = 5
# Uploads screenshots to the local Grafana server or remote storage such as Azure, S3 and GCS. Please
# see [external_image_storage] for further configuration options. If this option is false then
# screenshots will be persisted to disk for up to temp_data_lifetime.
upload_external_image_storage = false
apiVersion: 1
providers:
# <string> an unique provider name
- name: 'Pixelflut'
# <int> org id. will default to orgId 1 if not specified
# orgId: 1
# <string, required> name of the dashboard folder. Required
folder: 'Pixelflut'
# <string> folder UID. will be automatically generated if not specified
# folderUid: ''
# <string, required> provider type. Required
type: file
# <bool> disable dashboard deletion
# disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: true
options:
# <string, required> path to dashboard files on disk. Required
path: /etc/grafana/provisioning/dashboards/pixelflut
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": 6,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 0,
"y": 0
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_ips",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Connected IPs",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "fixed"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 3,
"y": 0
},
"id": 7,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "sum(breakwater_connections) or vector(0)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Connections",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 25
}
]
},
"unit": "FPS"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 9,
"y": 0
},
"id": 15,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_fps",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "FPS",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "fixed"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binbps"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 12,
"y": 0
},
"id": 19,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "sum(rate(breakwater_bytes[1m])) * 8 or vector(0)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Throughput",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 15,
"y": 0
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "sum(breakwater_bytes) or vector(0)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Total Traffic",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "fixed"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 18,
"y": 0
},
"id": 16,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "sum(rate(breakwater_pixels[1m])) * 8 or vector(0)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Pixels / s",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 3,
"x": 21,
"y": 0
},
"id": 17,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "sum(breakwater_pixels) or vector(0)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Total Pixels",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "IPv4"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "yellow",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "All"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 5
},
"id": 13,
"options": {
"legend": {
"calcs": [
"last",
"max"
],
"displayMode": "table",
"placement": "right"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_ips",
"interval": "",
"legendFormat": "All",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_legacy_ips",
"hide": false,
"interval": "",
"legendFormat": "IPv4",
"refId": "B"
}
],
"title": "Connected IPs",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 5
},
"id": 14,
"interval": "1m",
"options": {
"legend": {
"calcs": [
"last",
"max"
],
"displayMode": "table",
"placement": "right",
"sortBy": "Last",
"sortDesc": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "rate(breakwater_bytes[$__interval]) * 8",
"interval": "",
"legendFormat": "pixelflut.warpzone.lan",
"refId": "A"
}
],
"title": "Traffic / IP",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 13
},
"id": 11,
"options": {
"legend": {
"calcs": [
"last",
"max"
],
"displayMode": "table",
"placement": "right",
"sortBy": "Last",
"sortDesc": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_connections",
"interval": "",
"legendFormat": "pixelflut.warpzone.lan",
"refId": "A"
}
],
"title": "Connections / IP",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 13
},
"id": 18,
"interval": "1m",
"options": {
"legend": {
"calcs": [
"last",
"max"
],
"displayMode": "table",
"placement": "right",
"sortBy": "Last",
"sortDesc": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "rate(breakwater_pixels[$__interval]) * 8",
"interval": "",
"legendFormat": "pixelflut.warpzone.lan",
"refId": "A"
}
],
"title": "Pixels / s / IP",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 25
}
]
},
"unit": "FPS"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "30 FPS"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-green",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 12,
"x": 12,
"y": 21
},
"id": 21,
"options": {
"legend": {
"calcs": [],
"displayMode": "hidden",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "8.4.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "breakwater_fps{}",
"interval": "",
"legendFormat": "Measured",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "P0FAC05DE14135586"
},
"exemplar": true,
"expr": "30",
"hide": false,
"interval": "",
"legendFormat": "30 FPS",
"refId": "B"
}
],
"title": "FPS",
"type": "timeseries"
}
],
"refresh": false,
"schemaVersion": 35,
"style": "dark",
"tags": [
"pixelflut",
"breakwater"
],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Pixelflut overview",
"uid": "bfgb09843",
"weekStart": ""
}
apiVersion: 1
datasources:
- name: MQTT_Flux
type: influxdb
access: proxy
url: http://{{ int_ip4 }}:{{ mqtt_influxdb_port }}
jsonData:
version: Flux
organization: mqtt
defaultBucket: mqtt
tlsSkipVerify: true
secureJsonData:
token: {{ influxdb_token }}
- name: MQTT_InfluxQL
type: influxdb
access: proxy
url: http://{{ int_ip4 }}:{{ mqtt_influxdb_port }}
# This database should be mapped to a bucket
database: mqtt
jsonData:
httpMode: GET
httpHeaderName1: 'Authorization'
secureJsonData:
httpHeaderValue1: 'Token {{ influxdb_token }}'
{% if inventory_hostname == 'hix' %}
- name: Prometheus
type: prometheus
access: proxy
url: http://{{ int_ip4 }}:9090
{% endif %}
{% if inventory_hostname == 'ogg' %}
- name: Pixelflut
type: prometheus
access: proxy
url: http://pixelflut.warpzone.lan:9090
uuid: P0FAC05DE14135586
{% endif %}
---
- name: create folder struct for {{ servicename }}
- name: "create folder struct for {{ servicename }}"
ansible.builtin.file:
path: "{{ item }}"
state: "directory"
......@@ -7,15 +8,22 @@
with_items:
- "{{ basedir }}/config"
- name: copy config files for {{ servicename }}
- name: "copy config files for {{ servicename }}"
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
mode: '0755'
with_items:
- docker-compose.yml
register: config_files
- name: start {{ servicename }}
community.docker.docker_compose:
state: present
- name: "stop {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
---
version: "2.1"
services:
app:
image: lscr.io/linuxserver/heimdall:2.5.3
image: lscr.io/linuxserver/heimdall:latest
restart: always
environment:
- PUID=1000
......
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/warpai_status_update_key", length: -1 }
- { path: "{{ basedir }}/portal_password", length: -1 }
- { path: "{{ basedir }}/homeassistant_admin_password", length: 12 }
- { path: "{{ basedir }}/influxdb_password", length: 12 }
- { path: "{{ basedir }}/influxdb_token", length: 32 }
- { path: "{{ basedir }}/telegram_statusbot_token", length: 46 }
- name: "create folder struct for {{ basedir }}"
file:
path: "{{ item }}"
state: "directory"
with_items:
- "{{ basedir }}"
- "{{ basedir }}/config/"
- name: "copy config files for {{ basedir }}"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
- config/configuration.yaml
register: config_files
- name: "stop {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
# Loads default set of integrations. Do not remove.
default_config:
# includes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# https://www.home-assistant.io/docs/configuration/basic/
homeassistant:
name: "warpzone"
latitude: 51.944514
longitude: 7.638933
elevation: 70
unit_system: metric
currency: EUR
country: DE
time_zone: Europe/Berlin
internal_url: https://{{ domain }}
auth_providers:
- type: trusted_networks
trusted_networks:
- 10.0.0.0/22
- 192.168.0.0/24
allow_bypass_login: true
- type: homeassistant
# https://www.home-assistant.io/integrations/http/
http:
server_port: 8123
ip_ban_enabled: False
login_attempts_threshold: 10
use_x_forwarded_for: true
trusted_proxies:
- 172.0.0.0/8
# https://www.home-assistant.io/integrations/api/
api:
# https://www.home-assistant.io/integrations/logger
# log_level= critical, fatal, error, warning, warn, info, debug, notset
logger:
default: info
# https://www.home-assistant.io/integrations/influxdb/
influxdb:
api_version: 2
host: influxdb
port: 8086
ssl: false
organization: homeassistant
bucket: homeassistant
token: {{ influxdb_token }}
default_measurement: units
# eQ3 Max
maxcube:
gateways:
- host: {{ eq3max.cube_host }}
port: 62910
scan_interval: 60
# zonenstatus wird vom hauptschalter gesteuert, switch02 ping ist nicht mehr notwendig
# https://www.home-assistant.io/integrations/ping/
#binary_sensor:
# - platform: ping
# host: TL-SG3452X
# name: "Switch02"
# count: 3
# scan_interval: 20
# https://www.home-assistant.io/integrations/tts/
tts:
- platform: picotts
language: "de-DE"
# 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
set_lounge_matrix_off:
url: "http://led-matrix.warpzone.lan/play/off.png"
method: GET
set_lounge_matrix_on:
url: "http://led-matrix.warpzone.lan/skip"
method: GET
open_door:
url: "http://shippo.warpzone.lan:7000/open_door?username=warpzone&password={{ portal_password }}"
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 zonenstatus telegram
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
automation ansible:
# Autodiscovery für Licht Hackcenter
# Das Licht Hackcenter besteht eigentlich aus zwei geräten, einem DALI-Controller und einem Tasmota-Schalter.
# - Der Tasmota Schalter, schaltet generell den Strom ein und aus.
# - Der Dali Controller ist für die Regelung der Helligkeit verantwortlich. (Wertebereich 0 - 255)
# Die Automatisierung erstellt eine Autodiscovery-Konfiguration für HomeAssistant,
# die beide Geräte als ein Licht darstellt.
# Die Autodiscovery Message wird automatisch beim Start von HomeAssistant gesendet.
- alias: ANSIBLE_autodiscovery_light_hackcenter
description: "MQTT Autodiscovery für Licht Hackcenter"
mode: single
triggers:
- trigger: homeassistant
event: start
action:
- service: mqtt.publish
data:
topic: "homeassistant/light/licht_hackcenter_01/config"
retain: true
qos: 0
payload: >
{
"name": "Licht Hackcenter",
"unique_id": "licht_hackcenter_01",
"object_id": "licht_hackcenter",
"state_topic": "stat/tasmota_B1233C/POWER",
"command_topic": "cmnd/tasmota_B1233C/Power1",
"brightness_state_topic": "light/dali_out",
"brightness_command_topic": "light/dali_in",
"qos": 0,
"payload_on": "ON",
"payload_off": "OFF",
"optimistic": false,
"device": {
"identifiers": ["licht_hackcenter_01"],
"name": "Licht Hackcenter",
"manufacturer": "warpzone",
"model": "DALI"
}
}
# Abluft dauerhaft an
- alias: ANSIBLE_Abluft_dauer_an
description: Verhindert Ausschalten der Abluft und setzt festen Wert bei schließen der Zone
mode: restart
triggers:
- type: turned_off
device_id: 96844a416179e61fff99195b6a16522e
entity_id: 466bdccea823dfee632a8feac65399a2
domain: fan
for:
hours: 0
minutes: 0
seconds: 1
trigger: device
- entity_id:
- input_select.zonenstatus
from: open
to: closed
for:
hours: 0
minutes: 0
seconds: 1
trigger: state
conditions: []
actions:
- if:
- condition: state
entity_id: sensor.season
state: summer
then:
- action: fan.turn_on
metadata: {}
data:
percentage: 15
target:
device_id: 96844a416179e61fff99195b6a16522e
else:
- action: fan.turn_on
metadata: {}
data:
percentage: 20
target:
device_id: 96844a416179e61fff99195b6a16522e
- alias: ANSIBLE_Zonenshutdown
mode: single
triggers:
- trigger: state
entity_id:
- input_select.zonenstatus
from: open
to: closed
conditions: []
actions:
- parallel:
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_backcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_dreckcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_gehcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_hackcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_kackcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_loetcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_rackcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_saal1_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_schnackcenter_aus
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_hackcenter_licht_nach_shutdown
- alias: ANSIBLE_Zonenboot
mode: single
triggers:
- trigger: state
entity_id:
- input_select.zonenstatus
from: closed
to: open
conditions: []
actions:
- parallel:
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_backcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_dreckcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_gehcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_hackcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_kackcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_loetcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_rackcenter_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_saal1_an
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: automation.ANSIBLE_ZONE_schnackcenter_an
# set zonenstatus
- alias: ANSIBLE_zonenstatus_set
description: Speichert Zonenstatus in einem Helper
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.esphome_status_hauptschalter
from: "off"
to: "on"
- platform: state
entity_id:
- binary_sensor.esphome_status_hauptschalter
from: "on"
to: "off"
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.esphome_status_hauptschalter
state: "on"
sequence:
- service: input_select.select_option
data:
option: open
target:
entity_id: input_select.zonenstatus
- conditions:
- condition: state
entity_id: binary_sensor.esphome_status_hauptschalter
state: "off"
sequence:
- service: input_select.select_option
data:
option: closed
target:
entity_id: input_select.zonenstatus
# send zonenstatus to MQTT, REST
- alias: ANSIBLE_zonenstatus_send_MQTT_REST
description: Sendet den Zonenstatus per MQTT und REST für Shutdown und SpaceAPI
trigger:
- platform: time_pattern
seconds: /10
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: 'open'
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status
payload: OPEN
- service: rest_command.set_zone_status_open
data: {}
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: 'closed'
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status
payload: CLOSED
- service: rest_command.set_zone_status_closed
data: {}
mode: restart
# send zonenstatus once on change to MQTT
- alias: ANSIBLE_zonenstatus_send_once_MQTT
description: Sendet den Zonenstatus EINMALIG (on change) per MQTT
trigger:
- platform: state
entity_id:
- input_select.zonenstatus
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: open
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status_once
payload: OPEN
- conditions:
- condition: state
entity_id: input_select.zonenstatus
state: closed
sequence:
- service: mqtt.publish
data:
topic: warpzone/door/status_once
payload: CLOSED
mode: restart
# send zonenstatus to telegram
- alias: ANSIBLE_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: restart
# Stromverbrauch auf Telegram senden
- alias: ANSIBLE_stromverbrauch_send_telegram
description: Sendet alle 10 Minuten den Stromverbrauch per Telegram
trigger:
- platform: time_pattern
minutes: /10
condition: []
action:
- if:
- condition: state
entity_id: automation.ansible_zonenstatus_send_telegram
attribute: current
state: "1"
then:
- wait_for_trigger:
- platform: state
entity_id:
- automation.ansible_zonenstatus_send_telegram
attribute: current
to: "0"
- service: telegram_bot.send_message
data:
target: -1001341516106
timeout: 30
message: >
Zähler Power: {{ '{{' }} states('sensor.esphome_power_total_power') {{ '}}' }} W
Solar Power: {{ '{{' }} states('sensor.hms_1600_4t_power')|float(0) {{ '}}' }} W
Temperatur Hackcenter: {{ '{{' }} states('sensor.temp') {{ '}}' }} °C
mode: restart
# Feinstaubsensor steuert Luftfilter
- alias: ANSIBLE_Feinstaubsensor_Luftfilter
description: Feinstaubsensor steuer Luftfilter
trigger:
- platform: time_pattern
seconds: /10
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
below: 36
sequence:
- service: fan.set_percentage
data:
percentage: 33
target:
device_id: 8b6ff876340558ef11d13441afecec8d
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
above: 35
below: 86
sequence:
- service: fan.set_percentage
data:
percentage: 66
target:
device_id: 8b6ff876340558ef11d13441afecec8d
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
above: 85
sequence:
- service: fan.set_percentage
data:
percentage: 100
target:
device_id: 8b6ff876340558ef11d13441afecec8d
mode: restart
# Feinstaubsensor steuert Ampel
- alias: ANSIBLE_Feinstaubsensor_Ampel
description: Feinstaubsensor status auf Ampel anzeigen
trigger:
- platform: time_pattern
seconds: /10
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
below: 36
sequence:
- device_id: e26403f906b93f7c6b4f5339a21f9b26
domain: select
entity_id: select.ampel_preset
type: select_option
option: Green static
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
above: 35
below: 86
sequence:
- device_id: e26403f906b93f7c6b4f5339a21f9b26
domain: select
entity_id: select.ampel_preset
type: select_option
option: Orange static
- conditions:
- condition: numeric_state
entity_id: sensor.feinstaub_2_5
above: 85
sequence:
- device_id: e26403f906b93f7c6b4f5339a21f9b26
domain: select
entity_id: select.ampel_preset
type: select_option
option: Red static
mode: restart
# Türöffner Knopf
- alias: ANSIBLE_Button_Türöffner
description: ""
mode: single
triggers:
- domain: mqtt
device_id: 388988a29515369fb821e4e0ff8d9e27
type: action
subtype: single
trigger: device
conditions: []
actions:
- action: rest_command.open_door
metadata: {}
data: {}
- alias: ANSIBLE_ZONE_backcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: backcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: backcenter
mode: single
- alias: ANSIBLE_ZONE_dreckenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: dreckcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: dreckcenter
mode: single
- alias: ANSIBLE_ZONE_gehcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: gehcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: gehcenter
mode: single
- alias: ANSIBLE_ZONE_hackcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: hackcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: hackcenter
mode: single
- alias: ANSIBLE_ZONE_kackcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: kackcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: kackcenter
mode: single
- alias: ANSIBLE_ZONE_loetcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: loetcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: loetcenter
mode: single
- alias: ANSIBLE_ZONE_rackcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: rackcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: rackcenter
mode: single
- alias: ANSIBLE_ZONE_saal1_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: saal_1
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: saal_1
mode: single
- alias: ANSIBLE_ZONE_schnackcenter_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: schnackcenter
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: schnackcenter
mode: single
- alias: ANSIBLE_ZONE_NoAutoOn_aus
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: NoAutoOn
- action: switch.turn_off
metadata: {}
data: {}
target:
area_id: NoAutoOn
mode: single
- alias: ANSIBLE_hackcenter_licht_nach_shutdown
description: ""
mode: single
triggers: []
conditions: []
actions:
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
device_id: c4f8f83fb287ba7b1d66b674a1564c75
- alias: ANSIBLE_ZONE_backcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: backcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: backcenter
mode: single
- alias: ANSIBLE_ZONE_dreckenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: dreckcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: dreckcenter
mode: single
- alias: ANSIBLE_ZONE_gehcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: gehcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: gehcenter
mode: single
- alias: ANSIBLE_ZONE_hackcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: hackcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: hackcenter
mode: single
- alias: ANSIBLE_ZONE_kackcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: kackcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: kackcenter
mode: single
- alias: ANSIBLE_ZONE_loetcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: loetcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: loetcenter
mode: single
- alias: ANSIBLE_ZONE_rackcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: rackcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: rackcenter
mode: single
- alias: ANSIBLE_ZONE_saal1_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: saal_1
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: saal_1
mode: single
- alias: ANSIBLE_ZONE_schnackcenter_an
description: ""
triggers: []
conditions: []
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
area_id: schnackcenter
- action: switch.turn_on
metadata: {}
data: {}
target:
area_id: schnackcenter
mode: single
\ No newline at end of file
version: "3"
services:
app:
image: openhab/openhab:3.3.0-debian
image: homeassistant/home-assistant:latest
restart: always
# The command node is very important. It overrides
# the "gosu openhab tini -s ./start.sh" command from Dockerfile and runs as root!
command: "tini -s ./start.sh server"
ports:
- "{{ int_ip4 }}:{{ homematic_callback_port }}:{{ homematic_callback_port }}"
volumes:
- "/boot/cmdline.txt:/boot/cmdline.txt:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "{{ basedir }}/addons:/openhab/addons"
- "{{ basedir }}/conf:/openhab/conf"
- "{{ basedir }}/userdata:/openhab/userdata"
- "{{ basedir }}/config:/config"
environment:
OPENHAB_HTTP_PORT: 8080
OPENHAB_HTTPS_PORT: 8443
EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
TZ: "Europe/Berlin"
labels:
- traefik.enable=true
- traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
- traefik.http.routers.{{ servicename }}.entrypoints=websecure
- traefik.http.services.{{ servicename }}.loadbalancer.server.port=8080
- traefik.http.services.{{ servicename }}.loadbalancer.server.port=8123
networks:
- default
- web
......@@ -33,18 +23,18 @@ services:
influxdb:
image: influxdb:2.6.0
image: influxdb:2
restart: always
ports:
- {{ int_ip4 }}:{{ influxdb_port }}:8086
- "{{ int_ip4 }}:{{ influxdb_port }}:8086"
volumes:
- "{{ basedir }}/influxdb:/var/lib/influxdb2"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: openhab
DOCKER_INFLUXDB_INIT_USERNAME: homeassistant
DOCKER_INFLUXDB_INIT_PASSWORD: {{ influxdb_password }}
DOCKER_INFLUXDB_INIT_ORG: openhab
DOCKER_INFLUXDB_INIT_BUCKET: openhab
DOCKER_INFLUXDB_INIT_ORG: homeassistant
DOCKER_INFLUXDB_INIT_BUCKET: homeassistant
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: {{ influxdb_token }}
networks:
- default
......
---
- include: ../functions/get_secret.yml
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/influxdb_password", length: 12 }
- { path: "{{ basedir }}/influxdb_token", length: 24 }
......@@ -22,10 +22,19 @@
with_items:
- docker-compose.yml
- mosquitto.conf
- telegraf.conf
- settings.json
- telegraf_binary.conf
- telegraf_float.conf
register: config_files
- name: "stop {{ servicename }} docker"
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
docker_compose:
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present