Awake / Sleep mode flow

Hi community.

Over the last year I have worked with the Homey and the possibilities it offers, which is great. The community offers great solutions and ways to do automation. I work a lot with advanced flows and variables which offers great possibilities.

Now I have a challange :slight_smile:

There is a lot of good solutions on the forum for changing awake/Sleep mode. Sadly none works really well for me. Therefor I’m trying to explore the possibility of using iPhone logic to solve this.

So the use case isā€ When I put my phone in the charger that will trigger sleep atribute in homey pro to sleep, and when I remove my phone from the charger that will alter the tribute to awakeā€ So far so good!

I use the iPhones internal logic in Shortcut automation to do the first part, ā€œWhen I put my phone in the chargerā€ That is automation triggers a Homey Flow (second part) which in turn alters a boolean variable ā€œSleep_Xā€ to yes.

That triggers the third part, an advanced flow who take care of all the other stuff, like Am I home“, time of day etc.

And to be clear; the first part and the third part works flawless, the main problem is the second part, the first flow. I’m struggling to find a good ā€œwhenā€ that make sense at the start of the flow.

So my question or questions is:

  1. Is there a better way to trigger the Sleep_X variable from the iPhone?

  2. Does anyone have a qualified suggestion for a good ā€œwhenā€?

I charge my iPhone overnight on the nightstand (I use the iPhone for alarms). When I put the phone in the stand the bedroom light will be on.
So in my case the the trigger could be ā€˜this flow is started’.
The extra condition would be ā€˜the bedroom light is on’

Thank you :slight_smile: , I surly missed that one from flow variables. And I think that might solve the problem :slight_smile: