Blueprint or help with Alarm automation

Hi guys,

I have a very simple Yale smart alarm.
I am wondering if someone can help with some automation to get some good functionality out of it:

1a) Set the alarm to ‘Home’ when myself and my wife are home and its 11:30pm
1b) If one of us is home and the other is not, delay that for an hour, and try again at 12:30am.
1c) Disarm the alarm at 6am

2a) If both myself and my wife are ‘Away’ then set the alarm to ‘Away’
2b) When either one of us is home disarm the alarm.

I currently use Unifi wifi connections to see home and away status.
I created a user for both myself and my wife, and added our phones as person detector.

I have tried to get this working and so far all I have is to just set it at a time 11:30pm regardless.
Can anyone help me?