Switched from toml to yaml for configuration
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
b12b76bd50
commit
dd4be4a2ee
|
@ -2,3 +2,7 @@ root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
38
Cargo.lock
generated
38
Cargo.lock
generated
|
@ -95,9 +95,9 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
|
"serde_yaml",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"wakey",
|
"wakey",
|
||||||
|
@ -1349,18 +1349,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.183"
|
version = "1.0.190"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c"
|
checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.183"
|
version = "1.0.190"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816"
|
checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -1440,6 +1440,19 @@ dependencies = [
|
||||||
"syn 2.0.28",
|
"syn 2.0.28",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_yaml"
|
||||||
|
version = "0.9.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap 2.0.0",
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"serde",
|
||||||
|
"unsafe-libyaml",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sharded-slab"
|
name = "sharded-slab"
|
||||||
version = "0.1.4"
|
version = "0.1.4"
|
||||||
|
@ -1691,15 +1704,6 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml"
|
|
||||||
version = "0.5.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tonic"
|
name = "tonic"
|
||||||
version = "0.9.2"
|
version = "0.9.2"
|
||||||
|
@ -1850,6 +1854,12 @@ dependencies = [
|
||||||
"tinyvec",
|
"tinyvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unsafe-libyaml"
|
||||||
|
version = "0.2.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "untrusted"
|
name = "untrusted"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
|
|
@ -14,7 +14,6 @@ impl_cast = { path = "./impl_cast", features = ["debug"] }
|
||||||
google-home = { path = "./google-home" }
|
google-home = { path = "./google-home" }
|
||||||
paste = "1.0.10"
|
paste = "1.0.10"
|
||||||
tokio = { version = "1", features = ["rt-multi-thread"] }
|
tokio = { version = "1", features = ["rt-multi-thread"] }
|
||||||
toml = "0.5.10"
|
|
||||||
dotenvy = "0.15.0"
|
dotenvy = "0.15.0"
|
||||||
reqwest = { version = "0.11.13", features = [
|
reqwest = { version = "0.11.13", features = [
|
||||||
"json",
|
"json",
|
||||||
|
@ -40,6 +39,7 @@ tracing-subscriber = "0.3.16"
|
||||||
serde_with = "3.2.0"
|
serde_with = "3.2.0"
|
||||||
enum_dispatch = "0.3.12"
|
enum_dispatch = "0.3.12"
|
||||||
indexmap = { version = "2.0.0", features = ["serde"] }
|
indexmap = { version = "2.0.0", features = ["serde"] }
|
||||||
|
serde_yaml = "0.9.27"
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
wakey = { git = "https://git.huizinga.dev/Dreaded_X/wakey" }
|
wakey = { git = "https://git.huizinga.dev/Dreaded_X/wakey" }
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
[openid]
|
|
||||||
base_url = "https://login.huizinga.dev/api/oidc"
|
|
||||||
|
|
||||||
[mqtt]
|
|
||||||
host = "olympus.vpn.huizinga.dev"
|
|
||||||
port = 8883
|
|
||||||
client_name = "automation-ares"
|
|
||||||
username = "mqtt"
|
|
||||||
password = "${MQTT_PASSWORD}"
|
|
||||||
tls = true
|
|
||||||
|
|
||||||
[ntfy]
|
|
||||||
topic = "${NTFY_TOPIC}"
|
|
||||||
|
|
||||||
[presence]
|
|
||||||
topic = "automation_dev/presence/+/#"
|
|
||||||
|
|
||||||
# Devices
|
|
||||||
[device.debug_bridge]
|
|
||||||
type = "DebugBridge"
|
|
||||||
topic = "automation_dev/debug"
|
|
||||||
|
|
||||||
[device.light_sensor]
|
|
||||||
type = "LightSensor"
|
|
||||||
topic = "zigbee2mqtt_dev/living/light"
|
|
||||||
min = 23_000
|
|
||||||
max = 25_000
|
|
||||||
|
|
||||||
[device.kitchen_kettle]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Kettle"
|
|
||||||
name = "Kettle"
|
|
||||||
room = "Kitchen"
|
|
||||||
topic = "zigbee2mqtt/kitchen/kettle"
|
|
||||||
timeout = 5
|
|
||||||
|
|
||||||
[device.workbench_charger]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Charger"
|
|
||||||
name = "Charger"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/charger"
|
|
||||||
timeout = 5
|
|
||||||
|
|
||||||
[device.workbench_outlet]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
name = "Outlet"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/outlet"
|
|
||||||
|
|
||||||
[device.living_zeus]
|
|
||||||
type = "WakeOnLAN"
|
|
||||||
name = "Zeus"
|
|
||||||
room = "Living Room"
|
|
||||||
topic = "automation/appliance/living_room/zeus"
|
|
||||||
mac_address = "30:9c:23:60:9c:13"
|
|
||||||
|
|
||||||
[device.hallway_frontdoor]
|
|
||||||
type = "ContactSensor"
|
|
||||||
topic = "zigbee2mqtt/hallway/frontdoor"
|
|
||||||
presence = { topic = "automation_dev/presence/contact/frontdoor", timeout = 10 }
|
|
66
config/ares.dev.yml
Normal file
66
config/ares.dev.yml
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
openid:
|
||||||
|
base_url: "https://login.huizinga.dev/api/oidc"
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
host: "olympus.vpn.huizinga.dev"
|
||||||
|
port: 8883
|
||||||
|
client_name: "automation-ares"
|
||||||
|
username: "mqtt"
|
||||||
|
password: "${MQTT_PASSWORD}"
|
||||||
|
tls: true
|
||||||
|
|
||||||
|
ntfy:
|
||||||
|
topic: "${NTFY_TOPIC}"
|
||||||
|
|
||||||
|
presence:
|
||||||
|
topic: "automation_dev/presence/+/#"
|
||||||
|
|
||||||
|
devices:
|
||||||
|
debug_bridge:
|
||||||
|
!DebugBridge
|
||||||
|
topic: "automation_dev/debug"
|
||||||
|
|
||||||
|
living_light_sensor:
|
||||||
|
!LightSensor
|
||||||
|
topic: "zigbee2mqtt_dev/living/light"
|
||||||
|
min: 23000
|
||||||
|
max: 25000
|
||||||
|
|
||||||
|
kitchen_kettle:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Kettle"
|
||||||
|
name: "Kettle"
|
||||||
|
room: "Kitchen"
|
||||||
|
topic: "zigbee2mqtt/kitchen/kettle"
|
||||||
|
timeout: 5
|
||||||
|
remotes:
|
||||||
|
- topic: "zigbee2mqtt/bedroom/remote"
|
||||||
|
- topic: "zigbee2mqtt/kitchen/remote"
|
||||||
|
|
||||||
|
workbench_charger:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Charger"
|
||||||
|
name: "Charger"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/charger"
|
||||||
|
timeout: 5
|
||||||
|
|
||||||
|
workbench_outlet:
|
||||||
|
!IkeaOutlet
|
||||||
|
name: "Outlet"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/outlet"
|
||||||
|
|
||||||
|
living_zeus:
|
||||||
|
!WakeOnLAN
|
||||||
|
name: "Zeus"
|
||||||
|
room: "Living Room"
|
||||||
|
topic: "automation/appliance/living_room/zeus"
|
||||||
|
mac_address: "30:9c:23:60:9c:13"
|
||||||
|
|
||||||
|
hallway_frontdoor:
|
||||||
|
!ContactSensor
|
||||||
|
topic: "zigbee2mqtt/hallway/frontdoor"
|
||||||
|
presence:
|
||||||
|
topic: "automation_dev/presence/contact/frontdoor"
|
||||||
|
timeout: 10
|
|
@ -1,5 +0,0 @@
|
||||||
[mqtt]
|
|
||||||
host="example.com"
|
|
||||||
port=1234
|
|
||||||
username="username"
|
|
||||||
password="password"
|
|
|
@ -1,119 +0,0 @@
|
||||||
[openid]
|
|
||||||
base_url = "https://login.huizinga.dev/api/oidc"
|
|
||||||
|
|
||||||
[mqtt]
|
|
||||||
host = "mosquitto"
|
|
||||||
port = 8883
|
|
||||||
client_name = "automation_rs"
|
|
||||||
username = "mqtt"
|
|
||||||
password = "${MQTT_PASSWORD}"
|
|
||||||
|
|
||||||
[ntfy]
|
|
||||||
topic = "${NTFY_TOPIC}"
|
|
||||||
|
|
||||||
[presence]
|
|
||||||
topic = "automation/presence/+/#"
|
|
||||||
|
|
||||||
# Devices
|
|
||||||
[device.debug_bridge]
|
|
||||||
type = "DebugBridge"
|
|
||||||
topic = "automation/debug"
|
|
||||||
|
|
||||||
[device.hue_bridge]
|
|
||||||
type = "HueBridge"
|
|
||||||
ip = "10.0.0.146"
|
|
||||||
login = "${HUE_TOKEN}"
|
|
||||||
flags = { presence = 41, darkness = 43 }
|
|
||||||
|
|
||||||
|
|
||||||
[device.living_light_sensor]
|
|
||||||
type = "LightSensor"
|
|
||||||
topic = "zigbee2mqtt/living/light"
|
|
||||||
min = 22_000
|
|
||||||
max = 23_500
|
|
||||||
|
|
||||||
[device.living_zeus]
|
|
||||||
type = "WakeOnLAN"
|
|
||||||
name = "Zeus"
|
|
||||||
room = "Living Room"
|
|
||||||
topic = "automation/appliance/living_room/zeus"
|
|
||||||
mac_address = "30:9c:23:60:9c:13"
|
|
||||||
broadcast_ip = "10.0.0.255"
|
|
||||||
|
|
||||||
[device.living_mixer]
|
|
||||||
type = "KasaOutlet"
|
|
||||||
ip = "10.0.0.49"
|
|
||||||
|
|
||||||
[device.living_speakers]
|
|
||||||
type = "KasaOutlet"
|
|
||||||
ip = "10.0.0.182"
|
|
||||||
|
|
||||||
[device.living_audio]
|
|
||||||
type = "AudioSetup"
|
|
||||||
topic = "zigbee2mqtt/living/remote"
|
|
||||||
mixer = "living_mixer"
|
|
||||||
speakers = "living_speakers"
|
|
||||||
|
|
||||||
|
|
||||||
[device.kitchen_kettle]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Kettle"
|
|
||||||
name = "Kettle"
|
|
||||||
room = "Kitchen"
|
|
||||||
topic = "zigbee2mqtt/kitchen/kettle"
|
|
||||||
timeout = 300
|
|
||||||
remotes = [
|
|
||||||
{ topic = "zigbee2mqtt/bedroom/remote" },
|
|
||||||
{ topic = "zigbee2mqtt/kitchen/remote" },
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
[device.bathroom_light]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Light"
|
|
||||||
name = "Light"
|
|
||||||
room = "Bathroom"
|
|
||||||
topic = "zigbee2mqtt/bathroom/light"
|
|
||||||
timeout = 2700
|
|
||||||
|
|
||||||
[device.bathroom_washer]
|
|
||||||
type = "Washer"
|
|
||||||
topic = "zigbee2mqtt/bathroom/washer"
|
|
||||||
threshold = 1
|
|
||||||
|
|
||||||
|
|
||||||
[device.workbench_charger]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Charger"
|
|
||||||
name = "Charger"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/charger"
|
|
||||||
timeout = 72000
|
|
||||||
|
|
||||||
[device.workbench_outlet]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
name = "Outlet"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/outlet"
|
|
||||||
|
|
||||||
|
|
||||||
[device.hallway_lights]
|
|
||||||
type = "HueGroup"
|
|
||||||
ip = "10.0.0.146"
|
|
||||||
login = "${HUE_TOKEN}"
|
|
||||||
group_id = 81
|
|
||||||
scene_id = "3qWKxGVadXFFG4o"
|
|
||||||
timer_id = 1
|
|
||||||
remotes = [{ topic = "zigbee2mqtt/hallway/remote" }]
|
|
||||||
|
|
||||||
[device.hallway_frontdoor]
|
|
||||||
type = "ContactSensor"
|
|
||||||
topic = "zigbee2mqtt/hallway/frontdoor"
|
|
||||||
presence = { topic = "automation/presence/contact/frontdoor", timeout = 900 }
|
|
||||||
trigger = { devices = ["hallway_lights"], timeout = 60 }
|
|
||||||
|
|
||||||
[device.bedroom_air_filter]
|
|
||||||
type = "AirFilter"
|
|
||||||
name = "Air Filter"
|
|
||||||
room = "Bedroom"
|
|
||||||
topic = "pico/filter/test"
|
|
124
config/config.yml
Normal file
124
config/config.yml
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
openid:
|
||||||
|
base_url: "https://login.huizinga.dev/api/oidc"
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
host: "mosquitto"
|
||||||
|
port: 8883
|
||||||
|
client_name: "automation_rs"
|
||||||
|
username: "mqtt"
|
||||||
|
password: "${MQTT_PASSWORD}"
|
||||||
|
|
||||||
|
ntfy:
|
||||||
|
topic: "${NTFY_TOPIC}"
|
||||||
|
|
||||||
|
presence:
|
||||||
|
topic: "automation/presence/+/#"
|
||||||
|
|
||||||
|
devices:
|
||||||
|
debug_bridge:
|
||||||
|
!DebugBridge
|
||||||
|
topic: "automation/debug"
|
||||||
|
|
||||||
|
hue_bridge:
|
||||||
|
!HueBridge
|
||||||
|
ip: &hue_ip "10.0.0.146"
|
||||||
|
login: &hue_token "${HUE_TOKEN}"
|
||||||
|
flags: { presence: 41, darkness: 43 }
|
||||||
|
|
||||||
|
|
||||||
|
living_light_sensor:
|
||||||
|
!LightSensor
|
||||||
|
topic: "zigbee2mqtt/living/light"
|
||||||
|
min: 22000
|
||||||
|
max: 23500
|
||||||
|
|
||||||
|
living_zeus:
|
||||||
|
!WakeOnLAN
|
||||||
|
name: "Zeus"
|
||||||
|
room: "Living Room"
|
||||||
|
topic: "automation/appliance/living_room/zeus"
|
||||||
|
mac_address: "30:9c:23:60:9c:13"
|
||||||
|
broadcast_ip: "10.0.0.255"
|
||||||
|
|
||||||
|
&mixer living_mixer:
|
||||||
|
!KasaOutlet
|
||||||
|
ip: "10.0.0.49"
|
||||||
|
|
||||||
|
&speakers living_speakers:
|
||||||
|
!KasaOutlet
|
||||||
|
ip: "10.0.0.182"
|
||||||
|
|
||||||
|
living_audio:
|
||||||
|
!AudioSetup
|
||||||
|
topic: "zigbee2mqtt/living/remote"
|
||||||
|
mixer: *mixer
|
||||||
|
speakers: *speakers
|
||||||
|
|
||||||
|
|
||||||
|
kitchen_kettle:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Kettle"
|
||||||
|
name: "Kettle"
|
||||||
|
room: "Kitchen"
|
||||||
|
topic: "zigbee2mqtt/kitchen/kettle"
|
||||||
|
timeout: 300
|
||||||
|
remotes:
|
||||||
|
- topic: "zigbee2mqtt/bedroom/remote"
|
||||||
|
- topic: "zigbee2mqtt/kitchen/remote"
|
||||||
|
|
||||||
|
|
||||||
|
bathroom_light:
|
||||||
|
!IkeaOutlet
|
||||||
|
type: "IkeaOutlet"
|
||||||
|
outlet_type: "Light"
|
||||||
|
name: "Light"
|
||||||
|
room: "Bathroom"
|
||||||
|
topic: "zigbee2mqtt/bathroom/light"
|
||||||
|
timeout: 2700
|
||||||
|
|
||||||
|
bathroom_washer:
|
||||||
|
!Washer
|
||||||
|
topic: "zigbee2mqtt/bathroom/washer"
|
||||||
|
threshold: 1
|
||||||
|
|
||||||
|
workbench_charger:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Charger"
|
||||||
|
name: "Charger"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/charger"
|
||||||
|
timeout: 72000
|
||||||
|
|
||||||
|
workbench_outlet:
|
||||||
|
!IkeaOutlet
|
||||||
|
name: "Outlet"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/outlet"
|
||||||
|
|
||||||
|
|
||||||
|
hallway_lights:
|
||||||
|
!HueGroup
|
||||||
|
ip: *hue_ip
|
||||||
|
login: *hue_token
|
||||||
|
group_id: 81
|
||||||
|
scene_id: "3qWKxGVadXFFG4o"
|
||||||
|
timer_id: 1
|
||||||
|
remotes:
|
||||||
|
- topic: "zigbee2mqtt/hallway/remote"
|
||||||
|
|
||||||
|
hallway_frontdoor:
|
||||||
|
!ContactSensor
|
||||||
|
topic: "zigbee2mqtt/hallway/frontdoor"
|
||||||
|
presence:
|
||||||
|
topic: "automation_dev/presence/contact/frontdoor"
|
||||||
|
timeout: 900
|
||||||
|
trigger:
|
||||||
|
devices: ["hallway_lights"]
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
|
||||||
|
bedroom_air_filter:
|
||||||
|
!AirFilter
|
||||||
|
name: "Air Filter"
|
||||||
|
room: "Bedroom"
|
||||||
|
topic: "pio/filter/test"
|
|
@ -1,120 +0,0 @@
|
||||||
[openid]
|
|
||||||
base_url = "https://login.huizinga.dev/api/oidc"
|
|
||||||
|
|
||||||
[mqtt]
|
|
||||||
host = "olympus.lan.huizinga.dev"
|
|
||||||
port = 8883
|
|
||||||
client_name = "automation-zeus"
|
|
||||||
username = "mqtt"
|
|
||||||
password = "${MQTT_PASSWORD}"
|
|
||||||
tls = true
|
|
||||||
|
|
||||||
[ntfy]
|
|
||||||
topic = "${NTFY_TOPIC}"
|
|
||||||
|
|
||||||
[presence]
|
|
||||||
topic = "automation_dev/presence/+/#"
|
|
||||||
|
|
||||||
# Devices
|
|
||||||
[device.debug_bridge]
|
|
||||||
type = "DebugBridge"
|
|
||||||
topic = "automation_dev/debug"
|
|
||||||
|
|
||||||
[device.hue_bridge]
|
|
||||||
type = "HueBridge"
|
|
||||||
ip = "10.0.0.146"
|
|
||||||
login = "${HUE_TOKEN}"
|
|
||||||
flags = { presence = 41, darkness = 43 }
|
|
||||||
|
|
||||||
|
|
||||||
[device.living_light_sensor]
|
|
||||||
type = "LightSensor"
|
|
||||||
topic = "zigbee2mqtt_dev/living/light"
|
|
||||||
min = 23_000
|
|
||||||
max = 25_000
|
|
||||||
# TODO: Implement this:
|
|
||||||
trigger = ["hue_bridge", "debug_bridge"]
|
|
||||||
|
|
||||||
[device.living_zeus]
|
|
||||||
type = "WakeOnLAN"
|
|
||||||
name = "Zeus"
|
|
||||||
room = "Living Room"
|
|
||||||
topic = "automation/appliance/living_room/zeus"
|
|
||||||
mac_address = "30:9c:23:60:9c:13"
|
|
||||||
|
|
||||||
[device.living_mixer]
|
|
||||||
type = "KasaOutlet"
|
|
||||||
ip = "10.0.0.49"
|
|
||||||
|
|
||||||
[device.living_speakers]
|
|
||||||
type = "KasaOutlet"
|
|
||||||
ip = "10.0.0.182"
|
|
||||||
|
|
||||||
[device.living_audio]
|
|
||||||
type = "AudioSetup"
|
|
||||||
topic = "zigbee2mqtt/living/remote"
|
|
||||||
mixer = "living_mixer"
|
|
||||||
speakers = "living_speakers"
|
|
||||||
|
|
||||||
|
|
||||||
[device.kitchen_kettle]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Kettle"
|
|
||||||
name = "Kettle"
|
|
||||||
room = "Kitchen"
|
|
||||||
topic = "zigbee2mqtt/kitchen/kettle"
|
|
||||||
timeout = 5
|
|
||||||
remotes = [
|
|
||||||
{ topic = "zigbee2mqtt/bedroom/remote" },
|
|
||||||
{ topic = "zigbee2mqtt/kitchen/remote" },
|
|
||||||
]
|
|
||||||
|
|
||||||
[device.bathroom_light]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Light"
|
|
||||||
name = "Bathroom light"
|
|
||||||
room = "Bathroom"
|
|
||||||
topic = "zigbee2mqtt/bathroom/light"
|
|
||||||
timeout = 60
|
|
||||||
|
|
||||||
[device.bathroom_washer]
|
|
||||||
type = "Washer"
|
|
||||||
topic = "zigbee2mqtt/bathroom/washer"
|
|
||||||
threshold = 1
|
|
||||||
|
|
||||||
|
|
||||||
[device.workbench_charger]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
outlet_type = "Charger"
|
|
||||||
name = "Charger"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/charger"
|
|
||||||
timeout = 5
|
|
||||||
|
|
||||||
[device.workbench_outlet]
|
|
||||||
type = "IkeaOutlet"
|
|
||||||
name = "Outlet"
|
|
||||||
room = "Workbench"
|
|
||||||
topic = "zigbee2mqtt/workbench/outlet"
|
|
||||||
|
|
||||||
|
|
||||||
[device.hallway_lights]
|
|
||||||
type = "HueGroup"
|
|
||||||
ip = "10.0.0.146"
|
|
||||||
login = "${HUE_TOKEN}"
|
|
||||||
group_id = 81
|
|
||||||
scene_id = "3qWKxGVadXFFG4o"
|
|
||||||
timer_id = 1
|
|
||||||
remotes = [{ topic = "zigbee2mqtt/hallway/remote" }]
|
|
||||||
|
|
||||||
[device.hallway_frontdoor]
|
|
||||||
type = "ContactSensor"
|
|
||||||
topic = "zigbee2mqtt/hallway/frontdoor"
|
|
||||||
presence = { topic = "automation_dev/presence/contact/frontdoor", timeout = 10 }
|
|
||||||
trigger = { devices = ["hallway_lights"], timeout = 10 }
|
|
||||||
|
|
||||||
[device.bedroom_air_filter]
|
|
||||||
type = "AirFilter"
|
|
||||||
name = "Air Filter"
|
|
||||||
room = "Bedroom"
|
|
||||||
topic = "pico/filter/test"
|
|
124
config/zeus.dev.yml
Normal file
124
config/zeus.dev.yml
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
openid:
|
||||||
|
base_url: "https://login.huizinga.dev/api/oidc"
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
host: "olympus.lan.huizinga.dev"
|
||||||
|
port: 8883
|
||||||
|
client_name: "automation-zeus"
|
||||||
|
username: "mqtt"
|
||||||
|
password: "${MQTT_PASSWORD}"
|
||||||
|
tls: true
|
||||||
|
|
||||||
|
ntfy:
|
||||||
|
topic: "${NTFY_TOPIC}"
|
||||||
|
|
||||||
|
presence:
|
||||||
|
topic: "automation_dev/presence/+/#"
|
||||||
|
|
||||||
|
devices:
|
||||||
|
debug_bridge:
|
||||||
|
!DebugBridge
|
||||||
|
topic: "automation_dev/debug"
|
||||||
|
|
||||||
|
hue_bridge:
|
||||||
|
!HueBridge
|
||||||
|
ip: &hue_ip "10.0.0.146"
|
||||||
|
login: &hue_token "${HUE_TOKEN}"
|
||||||
|
flags: { presence: 41, darkness: 43 }
|
||||||
|
|
||||||
|
|
||||||
|
living_light_sensor:
|
||||||
|
!LightSensor
|
||||||
|
topic: "zigbee2mqtt_dev/living/light"
|
||||||
|
min: 23000
|
||||||
|
max: 25000
|
||||||
|
|
||||||
|
living_zeus:
|
||||||
|
!WakeOnLAN
|
||||||
|
name: "Zeus"
|
||||||
|
room: "Living Room"
|
||||||
|
topic: "automation/appliance/living_room/zeus"
|
||||||
|
mac_address: "30:9c:23:60:9c:13"
|
||||||
|
|
||||||
|
&mixer living_mixer:
|
||||||
|
!KasaOutlet
|
||||||
|
ip: "10.0.0.49"
|
||||||
|
|
||||||
|
&speakers living_speakers:
|
||||||
|
!KasaOutlet
|
||||||
|
ip: "10.0.0.182"
|
||||||
|
|
||||||
|
living_audio:
|
||||||
|
!AudioSetup
|
||||||
|
topic: "zigbee2mqtt/living/remote"
|
||||||
|
mixer: *mixer
|
||||||
|
speakers: *speakers
|
||||||
|
|
||||||
|
|
||||||
|
kitchen_kettle:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Kettle"
|
||||||
|
name: "Kettle"
|
||||||
|
room: "Kitchen"
|
||||||
|
topic: "zigbee2mqtt/kitchen/kettle"
|
||||||
|
timeout: 5
|
||||||
|
remotes:
|
||||||
|
- topic: "zigbee2mqtt/bedroom/remote"
|
||||||
|
- topic: "zigbee2mqtt/kitchen/remote"
|
||||||
|
|
||||||
|
|
||||||
|
bathroom_light:
|
||||||
|
!IkeaOutlet
|
||||||
|
type: "IkeaOutlet"
|
||||||
|
outlet_type: "Light"
|
||||||
|
name: "Light"
|
||||||
|
room: "Bathroom"
|
||||||
|
topic: "zigbee2mqtt/bathroom/light"
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
bathroom_washer:
|
||||||
|
!Washer
|
||||||
|
topic: "zigbee2mqtt/bathroom/washer"
|
||||||
|
threshold: 1
|
||||||
|
|
||||||
|
workbench_charger:
|
||||||
|
!IkeaOutlet
|
||||||
|
outlet_type: "Charger"
|
||||||
|
name: "Charger"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/charger"
|
||||||
|
timeout: 5
|
||||||
|
|
||||||
|
workbench_outlet:
|
||||||
|
!IkeaOutlet
|
||||||
|
name: "Outlet"
|
||||||
|
room: "Workbench"
|
||||||
|
topic: "zigbee2mqtt/workbench/outlet"
|
||||||
|
|
||||||
|
|
||||||
|
hallway_lights:
|
||||||
|
!HueGroup
|
||||||
|
ip: *hue_ip
|
||||||
|
login: *hue_token
|
||||||
|
group_id: 81
|
||||||
|
scene_id: "3qWKxGVadXFFG4o"
|
||||||
|
timer_id: 1
|
||||||
|
remotes:
|
||||||
|
- topic: "zigbee2mqtt/hallway/remote"
|
||||||
|
|
||||||
|
hallway_frontdoor:
|
||||||
|
!ContactSensor
|
||||||
|
topic: "zigbee2mqtt/hallway/frontdoor"
|
||||||
|
presence:
|
||||||
|
topic: "automation_dev/presence/contact/frontdoor"
|
||||||
|
timeout: 10
|
||||||
|
trigger:
|
||||||
|
devices: ["hallway_lights"]
|
||||||
|
timeout: 10
|
||||||
|
|
||||||
|
|
||||||
|
bedroom_air_filter:
|
||||||
|
!AirFilter
|
||||||
|
name: "Air Filter"
|
||||||
|
room: "Bedroom"
|
||||||
|
topic: "pio/filter/test"
|
|
@ -26,7 +26,6 @@ pub struct Config {
|
||||||
pub fullfillment: FullfillmentConfig,
|
pub fullfillment: FullfillmentConfig,
|
||||||
pub ntfy: Option<NtfyConfig>,
|
pub ntfy: Option<NtfyConfig>,
|
||||||
pub presence: PresenceConfig,
|
pub presence: PresenceConfig,
|
||||||
#[serde(rename = "device")]
|
|
||||||
pub devices: IndexMap<String, DeviceConfigs>,
|
pub devices: IndexMap<String, DeviceConfigs>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +136,7 @@ impl Config {
|
||||||
|
|
||||||
missing.has_missing()?;
|
missing.has_missing()?;
|
||||||
|
|
||||||
let config: Config = toml::from_str(&file)?;
|
let config: Config = serde_yaml::from_str(&file)?;
|
||||||
|
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ pub trait DeviceConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
#[serde(tag = "type")]
|
|
||||||
#[enum_dispatch(DeviceConfig)]
|
#[enum_dispatch(DeviceConfig)]
|
||||||
pub enum DeviceConfigs {
|
pub enum DeviceConfigs {
|
||||||
AirFilter(AirFilterConfig),
|
AirFilter(AirFilterConfig),
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub enum ConfigParseError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
IoError(#[from] std::io::Error),
|
IoError(#[from] std::io::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
DeserializeError(#[from] toml::de::Error),
|
YamlError(#[from] serde_yaml::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Would be nice to somehow get the line number of the expected wildcard topic
|
// TODO: Would be nice to somehow get the line number of the expected wildcard topic
|
||||||
|
|
|
@ -50,7 +50,7 @@ async fn app() -> anyhow::Result<()> {
|
||||||
info!("Starting automation_rs...");
|
info!("Starting automation_rs...");
|
||||||
|
|
||||||
let config_filename =
|
let config_filename =
|
||||||
std::env::var("AUTOMATION_CONFIG").unwrap_or("./config/config.toml".into());
|
std::env::var("AUTOMATION_CONFIG").unwrap_or("./config/config.yml".into());
|
||||||
let config = Config::parse_file(&config_filename)?;
|
let config = Config::parse_file(&config_filename)?;
|
||||||
|
|
||||||
// Create a mqtt client
|
// Create a mqtt client
|
||||||
|
|
Loading…
Reference in New Issue
Block a user