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 447 additions and 69 deletions
---
# Nameskonvention für Server: Pratchett Name/Charaktere
# Namensliste: https://wiki.lspace.org/List_of_Pratchett_characters
# Nächste freie Namen: vimes, cake, colon, detritus, dibbler, dorfl, gaspode, quirm, cherry, nobby, ramkin, ron, shoe, slant, angua, vetinary, bursar, coin, dean, worblehat, luggage. mustrum, rincewind, wrangler, stibbons, whitlow
test:
hosts:
test-warpzone-de:
ansible_ssh_host: 159.69.57.56
ansible_user: root
prod:
hosts:
# Interner Proxmox-Server
# Für Verbindungen über den Webserver als Jumphost folgende Parameter ergänzen:
# ansible_ssh_common_args='-o ForwardAgent=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ProxyCommand="ssh -W %h:%p -q 159.69.57.51"'
weatherwax:
ansible_ssh_host: 192.168.0.200
ansible_user: root
# Externe Server Warpzone
# Öffentlicher Root Server Warpzone bei Hetzner
tiffany:
ansible_ssh_host: 159.69.57.15
ansible_user: root
# Server für interne Dienste
# Container auf dem internen Proxmox Server
# Wichtige Optionen: Nesting = Yes, keyctl = enabled
ogg:
ansible_ssh_host: 192.168.0.201
ansible_user: root
# Server für VPN Verbindung zum Webserver
# Container auf dem internen Proxmox Server
# Wichtige Optionen: Nesting = Yes, keyctl = enabled
carrot:
ansible_ssh_host: 192.168.0.202
ansible_user: root
dhcpdns:
ansible_ssh_host: 10.0.0.2
ansible_user: root
#ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q root@webserver.warpzone.ms"'
# Öffentlicher Webserver Warpzone
# VM auf Tiffany
webserver:
ansible_ssh_host: 159.69.57.51
ansible_user: root
# Vorstands-VM
# VM auf Tiffany
# Auch erreichbar unter verwaltung.warpzone.ms
verwaltung:
ansible_ssh_host: 195.201.179.60
ansible_user: root
event:
hosts:
# Physischer Server für Veranstaltungen / Camps
# warpzone.remote Proxmox-Server
hex:
ansible_ssh_host: 10.111.10.100
ansible_user: root
# Virtueller Server für Infrastruktur-Dienste auf Veranstaltungen / Camps
# Container auf dem warpzone.remote Proxmox-Server
# Wichtige Optionen: Nesting = Yes, keyctl = enabled
hix:
ansible_ssh_host: 10.111.10.101
ansible_user: root
\ No newline at end of file
......@@ -24,15 +24,22 @@
- config/tall-pixel-8x3.ttf
- config/tall-pixel-edit.ttf
- config/frekvens-dot.ttf
register: config
- name: "create config files for {{ servicename }}"
- name: "create docker config for {{ servicename }}"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
- compile.sh
register: config
- name: "create {{ servicename }} configs"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- config/esphome_abluft.yaml
- config/esphome_alarm.yaml
- config/esphome_dach.yaml
- config/esphome_display01.yaml
......@@ -56,15 +63,16 @@
- config/esphome_plug07.yaml
- config/esphome_plug08.yaml
- config/esphome_popcorn.yaml
register: config
- config/esphome_power.yaml
- config/esphome_switchboard.yaml
- name: "stop {{ servicename }} docker"
docker_compose:
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: absent
when: config.changed
- name: "start {{ servicename }} docker"
docker_compose:
community.docker.docker_compose_v2:
project_src: "{{ basedir }}"
state: present
{% set devicename = "esphome_abluft" %}
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.d1_mini.inc.yaml" %}
{% include "/includes/common.inc.yaml" %}
# fan control
output:
- platform: esp8266_pwm
inverted: true
min_power: 0.15
max_power: 0.82
zero_means_zero: true
pin: D1
id: pwmout
fan:
- platform: speed
output: pwmout
name: Speed
sensor:
- platform: pulse_counter
pin:
number: D2
mode: INPUT_PULLUP
unit_of_measurement: 'RPM'
name: RPM
update_interval: 5s
......@@ -3,6 +3,7 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp32-doit-devkit-v1.inc.yaml" %}
comment: Display Kuehlschrank
platformio_options:
lib_deps:
- Wire # Also required by GFX.
......@@ -17,7 +18,6 @@ external_components:
refresh: 0s
{% include "/includes/common.inc.yaml" %}
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -27,6 +27,10 @@ external_components:
payload: "OFF"
then:
- light.turn_off: matrix_light
- topic: warpzone/door/status
payload: "CLOSED"
then:
- light.turn_off: matrix_light
light:
- platform: monochromatic
......@@ -105,7 +109,7 @@ text_sensor:
- platform: mqtt_subscribe
name: "Sensor Stromverbrauch kW"
id: sensor_stromverbrauch_kw
topic: ESPHome/esphome_strommesser/sensor/stromverbrauch/state
topic: ESPHome/esphome_status/sensor/stromverbrauch/state
display:
- platform: obegraensad_panel
......
......@@ -15,7 +15,7 @@ i2c:
# Sensor configs
sensor:
- platform: bme280
- platform: bme280_i2c
temperature:
name: "Temp"
oversampling: 16x
......
......@@ -28,8 +28,8 @@
{% include "/includes/common.inc.yaml" %}
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
- topic: warpzone/door/status
payload: "OPEN"
then:
- light.turn_on:
id: logo_led
......@@ -39,8 +39,8 @@
id: kuehl_led
effect: "Rainbow"
brightness: 100%
- topic: ESPHome/{{ devicename }}/state/command
payload: "OFF"
- topic: warpzone/door/status
payload: "CLOSED"
then:
- light.turn_off: logo_led
- light.turn_off: kuehl_led
......@@ -93,7 +93,8 @@ binary_sensor:
white: 100%
- media_player.play_media:
id: speaker
media_url: 'http://10.0.0.1/filesrv/usb/nootnoot.mp3'
media_url: 'http://fridgeserver.warpzone.lan:5000/audio.php'
light:
- platform: neopixelbus
......@@ -219,12 +220,17 @@ light:
add_led_interval: 100ms
reverse: False
i2s_audio:
- id: i2s_out
i2s_lrclk_pin: GPIO21
i2s_bclk_pin: GPIO19
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
id: speaker
dac_type: external
i2s_lrclk_pin: GPIO21
i2s_audio_id: i2s_out
i2s_dout_pin: GPIO18
i2s_bclk_pin: GPIO19
mode: mono
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: Bullhorn Kuhhorn Muuuuh!
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,10 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
status_led:
pin:
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: LED Theke
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,14 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
- topic: warpzone/door/status_once
payload: "OPEN"
then:
- switch.turn_on: relay
status_led:
pin:
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: Fernseher Lounge
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,14 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
- topic: warpzone/door/status_once
payload: "OPEN"
then:
- switch.turn_on: relay
status_led:
pin:
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: frei
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,10 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
status_led:
pin:
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: Propaganda Bildschirm
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,10 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
substitutions:
plug_name: {{ devicename }}
......@@ -64,6 +70,13 @@ sensor:
id: "${plug_name}_Wattage"
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: ${plug_name}_Energy
power_id: "${plug_name}_Wattage"
# Enable time for energy monitoring
time:
- platform: sntp
output:
# Relay state led
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: Pixelflut Server Rack
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,10 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
substitutions:
plug_name: {{ devicename }}
......@@ -64,6 +70,13 @@ sensor:
id: "${plug_name}_Wattage"
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: ${plug_name}_Energy
power_id: "${plug_name}_Wattage"
# Enable time for energy monitoring
time:
- platform: sntp
output:
# Relay state led
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: Starroof Lounge
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,14 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status
payload: "CLOSED"
then:
- switch.turn_off: relay
- topic: warpzone/door/status_once
payload: "OPEN"
then:
- switch.turn_on: relay
substitutions:
plug_name: {{ devicename }}
......@@ -64,7 +74,14 @@ sensor:
id: "${plug_name}_Wattage"
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: ${plug_name}_Energy
power_id: "${plug_name}_Wattage"
# Enable time for energy monitoring
time:
- platform: sntp
output:
# Relay state led
- platform: esp8266_pwm
......
......@@ -2,8 +2,10 @@
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp01_1m.inc.yaml" %}
comment: WLED Vorhang
{% include "/includes/common.inc.yaml" %}
# force newline
on_message:
- topic: ESPHome/{{ devicename }}/state/command
payload: "ON"
......@@ -13,6 +15,10 @@
payload: "OFF"
then:
- switch.turn_off: relay
- topic: warpzone/door/status_once
payload: "OPEN"
then:
- switch.turn_on: relay
substitutions:
plug_name: {{ devicename }}
......@@ -64,6 +70,13 @@ sensor:
id: "${plug_name}_Wattage"
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: ${plug_name}_Energy
power_id: "${plug_name}_Wattage"
# Enable time for energy monitoring
time:
- platform: sntp
output:
# Relay state led
......
......@@ -135,7 +135,7 @@ climate:
id: pid_heater
name: "PID Heater Controller"
sensor: pot_sensor
default_target_temperature: 240
default_target_temperature: 220
heat_output: pot_heater
control_parameters:
kp: 0.09549
......@@ -168,7 +168,7 @@ sensor:
- platform: pid
name: "PID HEAT Result"
type: HEAT
- platform: bme280
- platform: bme280_i2c
temperature:
name: "Temp"
oversampling: 16x
......@@ -339,7 +339,7 @@ color:
blue: 0%
display:
- platform: ili9341
- platform: ili9xxx
model: TFT 2.4
spi_id: spi_display
cs_pin: GPIO5
......@@ -349,23 +349,23 @@ display:
pages:
- id: page1
lambda: |-
it.printf(160,120,id(text),TextAlign::CENTER,"Booting");
it.printf(160,120,id(text_small),TextAlign::CENTER,"Booting");
- id: page3
lambda: |-
it.printf(160,120,id(temp),TextAlign::CENTER,"%.0f°C",id(pid_heater).current_temperature);
if ((id(pid_heater).action) == 0) {
it.printf(0,10,id(text),TextAlign::TOP_LEFT,"PID: OFF");
it.printf(0,10,id(text_small),TextAlign::TOP_LEFT,"PID: OFF");
}
else if ((id(pid_heater).action) == 3) {
it.printf(0,10,id(text),TextAlign::TOP_LEFT,"PID: HEATING");
it.printf(0,10,id(text_small),TextAlign::TOP_LEFT,"PID: HEATING");
}
else if ((id(pid_heater).action) == 4) {
it.printf(0,10,id(text),TextAlign::TOP_LEFT,"PID: IDLE");
it.printf(0,10,id(text_small),TextAlign::TOP_LEFT,"PID: IDLE");
}
else {
it.printf(0,10,id(text),TextAlign::TOP_LEFT,"PID: ERROR %d",id(pid_heater).action);
it.printf(0,10,id(text_small),TextAlign::TOP_LEFT,"PID: ERROR %d",id(pid_heater).action);
};
it.printf(0,230,id(text),TextAlign::BOTTOM_LEFT,"Target: %.1f°C",id(pid_heater).target_temperature);
it.printf(0,230,id(text_small),TextAlign::BOTTOM_LEFT,"Target: %.1f°C",id(pid_heater).target_temperature);
time:
- platform: sntp
......
{% set devicename = "esphome_power" %}
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp32dev.inc.yaml" %}
{% include "/includes/common.inc.yaml" %}
uart:
id: modbus_uart
tx_pin: 18
rx_pin: 19
baud_rate: 38400
stop_bits: 1
modbus:
send_wait_time: 500ms
uart_id: modbus_uart
id: modbus_sdm
modbus_controller:
- id: sdm630m
address: 0x01
modbus_id: modbus_sdm
update_interval: 20s
sensor:
- platform: sdm_meter
phase_a:
current:
name: "Phase 1 Current"
voltage:
name: "Phase 1 Voltage"
active_power:
name: "Phase 1 Power"
power_factor:
name: "Phase 1 Power Factor"
apparent_power:
name: "Phase 1 Apparent Power"
reactive_power:
name: "Phase 1 Reactive Power"
phase_angle:
name: "Phase 1 Phase Angle"
phase_b:
current:
name: "Phase 2 Current"
voltage:
name: "Phase 2 Voltage"
active_power:
name: "Phase 2 Power"
power_factor:
name: "Phase 2 Power Factor"
apparent_power:
name: "Phase 2 Apparent Power"
reactive_power:
name: "Phase 2 Reactive Power"
phase_angle:
name: "Phase 2 Phase Angle"
phase_c:
current:
name: "Phase 3 Current"
voltage:
name: "Phase 3 Voltage"
active_power:
name: "Phase 3 Power"
power_factor:
name: "Phase 3 Power Factor"
apparent_power:
name: "Phase 3 Apparent Power"
reactive_power:
name: "Phase 3 Reactive Power"
phase_angle:
name: "Phase 3 Phase Angle"
frequency:
name: "Frequency"
total_power:
name: "Total Power"
import_active_energy:
name: "Import Active Energy"
id: import_energy
export_active_energy:
name: "Export Active Energy"
id: export_energy
import_reactive_energy:
name: "Import Reactive Energy"
export_reactive_energy:
name: "Export Reactive Energy"
update_interval: 20s
- platform: template
name: "Net Consumption Energy"
accuracy_decimals: 2
update_interval: 20s
unit_of_measurement: 'kWh'
state_class: total
lambda: return id(import_energy).state - id(export_energy).state;
binary_sensor:
- platform: status
name: "SDM630 Status"
{% set devicename = "esphome_sceneswitches" %}
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.d1_mini.inc.yaml" %}
comment: Die Box zum einstellen unterschiedlicher Lichtszenen
{% include "/includes/common.inc.yaml" %}
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 1"
- platform: gpio
pin:
number: GPIO12
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 2"
- platform: gpio
pin:
number: GPIO13
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 3"
- platform: gpio
pin:
number: GPIO2
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 4"
- platform: gpio
pin:
number: GPIO0
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 5"
- platform: gpio
pin:
number: GPIO4
mode:
input: true
pullup: true
inverted: true
filters:
- delayed_on: 10ms
name: "Button 6"
{% set devicename = "esphome_status" %}
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.d1_mini.inc.yaml" %}
{% include "/includes/board.esp32dev.inc.yaml" %}
{% include "/includes/common.inc.yaml" %}
sensor:
# Das pulse_meter liefert uns die Frequenz der Impulse pro Minute am GPIO2 zu Gnd.
# Das Eltako Strommessgerät besitzt zwei potentialfreie S0 - Impulsausgänge.
# Diese werden durch einen Optokoppler jede 0.00125kWh (800 Impulse / kWh) für ca. 30ms zueinander leitend.
# Hier schließen wir an den einen Kontakt GPIO2 und an den anderen Gnd an.
- platform: pulse_meter
pin:
number: GPIO13
mode:
input: true
pullup: true
unit_of_measurement: 'kW'
name: 'Stromverbrauch'
# Herausfilterung von fehlerhaften Impulsen < 20ms
internal_filter: 20ms
# Genauigkeit auf 1 Watt
accuracy_decimals: 3
filters:
# (800 Impulse / kWh)^-1 * (60 min / h) * (Impulse / min) = 0.075 kW
- multiply: 0.075
# Totaler Stromverbrauch seitdem der ESP läuft
# Eventuell noch abändern auf Stromverbrauch Heute / Woche / Monat und reset durch time (sntp?)
total:
name: "Strom total"
unit_of_measurement: "kWh"
# Genauigkeit auf 1 Watt
accuracy_decimals: 3
filters:
# (800 Impulse / kWh)^-1 = 0.00125kWh
- multiply: 0.00125
binary_sensor:
- platform: gpio
pin:
number: GPIO12
number: 16
mode:
input: true
pullup: true
inverted: true
name: "warpzone Status"
filters:
- delayed_on_off: 500ms
name: "esphome_status_Hauptschalter"
device_class: presence
{% set devicename = "esphome_switchboard" %}
{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.d1_mini.inc.yaml" %}
comment: Ist kaputt
{% include "/includes/common.inc.yaml" %}
binary_sensor:
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: True
name: "{{ devicename }} Button"
on_press:
-
- platform: status
name: "{{ devicename }} Status"
switch:
- platform: virtual
name: "MQTT Switch Test"
id: "switch1"
payload_off: "OFF"
payload_on: "ON"
retain: true
......@@ -19,7 +19,7 @@ dallas:
# Sensor configs
sensor:
- platform: bme280
- platform: bme280_i2c
temperature:
name: "Temp"
oversampling: 16x
......@@ -79,4 +79,4 @@ sensor:
- sliding_window_moving_average:
window_size: 3
send_every: 3
send_first_at: 3
\ No newline at end of file
send_first_at: 3