As a result this is how I solve occupancy using 2 programs. Let me know if a better way but so hard to find examples in this forum? I used now with On/Off commands and 30 second timer on the Motion Sensor II. I only want the lights to turn on if requested via a button press or Alexa so no motion on.
Kitchen Trigger - [ID 004E][Parent 004D]
If
'Downstairs / Kitchen / Kitchen Main.Ceiling Lights / Kitchen Main.D.Dining' is switched On
Or 'Downstairs / Kitchen / Kitchen Main.Ceiling Lights / Kitchen Main.C.Prep' is switched On
Or 'Downstairs / Kitchen / Kitchen.1 Motion' is switched On
Or 'Downstairs / Kitchen / Kitchen.1 Motion' is switched Off
Then
Stop program 'Kitchen Delay Autooff'
Run Program 'Kitchen Delay Autooff' (If)
Else
- No Actions - (To add one, press 'Action')
Kitchen Delay Autooff - [ID 004F][Parent 004D]
If
'Downstairs / Kitchen / Kitchen.1 Motion' Status is On
Then
Wait 30 minutes
Set 'Downstairs / Kitchen / Kitchen Prep' Off
Set 'Downstairs / Kitchen / Kitchen Dining' Off
Else
Wait 15 minutes
Set 'Downstairs / Kitchen / Kitchen Prep' Off
Set 'Downstairs / Kitchen / Kitchen Dining' Off