From c0a3a82dc77b7ddbfb248d10cc073c9e9b761ad2 Mon Sep 17 00:00:00 2001 From: mikeeq Date: Sat, 27 Apr 2024 02:24:49 +0200 Subject: [PATCH] Add latest changes --- playbooks/vms.yml | 62 ++++++++++++++++--- .../apps/home-assistant/defaults/main.yml | 1 + .../templates/config/multiscrape.yaml | 24 ++++++- .../templates/config/ui-lovelace.yaml | 43 +++++-------- 4 files changed, 90 insertions(+), 40 deletions(-) diff --git a/playbooks/vms.yml b/playbooks/vms.yml index f4f5c8c8..c445ac76 100644 --- a/playbooks/vms.yml +++ b/playbooks/vms.yml @@ -8,6 +8,7 @@ # hosts: clevo # become: true # tasks: +<<<<<<< Updated upstream # - name: Upgrade all packages # ansible.builtin.dnf: # name: "*" @@ -34,16 +35,47 @@ # ansible.builtin.import_playbook: generic-core.yml # vars: # hosts_to_deploy: vms +======= +# - name: Clean DNF +# shell: dnf clean all -- name: Provision DNS1 - hosts: - - dns1 - become: true - roles: - - servers/network-static-dns - - apps/docker - - servers/apps/coredns - - servers/apps/letsencrypt-coredns +# - name: Upgrade all packages +# ansible.builtin.dnf: +# name: "*" +# state: latest +# update_cache: true + +# - name: Check if reboot required +# stat: +# path: /var/run/reboot-required +# register: reboot_required_file + +# # TODO: Fix reboot on Clevo +# - name: Reboot if required +# reboot: +# when: +# - reboot_required_file.stat.exists == true +# - inventory_hostname != "mikeeClevo" + +# - name: Autoremove unneeded packages installed as dependencies +# ansible.builtin.dnf: +# autoremove: yes +>>>>>>> Stashed changes + +# - name: Set variables on an imported playbook +# ansible.builtin.import_playbook: generic-core.yml +# vars: +# hosts_to_deploy: vms + +# - name: Provision DNS1 +# hosts: +# - dns1 +# become: true +# roles: +# - servers/network-static-dns +# - apps/docker +# - servers/apps/coredns +# - servers/apps/letsencrypt-coredns - name: Provision DNS2 hosts: @@ -54,6 +86,7 @@ - apps/docker - servers/apps/adguard-home +<<<<<<< Updated upstream # - name: Provision GW1 # hosts: # - gw1 @@ -80,6 +113,17 @@ # # - servers/apps/home-assistant # - servers/apps/jenkins +======= +# - name: Provision mikeeClevo +# hosts: +# - mikeeClevo +# become: true +# roles: +# - servers/apps/nginx +# # - servers/apps/home-assistant +# - servers/apps/jenkins + +>>>>>>> Stashed changes # - name: Cleanup Docker # hosts: clevo:!gw1:!vpn1 # become: true diff --git a/roles/servers/apps/home-assistant/defaults/main.yml b/roles/servers/apps/home-assistant/defaults/main.yml index a95d7644..11c9c645 100644 --- a/roles/servers/apps/home-assistant/defaults/main.yml +++ b/roles/servers/apps/home-assistant/defaults/main.yml @@ -58,6 +58,7 @@ home_assistant: - name: dol_1 door: - name: garaz_brama + - name: dwor_brama zbmini: - name: sypialnia_gora power_plug: diff --git a/roles/servers/apps/home-assistant/templates/config/multiscrape.yaml b/roles/servers/apps/home-assistant/templates/config/multiscrape.yaml index 00c3d697..85bfdc93 100644 --- a/roles/servers/apps/home-assistant/templates/config/multiscrape.yaml +++ b/roles/servers/apps/home-assistant/templates/config/multiscrape.yaml @@ -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 }}" @@ -44,8 +44,8 @@ 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 @@ -53,3 +53,21 @@ 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 diff --git a/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml b/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml index 660a8e23..f2c7c3d2 100644 --- a/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml +++ b/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml @@ -271,8 +271,16 @@ views: - type: entities entities: - entity: switch.4chpror3_switch_dwor_brama + type: custom:multiple-entity-row name: Brama Dwor icon: mdi:gate + toggle: true + show_state: true + entities: + - entity: sensor.door_battery_percentage_dwor_brama + name: Bateria + - entity: binary_sensor.door_state_dwor_brama + name: Stan - entity: switch.4chpror3_switch_dwor_furtka name: Furtka icon: mdi:door @@ -443,35 +451,14 @@ views: - type: humidifier entity: humidifier.nawilzacz_powietrza - type: entities + title: Tesla Wall Connector entities: - - entity: siren.downstairs_siren - name: Siren - - entity: sensor.downstairs_volume - name: Volume - title: Ring Dzwonek Dol - - type: grid - square: false - columns: 1 - cards: - - type: entities - entities: - - entity: sensor.furtka_battery - name: Battery - - entity: binary_sensor.furtka_ding - name: Ding - - entity: sensor.furtka_last_activity - name: Last Activity - - entity: sensor.furtka_last_ding - name: Last Ding - - entity: sensor.furtka_last_motion - name: Last Motion - - entity: binary_sensor.furtka_motion - name: Motion - - entity: sensor.furtka_volume - name: Volume - title: Ring Furtka - - type: picture-entity - entity: camera.furtka + - entity: sensor.tesla_wall_connector_energy + name: Energy + - entity: sensor.tesla_wall_connector_session_energy + name: Session energy + - entity: sensor.tesla_wall_connector_status + name: Status - type: media-control entity: media_player.spotify_mikiq1w2 - theme: Backend-selected