Added hue wall switches
All checks were successful
Build and deploy / Build application (push) Successful in 4m9s
Build and deploy / Build container (push) Successful in 53s
Build and deploy / Deploy container (push) Successful in 32s

This commit is contained in:
2024-11-30 22:16:49 +01:00
parent 5185b0d3ba
commit 6b8d0b7d56
7 changed files with 166 additions and 16 deletions

View File

@@ -173,8 +173,8 @@ automation.device_manager:add(IkeaOutlet.new({
client = mqtt_client,
}))
local hallway_lights = HueGroup.new({
identifier = "hallway_lights",
local hallway_bottom_lights = HueGroup.new({
identifier = "hallway_bottom_lights",
ip = hue_ip,
login = hue_token,
group_id = 81,
@@ -182,14 +182,41 @@ local hallway_lights = HueGroup.new({
timer_id = 1,
client = mqtt_client,
})
automation.device_manager:add(hallway_lights)
automation.device_manager:add(hallway_bottom_lights)
automation.device_manager:add(IkeaRemote.new({
name = "Remote",
room = "Hallway",
client = mqtt_client,
topic = mqtt_z2m("hallway/remote"),
callback = function(on)
hallway_lights:set_on(on)
hallway_bottom_lights:set_on(on)
end,
}))
local hallway_top_light = HueGroup.new({
identifier = "hallway_top_light",
ip = hue_ip,
login = hue_token,
group_id = 83,
scene_id = "QeufkFDICEHWeKJ7",
client = mqtt_client,
})
automation.device_manager:add(HueSwitch.new({
name = "SwitchBottom",
room = "Hallway",
client = mqtt_client,
topic = mqtt_z2m("hallway/switchbottom"),
left_callback = function()
hallway_top_light:set_on(not hallway_top_light:is_on())
end,
}))
automation.device_manager:add(HueSwitch.new({
name = "SwitchTop",
room = "Hallway",
client = mqtt_client,
topic = mqtt_z2m("hallway/switchtop"),
left_callback = function()
hallway_top_light:set_on(not hallway_top_light:is_on())
end,
}))
@@ -202,7 +229,7 @@ automation.device_manager:add(ContactSensor.new({
timeout = debug and 10 or 15 * 60,
},
trigger = {
devices = { hallway_lights },
devices = { hallway_bottom_lights },
timeout = debug and 10 or 2 * 60,
},
}))
@@ -212,7 +239,7 @@ automation.device_manager:add(ContactSensor.new({
topic = mqtt_z2m("hallway/trash"),
client = mqtt_client,
trigger = {
devices = { hallway_lights },
devices = { hallway_bottom_lights },
},
}))