Hello! Newbie here, I've likely mis-configured something and hopefully can be set on the right path
What I Have:
Philips Hue Lights - connected to Hue Hub which is connected to Hubitat
Philips Hue Switch - Connected to Hubitat
Philips Hue Sensor - Connected to Hubitat
Wifi Plug (Tasmota) connected to dumb lights - Connected to Hubitat
Alexa for voice control
Setup - When motion is detected, sensor turns on lights and plugs, waits a minute, then turns back off, unless the switch is turned on, which case the sensor will not act again until the lights are turned off by the switch.
Use - I've configured this to work fine by using a Rule Machine on the switch and sensor with 2 global variables, which update depending on what is happening.
Problem - This works perfectly except when the Hue App or Alexa is used to change the state of the lights. For example, if I turn off the lights by Alexa, my global variables aren't changed so the sensor won't resume working until I hit off on my switch again.
Global variables are
Basement_Kitchen_Dimmer (0-100) used for storing brightness (Not important here)
Basement_Kitchen_Sensor - True/False used to determine if sensor should change lights.
Switch - On Button:
IF (Variable Basment_Kitchen_Dimmer() = 0(F) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, CC101-Desk, BW119-Kitchen 4: 100 --> fade: 0
END-IF
IF (Variable Basment_Kitchen_Dimmer() = 25(T) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, CC101-Desk, BW119-Kitchen 4: 75 --> fade: 0
END-IF
IF (Variable Basment_Kitchen_Dimmer() = 50(F) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, CC101-Desk, BW119-Kitchen 4: 50 --> fade: 0
END-IF
IF (Variable Basment_Kitchen_Dimmer() = 75(F) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, CC101-Desk, BW119-Kitchen 4: 25 --> fade: 0
END-IF
Set Basement_Kitchen_Sensor to false
Add 25 to Basment_Kitchen_Dimmer
IF (Variable Basment_Kitchen_Dimmer() = 100(F) []) THEN
Set Basment_Kitchen_Dimmer to 0
END-IF
Switch - Off Button:
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, CC101-Desk, BW119-Kitchen 4: 0 --> fade: 0
Set Basment_Kitchen_Dimmer to 0
Set Basement_Kitchen_Sensor to true
Sensor:
IF (Variable Basement_Kitchen_Sensor() = true(F) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, BW119-Kitchen 4: 100 --> fade: 0
Set Basment_Kitchen_Dimmer to 100
Wait for event: --> elapsed time: 0:01:00
IF (Variable Basement_Kitchen_Sensor() = true(F) []) THEN
Dim: BW110-Kitchen 2, BW101-Kitchen 1, BW118-Kitchen 3, BW119-Kitchen 4: 0 --> fade: 15
Set Basment_Kitchen_Dimmer to 0
END-IF
END-IF
I'm probably overly complicating things, but any thoughts on how I could solve?
Thank you and sorry if this is just a TERRIBLE set up