# Way to check how a device/flow was triggered?

**URL:** <https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729>\
**Category:** Flows\
**Created:** [August 1, 2024, 7:30am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729 "2024-08-01T07:30:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 1, 2024, 7:30am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/1 "2024-08-01T07:30:03Z")

</div>

Is there a way to check what triggered something? Was it triggered by a flow? By a device action? Directly from the app? Something like this could be useful 🙂

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [August 1, 2024, 10:10am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/2 "2024-08-01T10:10:56Z")

</div>

Something like this?

 ![Screenshot_20240801_120822_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/5/c5f24eb89a0ff5ca8d4daa2e3be3078721fef4a1.jpeg)

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [August 1, 2024, 10:55am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/3 "2024-08-01T10:55:32Z")

</div>

> [@Tiwas](#):
>
> Is there a way to check what triggered something?

Hi @Tiwas ,  
The best idea to start wit is the one of @Morgan .  
If that is not sufficient you can use your flows to add some debug information. The easiest ist to create a variable where you write in the triggered event. Unfortunately it is less trackable, so you might send some notes via push-notifications, WhatsApp, Signal, Signal or e-mail.  
And you might find some other ways to log the state, but I have no experience with them.  
Hope that helps 😃

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 1, 2024, 11:14am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/4 "2024-08-01T11:14:42Z")

</div>

@Morgan Can I access this from a flow?

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [August 1, 2024, 11:23am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/5 "2024-08-01T11:23:30Z")

</div>

It is already built in the mobile app and the web app.

Another logging I like to use is to append notes in a google sheet. You need to use flowcards for this and the homey app Sheets.

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 1, 2024, 12:09pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/6 "2024-08-01T12:09:00Z")

</div>

No, I need to check it in the flow. Like “if this was initiated by a flow, do this. If this was initiated by physical key, do this”

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 1, 2024, 1:37pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/7 "2024-08-01T13:37:07Z")

</div>

[Device Capabilities](https://community.homey.app/t/43287) app!

> ![Screenshot_20240801-153544_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/d/ad684cb3e21d3b6b051ce6a946fabc5d63e97267.jpeg)

> ![Screenshot_20240801-153528_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/1/81c7240f12fa55c68a90820e57c772fd7a70013c.jpeg)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 1, 2024, 3:40pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/8 "2024-08-01T15:40:39Z")

</div>

Thanks! Will look into that. At least, detecting if it was a device firing the flow will help 🙂

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 1, 2024, 3:49pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/9 "2024-08-01T15:49:12Z")

</div>

> [@Tiwas](#):
>
> At least, detecting if it was a device firing the flow will help 🙂

True, but it reports the user and used client as well, like web app, mobile app, dashboard Y

You wrote

> [@Tiwas](#):
>
> Was it triggered by a flow?

I don’t understand the difference:  
Someone or some device always starts a flow? It doesn’t decide to run by itself.  
Can you elaborate on this, please?  
Maybe you mean the “trigger every Thursday” flows?

Also, do take a look at the [Audit app](https://community.homey.app/t/app-pro-audit/101554). Great logging tool.

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 1, 2024, 7:04pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/10 "2024-08-01T19:04:45Z")

</div>

> [@Peter\_Kawa](#):
>
> > [@Tiwas](#):
> >
> > Was it triggered by a flow?
> 
> I don’t understand the difference:  
> Someone or some device always starts a flow? It doesn’t decide to run by itself.  
> Can you elaborate on this, please?  
> Maybe you mean the “trigger every Thursday” flows?

I’ll try 🙂 Ok, so the lights in my bathroom can be triggered both by the physical switch or by my housekeeper unlocking the front door. If they turn on for some reason while the housekeeper is _not_ in the house, it should check if the zone and adjacent zones have been inactive for more than a couple of minutes. If so, they should turn off - but they should obviously not force anyone to clean my bathroom in the dark.

That’s _one_ use-case.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 1, 2024, 9:29pm UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/11 "2024-08-01T21:29:04Z")

</div>

This is beyond who/what started a flow.  
I think you should use variables in this case, to mark the housekeeper in or out.  
When the variable changes to True, you know the housekeeper turned the bathroom lights on, not the switch.

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [August 2, 2024, 3:13am UTC](https://community.homey.app/t/way-to-check-how-a-device-flow-was-triggered/113729/12 "2024-08-02T03:13:47Z")

</div>

Yeah, it’s beyond, but meant as an example. I think, however, I’ve found a good solution to the original problem - I can create virtual devices. For my bathroom light, for instance, I can have the device itself (which has a direct association from the motion sensor), a virtual device for flows and a virtual device for any other use-case. That way I can just check which one was triggered.

Probably wouldn’t have thought of that without this sparring, så thanks 😃
