Skip to content

Commit

Permalink
Fedora 40 support, HA additions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeeq committed May 1, 2024
1 parent b15bbc6 commit 5de9c08
Show file tree
Hide file tree
Showing 18 changed files with 446 additions and 189 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM fedora:39
FROM fedora:40

# ENV container docker
ENV FEDORA_USERNAME=mikee

# https://github.com/wagoodman/dive/releases
ARG DIVE_VERSION=0.11.0
ARG DIVE_VERSION=0.12.0
# https://github.com/hadolint/hadolint/releases
ARG HADOLINT_VERSION=2.12.0

Expand All @@ -28,18 +28,18 @@ rm -f /lib/systemd/system/basic.target.wants/*; \
rm -f /lib/systemd/system/anaconda.target.wants/*;

# https://pypi.org/project/pip/
RUN pip3 install --no-cache-dir --upgrade pip==23.3.1 && \
RUN pip3 install --no-cache-dir --upgrade pip==24.0 && \
pip3 install --no-cache-dir \
# https://pypi.org/project/ansible/
ansible==8.5.0 \
ansible==9.5.1 \
# https://pypi.org/project/ansible-lint/
ansible-lint==6.22.0 \
ansible-lint==24.2.3 \
# https://pypi.org/project/yamllint/
yamllint==1.32.0 \
yamllint==1.35.1 \
# https://pypi.org/project/packaging/
packaging==23.2 \
packaging==24.0 \
# https://pypi.org/project/pyOpenSSL/
pyOpenSSL==23.3.0
pyOpenSSL==24.1.0

# Dive
RUN curl -LO https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.tar.gz && \
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ RUN apt-get update \
&& apt-get clean all

# https://pypi.org/project/pip/
RUN pip3 install --no-cache-dir --upgrade pip==23.3.1 && \
RUN pip3 install --no-cache-dir --upgrade pip==24.0 && \
pip3 install --no-cache-dir \
# https://pypi.org/project/ansible/
ansible==8.5.0 \
ansible==9.5.1 \
# https://pypi.org/project/ansible-lint/
ansible-lint==6.22.0 \
ansible-lint==24.2.3 \
# https://pypi.org/project/yamllint/
yamllint==1.32.0 \
yamllint==1.35.1 \
# https://pypi.org/project/packaging/
packaging==23.2 \
packaging==24.0 \
# https://pypi.org/project/pyOpenSSL/
pyOpenSSL==23.3.0
pyOpenSSL==24.1.0

RUN useradd ${UBUNTU_USERNAME} && usermod -aG sudo ${UBUNTU_USERNAME}

Expand Down
14 changes: 7 additions & 7 deletions inventory/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ all:
children:
publicdns:
privatedns:
nordvpngateway:
vpngateway:
cloudflaregateway:
openvpn:

Expand Down Expand Up @@ -58,17 +58,17 @@ privatedns:
hosts:
dns2:

# nordvpngateway:
# hosts:
# gw1:
vpngateway:
hosts:
gw1:

# cloudflaregateway:
# hosts:
# gw2:

# openvpn:
# hosts:
# vpn1:
openvpn:
hosts:
vpn1:

openwrt:
vars:
Expand Down
1 change: 1 addition & 0 deletions playbooks/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dnf_pkgs:
- ShellCheck
- smartmontools
- python3.11
- cargo

dnf_gui_pkgs:
- clamtk
Expand Down
2 changes: 1 addition & 1 deletion roles/apps/oh_my_zsh/templates/oh_my_zsh_zshrc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins=(
source $ZSH/oh-my-zsh.sh

{% if item != 'root' %}
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$HOME/.cargo/bin:$PATH"
{% endif %}

# Extracting Dockerfile from image
Expand Down
29 changes: 19 additions & 10 deletions roles/servers/apps/home-assistant/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,29 @@ home_assistant_custom_lovelace_plugins:
- name: 'lovelace-multiple-entity-row'
entity_name: 'multiple-entity-row.js'
repo: https://github.com/benct/lovelace-multiple-entity-row
version: v4.5.0
# - name: 'lovelace-xiaomi-vacuum-map-card'
# entity_name: 'xiaomi-vacuum-map-card.js'
# repo: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card.git
# version: master
# version: v4.5.0
- name: 'button-card'
entity_name: 'button-card.js'
repo: https://github.com/custom-cards/button-card
release: true
version: v4.1.2
- name: 'vacuum-card'
entity_name: 'vacuum-card.js'
repo: https://github.com/denysdovhan/vacuum-card
release: true
version: v2.9.2

home_assistant:
automations:
inching:
- entity_id: switch.4chpror3_switch_garaz_brama
- entity_id: switch.4chpror3_switch_dwor_brama
- entity_id: switch.4chpror3_switch_dwor_furtka
- entity_id: switch.sonoff_4chpror3_garaz_4chpror3_switch_garaz_brama
- entity_id: switch.sonoff_4chpror3_dwor_4chpror3_switch_dwor_brama
- entity_id: switch.sonoff_4chpror3_dwor_4chpror3_switch_dwor_furtka
inching_seconds: 15
- entity_id: switch.4chpror3_swiatlo_garaz_wew
- entity_id: switch.4chpror3_swiatlo_garaz_zew
- entity_id: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_wew
- entity_id: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_zew
- entity_id: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_brama_dwor_btn

mqtt:
zigbee_coordinator_base_topic: "tasmota_10B490"
sonoff:
Expand All @@ -58,6 +66,7 @@ home_assistant:
- name: dol_1
door:
- name: garaz_brama
- name: dwor_brama
zbmini:
- name: sypialnia_gora
power_plug:
Expand Down
13 changes: 12 additions & 1 deletion roles/servers/apps/home-assistant/tasks/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@
- "{{ install_path }}/config/www"
- "{{ install_path }}/config/git"

- name: "Pull custom components"
- name: "Pull custom components via git"
git:
repo: "{{ item.repo }}"
dest: "{{ install_path }}/config/git/{{ item.name }}"
update: true
version: "{{ item.version | default('HEAD') }}"
when: item.release is not defined or item.release != true
with_items:
- "{{ home_assistant_custom_components }}"
- "{{ home_assistant_custom_lovelace_plugins }}"

# https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/releases/download/v2.2.2/xiaomi-vacuum-map-card.js
- name: "Pull custom components via release"
get_url:
url: "{{ item.repo }}//releases/download/{{ item.version }}/{{ item.entity_name }}"
dest: "{{ install_path }}/config/git/{{ item.name }}/{{ item.entity_name }}"
when: item.release is defined and item.release == true
with_items:
- "{{ home_assistant_custom_components }}"
- "{{ home_assistant_custom_lovelace_plugins }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/servers/apps/home-assistant/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

- import_tasks: custom.yml
- import_tasks: config.yml
# - import_tasks: config_mosquitto.yml
- import_tasks: config_mosquitto.yml
- import_tasks: install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
target:
entity_id: switch.gosund_switch_pompa_cyrkulacyjna
mode: single
- alias: Click button to close dwor_brama
description: ''
trigger:
- platform: state
entity_id:
- switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_brama_dwor_btn
from: "off"
to: "on"
condition: []
action:
- service: switch.toggle
metadata: {}
data: {}
target:
entity_id: switch.sonoff_4chpror3_dwor_4chpror3_switch_dwor_brama
mode: single
# - alias: Alert Brama
# description: ''
# trigger:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ lovelace:
icon: mdi:tools
show_in_sidebar: true
require_admin: true
lovelace-tesla:
mode: yaml
filename: dashboard-tesla.yaml
title: Tesla
icon: mdi:car
show_in_sidebar: true
require_admin: false
# Info: Change ?ver= to force browser to refresh new custom resources
resources:
- url: /local/multiple-entity-row.js?ver=1
type: module
- url: /local/button-card.js?ver=1
type: module
- url: /local/vacuum-card.js?ver=1
type: module

# Text to speech
tts:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
views:
- title: Home
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.sonoff_4chpror3_dwor_4chpror3_switch_dwor_brama
name: Brama Dwor
icon: mdi:gate
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.sonoff_4chpror3_garaz_4chpror3_switch_garaz_brama
name: Brama Garazowa
icon: mdi:garage-variant
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_wew
name: Garaz Swiatlo
icon: mdi:lightbulb-fluorescent-tube
- type: entities
entities:
- entity: binary_sensor.door_state_dwor_brama
name: Dwor Brama stan
icon: mdi:gate
- entity: binary_sensor.door_state_garaz_brama
name: Garaz Brama stan
icon: mdi:garage-variant
# - entity: sensor.th_temperature_ogrod
# type: custom:button-card
# name: Ogrod
# show_state: false
# secondary_info: last-changed
# entities:
# - entity: sensor.th_temperature_ogrod
# name: Temperatura
# - entity: sensor.th_humidity_ogrod
# name: Wilgotnosc
# - entity: sensor.th_battery_percentage_ogrod
# name: Bateria
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
j_username: !secret energa_username
j_password: !secret energa_password
sensor:
- unique_id: consumed_energy_total
- unique_id: consumed_energy_dzien_total
name: Consumed energy total
select: 'div#right > table > tr:nth-of-type(1) > td.last'
value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
Expand All @@ -44,12 +44,30 @@
state_class: total_increasing
on_error:
value: last
- unique_id: donated_energy_total
name: Donated energy total
- unique_id: consumed_energy_noc_total
name: Consumed energy total
select: 'div#right > table > tr:nth-of-type(3) > td.last'
value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
on_error:
value: last
- unique_id: donated_energy_dzien_total
name: Donated energy total
select: 'div#right > table > tr:nth-of-type(5) > td.last'
value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
on_error:
value: last
- unique_id: donated_energy_noc_total
name: Donated energy total
select: 'div#right > table > tr:nth-of-type(7) > td.last'
value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
on_error:
value: last
Loading

0 comments on commit 5de9c08

Please sign in to comment.