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: