I did get this working. Documenting what I have in case it helps anyone.
I'm using a routine in alexa to run entrymonvar program on ISY
Anytime the front door sees motion, alexa turns on the entrymonvar program
When motion is not seen for 10 minutes alexa turns off the entrymonvar program
The entrymonvar program
entrymonitorvar - [ID 0010][Parent 0001]
If
- No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
$motion = 1
Run Program 'axexamontionprog' (If)
Else
$motion = 0
Run Program 'motionmain' (If)
The axexamontionprog
axexamontionprog - [ID 0011][Parent 0001]
If
From Sunset
To Sunrise (next day)
And $motion is 1
Then
Run Program 'motionmain' (If)
Else
- No Actions - (To add one, press 'Action')
The motionmain program
motionmain - [ID 0013][Parent 0001]
If
$entry_var is 1
Or $motion is 1
Then
Set 'Front Entry' On
Else
Set 'Front Entry' Off
And finally the entryvar program
entryvar - [ID 0012][Parent 0001]
If
'breakkey_a' Status is Off #####(this was the one that was missing)########
Then
$entry_var = 0
Run Program 'motionmain' (If)
Else
$entry_var = 1
Run Program 'motionmain' (If)
This seems like overkill to use 4 programs and 2 variables but it does work.
The idea here was that the light would stay on if it was turned on by a scene. If motion turned it on, then only the switch was turned on, so I could use the status of another switch in the scene to see that it was motion that turned in on or the switch directly.