Compare commits

..

55 Commits

Author SHA1 Message Date
dbecd67471 modified: README.md
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 18s
modified:   deploy/README.md
renamed:    deploy/rbac.yaml -> deploy/cicd-rbac.yaml
2025-11-22 22:57:43 +00:00
2881eb1167 modified: deploy/deployment.yaml
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 16s
2025-11-22 18:51:39 +00:00
755d68a844 modified: deploy/deployment.yaml
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 18s
2025-11-22 18:36:03 +00:00
f40a899200 modified: .gitea/workflows/deploy.yaml
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 17s
2025-11-22 17:57:01 +00:00
d30aad3058 modified: .gitea/workflows/deploy.yaml
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 17s
2025-11-22 17:51:36 +00:00
6149826bc6 modified: .gitea/workflows/deploy.yaml
modified:   README.md
2025-11-22 17:50:45 +00:00
0d2b30a83a fix/cicd (#3)
Co-authored-by: Márcio Fernandes <marcio.fernandes@outlook.pt>
Reviewed-on: #3
2025-11-22 17:43:57 +00:00
001e785192 continuos deploy 2025-11-22 01:57:22 +00:00
726f3c5bb3 deleted: .gitea/workflows/deploy.yml 2025-11-16 11:59:50 +00:00
8a9c6760d5 fix: set dnsPolicy to ClusterFirstWithHostNet
Some checks failed
/ deploy-to-homesrv01 (push) Has been cancelled
2025-11-16 10:15:51 +00:00
0f51497688 modified: deploy/home-assistant-deploy.yaml
Some checks failed
/ deploy-to-homesrv01 (push) Has been cancelled
2025-11-15 21:15:31 +00:00
dee53f847e modified: deploy/home-assistant-deploy.yaml 2025-11-15 20:45:27 +00:00
59071cbcb5 deploy revision
Some checks failed
/ deploy-to-homesrv01 (push) Has been cancelled
2025-11-15 11:32:37 +00:00
b54f2c9c21 moved to casa kubernetes
Some checks failed
/ deploy-to-homesrv01 (push) Has been cancelled
2025-11-09 20:55:41 +00:00
00c462b908 modified: README.md
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 1m3s
2025-09-07 18:39:54 +00:00
45d75e84b8 modified: README.md
Some checks failed
/ deploy-to-homesrv01 (push) Failing after 5m42s
2025-05-25 19:13:12 +00:00
6a93a7342e modified: README.md
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 5m29s
2025-05-18 00:22:25 +01:00
40e6414e68 pipelines - cron weekly and changed act runner
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 5m49s
2025-05-04 14:13:20 +01:00
faf176cc8d modified: README.md
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 20s
2025-05-04 13:02:12 +01:00
49261d5e0f modified: README.md
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 36s
2025-04-05 23:07:00 +01:00
18f27615a3 modified: README.md
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 4m51s
2024-12-30 00:24:34 +00:00
dd9d1e32e3 modified: docker-compose.yaml
All checks were successful
/ deploy-to-homesrv01 (push) Successful in 7s
2024-12-30 00:11:04 +00:00
cd1469f7a0 new file: .gitea/workflows/deploy.yml 2024-12-30 00:08:05 +00:00
a88fecd697 modified: .gitignore 2024-12-29 21:50:06 +00:00
4afbea5ad4 modified: README.md 2024-12-29 21:22:24 +00:00
dbf8cffcb8 modified: README.md 2024-12-29 15:43:54 +00:00
bc6776d4da modified: docker-compose.yaml 2024-12-01 20:09:13 +00:00
95d93fd2c5 README.md 2024-08-31 11:14:34 +01:00
61d2fa83dd README.md 2024-08-31 03:17:33 +01:00
9ed47a4605 remove has config from repo 2024-08-31 03:01:05 +01:00
d76173697a devices documentation 2024-08-31 02:54:21 +01:00
ee9ed5f1f8 README.md 2024-08-30 22:24:10 +01:00
b5446a7304 README.md 2024-08-29 23:35:40 +01:00
2beee8f7f0 remove unused configuration panel_iframe 2024-08-29 00:32:53 +01:00
196f1ac84d README.md 2024-08-28 22:24:39 +01:00
8b4142e680 README.md 2024-08-27 12:11:53 +01:00
ae5d6fe785 README.md 2024-08-27 11:48:46 +01:00
2e4a05e0bb documentation 2024-08-25 11:13:04 +01:00
0facf469b5 modified: README.md 2024-08-24 23:15:32 +01:00
4f8417fcf7 documentation 2024-08-24 23:04:56 +01:00
4547c073fb Update README.md 2024-08-24 11:01:33 +00:00
b35fa7099f modified: README.md 2024-08-24 11:56:36 +01:00
c5ed855b98 modified: README.md
new file:   documentation/images/integrations-broadlink.png
2024-08-24 11:51:18 +01:00
967e9957b2 Changes to be committed:
modified:   .gitignore
	modified:   volumes/config/.gitignore
	modified:   volumes/config/scripts.yaml
2024-08-24 10:43:04 +01:00
8fcd987489 Update docker-compose.yaml 2024-08-24 00:31:36 +00:00
192d4ac117 add host documentation 2024-05-31 16:14:30 +01:00
3f1523ed7c ww refresh 2024-05-30 12:21:17 +01:00
5a540c1935 www reset 2024-05-30 12:19:43 +01:00
9ff091b219 temp commit 2024-05-30 12:18:47 +01:00
a2c3fabfe9 added config folder to git 2024-05-30 12:13:40 +01:00
a3cbc3df63 feat reverse proxy and selly integration 2024-05-25 10:47:34 +01:00
10b5e7d4a1 fix 2023-06-19 14:58:38 +01:00
b212f58e48 Merge pull request 'marcio.fernandes-patch-1' (#2) from marcio.fernandes-patch-1 into master
Reviewed-on: #2
2023-03-04 21:27:53 +00:00
06c2795032 Delete 'docker/dockerfile' 2023-03-04 21:25:23 +00:00
c097b7ed63 currently on production 2023-03-04 21:24:24 +00:00
16 changed files with 508 additions and 42 deletions

View File

@@ -0,0 +1,48 @@
name: Casa Home Assistant CI/CD Pipeline
on:
push:
branches:
- fix/*
- main
- master
pull_request:
schedule:
- cron: '0 16 * * 0' # every sunday 4 pm
jobs:
deploy:
runs-on: casa-vlan-cicd
env:
GITHUB_TEMP: ${{ runner.temp }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch limbo public actions
env:
RUNNER_TEMP: "${{ runner.temp }}"
WORKSPACE: "${{ gitea.workspace }}"
run: |
curl -fsSL https://git.limbosolutions.com/kb/gitea/raw/branch/main/cloud-scripts/setup-limbo-actions.sh | bash 2>&1
- name: Setup kubectl
uses: ./.gitea/limbo_actions/kubectl-setup
with:
kube_server: ${{ secrets.CASA_VLAN_KUBE_SERVER }}
kube_ca_base64: ${{ secrets.CASA_VLAN_KUBE_CA_BASE64 }}
kube_token: ${{ secrets.CASA_VLAN_KUBE_TOKEN }}
- name: Deploy Home Assistant
shell: bash
env:
ENDPOINT_IP: "${{ secrets.CASA_HOMEASSISTANT_ENDPOINT_IP }}"
SERVICE_PORT: "${{ secrets.CASA_HOMEASSISTANT_ENDPOINT_SERVICE_PORT }}"
INGRESS_ROUTES_MATCH: "${{ secrets.CASA_HOMEASSISTANT_INGRESS_ROUTES_MATCH }}"
INGRESS_TLS_SECRET_NAME: "${{ secrets.CASA_HOMEASSISTANT_INGRESS_TLS_SECRET_NAME }}"
run: |
kubectl apply -f ./deploy/deployment.yaml \
&& envsubst < ./deploy/service.template.yaml | kubectl apply -f -

5
.gitignore vendored
View File

@@ -1,5 +1,4 @@
**.env
_volumes
_volumes
.vscode
.volumes
.devcontainer
.tmp/**

257
README.md
View File

@@ -0,0 +1,257 @@
# Home Assistant
Welcome to my Home Assistant setup repository.
This repository documents and maintains the Home Assistant instance running in my home, hosted on casa server k3s cluster.
Related containers, such as MQTT and speech recognition, are hosted on same cluster.
**Table of Contents:**
- [Devices](#devices)
- [Broadlink - RM4 Pro](#broadlink---rm4-pro)
- [ZigBee - Smart Plugs](#zigbee---smart-plugs)
- [Shelly - Smart Plugs](#shelly---smart-plugs)
- [Integrations](#integrations)
- [MQTT](#mqtt)
- [zigbee2mqtt](#zigbee2mqtt)
- [Broadlink](#broadlink)
- [Wyoming Protocol](#wyoming-protocol)
- [HACS](#hacs)
- [Google Cast](#google-cast)
- [LG webOS Smart TV](#lg-webos-smart-tv)
- [Mobile App](#mobile-app)
- [Meteorologisk institutt (Met.no)](#meteorologisk-institutt-metno)
- [Pi-hole](#pi-hole)
- [Proxmox VE](#proxmox-ve)
- [Shelly](#shelly)
- [Speedtest.net](#speedtestnet)
- [Squeezebox (Lyrion Music Server)](#squeezebox-lyrion-music-server)
- [Sun](#sun)
- [Time \& Date](#time--date)
- [Xbox](#xbox)
- [Setup](#setup)
## Devices
### Broadlink - RM4 Pro
Using as Ir blaster for living room devices and temperature meter.
![ZigBee Smart Plugs](./docs/images/broadlink-universal-remote-irwifi-rm4-mini.jpg)
**Integrations:**
- [broadlink](#broadlink)
### ZigBee - Smart Plugs
Currently controlling:
- bed room lights
- dining table lights
- office room lights
![ZigBee Smart Plugs](./docs/images/51ojy7qoMmL._SL1500_.jpg)
**Integrations:**
- [zigbee2mqtt](#zigbee2mqtt)
- [mqtt](#mqtt)
### Shelly - Smart Plugs
- brutusplug
- shellyplug-s-80646f83bcf2.dev.lan
- brutus.dev.lan (proxmox server)
- gaiaplug
- shellyplug-s-80646F80FB14.dev.lan
- gaia.dev.lan (proxmox server)
![Shelly - Smart Plug](./docs/images/shellysmartplug.png)
Devices connected to IOT lan.
**Integrations:**
- [shelly](#shelly)
## Integrations
### MQTT
MQTT (Message Queuing Telemetry Transport) is a lightweight, publish/subscribe messaging protocol designed for machine-to-machine (M2M) communication and the Internet of Things (IoT). It operates on top of TCP/IP, making it ideal for resource-constrained devices.
**Setup:**
The Mosquitto MQTT broker is configured as the central messaging hub. For setup details, refer to the [Mosquitto setup repository](https://git.limbosolutions.com/marcio.fernandes/mosquitto).
**Requirements:**
Ensure port `1883` is accessible from Home Assistant to the Mosquitto server (`mqtt.lan`).
**Links:**
- [Home Assistant MQTT Integration Documentation](https://www.home-assistant.io/integrations/mqtt)
### zigbee2mqtt
Configured as a docker container on [homesrv01](/marcio.fernandes/homesrv01.dev.lan#zigbee2mqtt).
Using SONOFF Universal Zigbee 3.0 USB Dongle Plus.
### Broadlink
The [broadlink integration](https://www.home-assistant.io/integrations/broadlink) allows you to control and monitor Broadlink universal remotes, smart plugs, power strips, switches and sensors.
![broadlink integration](./docs/images/integrations-broadlink.png).
Devices:
- RM4 mini (IR Blaster)
Requires port 80 access from home assistant to Broadlink devices.
### Wyoming Protocol
A peer-to-peer protocol for voice assistants (basically JSONL + PCM audio)
```json
{ "type": "...", "data": { ... }, "data_length": ..., "payload_length": ... }
<data_length bytes (optional)>
<payload_length bytes (optional)>
```
Used in Rhasspy and Home Assistant for communication with voice services.
This is an open standard of the Open Home Foundation.
Docker containers currently hosted at [homesrv01.dev.lan](https://git.limbosolutions.com/marcio.fernandes/homesrv01.dev.lan#wyoming).
**Links:**
- <https://github.com/home-assistant/addons/blob/master/whisper/DOCS.md>
- <https://github.com/rhasspy/wyoming-faster-whisper>
### HACS
**Links:**
- [Official git repo](https://github.com/hacs/integration)
### Google Cast
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/cast)
- [Official git repo](https://github.com/home-assistant/core/tree/dev/homeassistant/components/cast)
### LG webOS Smart TV
The webostv platform allows you to control a LG webOS Smart TV.
There is currently support for the following device types within Home Assistant:
- Media player
- Notifications
To begin with enable LG Connect Apps feature in Network settings of the TV.
### Mobile App
The Mobile App integration allows Home Assistant mobile apps to easily integrate with Home Assistant.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/mobile_app)
### Meteorologisk institutt (Met.no)
The met platform uses the Met.no web service as a source for meteorological data for your location. The weather forecast is delivered by the Norwegian Meteorological Institute and the NRK.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/met)
### Pi-hole
The Pi-hole integration allows you to retrieve statistics and interact with a Pi-hole system.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/pi_hole)
### Proxmox VE
Proxmox VE Custom Integration Home Assistant
**Links:**
- [Official integration repo](https://github.com/dougiteixeira/proxmoxve)
### Shelly
Integrate Shelly devices into Home Assistant.
[Devices](#shelly---smart-plugs) connected to IOT lan.
**Firewall rules:**
- allow TCP:80(HTTP) from server homesrv to vlan IOT
- allow TCP:5683(CoIoT) from vlan IOT to server homesrv
- allow TCP:80(HTTP) from vlan IOT to server homesrv
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/shelly)
### Speedtest.net
The Speedtest.net integration uses the Speedtest.net web service to measure network bandwidth performance.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/speedtestdotnet)
### Squeezebox (Lyrion Music Server)
The Squeezebox integration allows you to control music players from the Lyrion Music Server (LMS) ecosystem. Lyrion Music Server was previously known as Logitech Media Server.
The Squeezebox music player ecosystem, which can be controlled through this integration, includes hardware audio players from Logitech, including Squeezebox 3rd Generation, Squeezebox Boom, Squeezebox Receiver, Transporter, Squeezebox2, Squeezebox and SLIMP3, and many software emulators like Squeezelite, SqueezeSlave, SoftSqueeze and SqueezePlay.
[Check git repo](/marcio.fernandes/lms) for more information how to setup Lyrion Music Server docker container.
RaspberryPI client:
- <https://git.limbosolutions.com/marcio.fernandes/pi.bluetooth.speaker>
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/squeezebox)
### Sun
The sun integration will use the location as configured in your Home Assistant configuration to track if the sun is above or below the horizon. The sun can be used within automation's as a trigger with an optional offset to simulate dawn/dusk or as a condition with an optional offset to test if the sun has already set or risen.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/sun)
### Time & Date
The time and date (time_date) integration allows one to create sensors for the current date or time in different formats. All values are based on the timezone which is set in “General Configuration”.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/time_date)
### Xbox
The Xbox integration allows you to control Xbox One (or newer) consoles from Home Assistant.
Home Assistant authenticates with Xbox Live through OAuth2 using the Home Assistant Cloud account linking service.
**Links:**
- [Home Assistant - Official integration documentation](https://www.home-assistant.io/integrations/xbox)
## Setup
[Deploy documentation](./deploy/README.md).

51
deploy/README.md Normal file
View File

@@ -0,0 +1,51 @@
# Home Assistant Deploy
## Namespace
```bash { cwd=../ terminalRows=15 }
# from repo root folder
kubectl create namespace home-assistant
```
## Deployment
### Environments requirements
``` bash
#./deploy/.env
export ENDPOINT_IP="xxx.xxx.xxx.xxxx"
export SERVICE_PORT=xxxx
export INGRESS_ROUTES_MATCH="Host(`xxxx`)"
export INGRESS_TLS_SECRET_NAME=xxxxxx
```
## Test Templates
```bash { cwd=../ terminalRows=15 }
# from repo root folder
source ./deploy/.env \
&& cat ./deploy/deployment.yaml \
&& envsubst < ./deploy/service.template.yaml
```
## Deploy
```bash { cwd=../ terminalRows=15 }
# from repo root folder
source ./deploy/.env \
&& kubectl apply -f ./deploy/deployment.yaml \
&& envsubst < ./deploy/service.template.yaml | kubectl apply -f -
```
## Continuos Deploy
All Environment variables requirements as set as secrets.
[gitea workflow](../.gitea/workflows/deploy.yaml)
## cicd RBAC
```bash { cwd=../ }
kubectl apply -f ./deploy/cicd-rbac.yaml
```

34
deploy/cicd-rbac.yaml Normal file
View File

@@ -0,0 +1,34 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: home-assistant
name: ci-cd
rules:
- apiGroups: [""]
resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims", "endpoints"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
- apiGroups: ["traefik.io"]
resources: ["ingressroutes"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ci-cd
namespace: home-assistant
subjects:
- kind: ServiceAccount
name: casa-ci-cd
namespace: home-assistant
roleRef:
kind: Role
name: ci-cd
apiGroup: rbac.authorization.k8s.io

61
deploy/deployment.yaml Normal file
View File

@@ -0,0 +1,61 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: home-assistant-config
namespace: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: local-path
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: home-assistant
namespace: home-assistant
labels:
app: home-assistant
spec:
replicas: 1
selector:
matchLabels:
app: home-assistant
template:
metadata:
labels:
app: home-assistant
spec:
dnsPolicy: ClusterFirstWithHostNet # ensures pod uses cluster DNS (CoreDNS) for service discovery even with host networking
hostNetwork: true
nodeName: casa # force deploy to master node cluster
tolerations:
- key: "node-role.kubernetes.io/control-plane" # allow installation on control-plane
operator: "Exists"
effect: "NoSchedule"
containers:
- name: home-assistant
image: "homeassistant/home-assistant"
imagePullPolicy: Always
env:
- name: TZ
value: Europe/Lisbon # set timezone
volumeMounts:
- name: home-assistant-config
mountPath: /config
resources:
requests:
memory: "256Mi"
cpu: "400m"
limits:
memory: "724Mi"
cpu: "1000m"
volumes:
- name: home-assistant-config
persistentVolumeClaim:
claimName: home-assistant-config

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: casa-ci-cd
annotations:
kubernetes.io/service-account.name: casa-ci-cd
type: kubernetes.io/service-account-token

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: casa-ci-cd
namespace: home-assistant

View File

@@ -0,0 +1,42 @@
apiVersion: v1
kind: Service
metadata:
name: home-assistant
namespace: home-assistant
spec:
clusterIP: None
ports:
- port: ${SERVICE_PORT}
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: home-assistant
namespace: home-assistant
subsets:
- addresses:
- ip: ${ENDPOINT_IP}
ports:
- port: ${SERVICE_PORT}
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: home-assistant
namespace: home-assistant
spec:
entryPoints:
- websecure
routes:
- match: ${INGRESS_ROUTES_MATCH}
kind: Rule
services:
- name: home-assistant
port: ${SERVICE_PORT}
tls:
secretName: ${INGRESS_TLS_SECRET_NAME}

View File

@@ -1,33 +0,0 @@
version: '3'
services:
homeassistant:
container_name: homeassistant
build: .
#image: "ghcr.io/home-assistant/raspberrypi4-homeassistant:stable"
volumes:
- config_data:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
ports:
- '10000:80'
networks:
network:
ipv4_address: 192.168.1.252
# network_mode: host
# networks:
# lms_bridge:
# pihole_bridge:
volumes:
config_data:
name: homeassistant_config
driver: local
driver_opts:
type: nfs
o: addr=192.168.1.251,rw
device: ":/export/docker-volumes/home_assistant/config"
networks:
network:
external: true
name: macvlan_pub_net

View File

@@ -1,6 +0,0 @@
FROM ghcr.io/home-assistant/raspberrypi4-homeassistant:stable
RUN apk update&& \
apk add --update --no-cache sudo bash
EXPOSE 22

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB