AF: Determine source (device) of trigger

Hi all.

I’ve been trying to read up for a number of hours now to see if I could find an answer to my “problem”.

Let’s say I have 3 lights.
For each of those lights I put a trigger “If turned on” on the canvas and route them all to the same card that for instance logs “Light (devicename) turned on”.

I would make sense to me to have a “Trigger source” tag or another way to be able to determine “(devicename)” in an “And” or “Then” card.

It doesn’t seem however that such a tag is available.
I can imagine that it migh be possible to use some (inline) Homeyscript to make such a determination, but haven’t found any pointers in the right direction for that either.

Is this simply not possible and do I need to look for a different solution (such as having a device specific “Then” card for each device which starts a flow with a tag and then specify the name of the device as a tag manually). Or can anybody recommend a smarter solution?

On a similar note, but I may be wrong here, I noticed that if I have multiple triggers with a tag with the same name (e.g. “Button”) and route them to the same “Then” card, I cannot simply select a “Button” tag that automatically resolves to the “Button” tag of the actual trigger, but instead there are multiple tags with that same name, one specifically for each card that was routed to that “Then” card and if you select one of those it (naturally) only resolves when that particular corresponding card was triggered and remains empty for the other cards.

Advice on how to deal with this is very welcome as well. Advanced Flows have a lot of potential, but seem to still require some work arounds for simple matters as the above.

It feels to me like it is not such a weird thing to ask and not a hard thing to implement, so I’m quite surprised to not be able to find a simple way to do this.

I’m curious whether the community can help me with this.

Kind regards,

Joost.

The Device Capabilities App has a flowcard for this: Retrieve Insights for 0 minutes ago. It gives the source tags and info.

1 Like

Thanks. I’ll give this a try.

You might need multiple flows if they are turned in/off by flow, so you can distinguish bwtween flow(names).

I think I may have been misunderstood, maybe I explained it wrong.
I’m not looking for the source (user/app) that triggered the trigger, I’m looking for information corresponding with “which” trigger started execution on an Advanced Flow canvas.

I will paste a picture to illustrate what I’m after:

The above flow will result in a push notification with the source light (which is in tag “Tekst1”).

This does what I want, but it still requires me to add 7 cards, whereas it could be so much easier if only something along the lines of this would be supported with a tag having information of the trigger that started this flow.

[Not an actual flow:]

Each time an Advanced Flow is executed a different trigger could be responsible for triggering that flow, but it is always a particular one. I would like to be able to get some information on that particular trigger at runtime. E.g. the type of the trigger card, the device it is associated with.

For this particular example usecase there may be different solutions available (e.g. through an Advanced Virtual Device, still want to look into the functionality and possibilities of that), but the above example is mainly to illustrate what I would be looking for: information regarding what actually started the Advanced Flow through associated tags.

Ill take a look later, but the issue is that you cannot use different starting tags, but, you can use the Watch flowcard from Device Capability. I believe it gives the device name back, so you can just have 7 triggers and then one notification, just like your image.

After reading that a second time before understanding what you meant, I’ve tried this out:

Unfortunately, that card does not (yet) return the device name or selected capability as a tag.
It does give back the client or user that triggered the capability state change.
In my case I used the Philips Hue app to switch that light on and off and it reported as such.

If you see the possibility to add tags for the selected device name and selected device capability to that watch card then indeed this would resolve my issue.

Well, that would solve the issue just yet: You cannot use different starting cards and then use those tags.
So, we need one watch card in which you can select multiple devices at once. So there is only one trigger card but with the details in the tags.

I just got an idea. How about a ‘clone’ of this card:
Screenshot from 2022-11-09 00-57-37

Device became active / inactive cards, as in Light turned on / turned off?

You mean one card that fires for each devices that has a capabilities change?
I think that will overload Homey.
You need to be able to select which devices you want a flow to be triggered by, so it’s more like the Watch card with free-text-fields, but with the ability to enter multiple devices, like the FindObjectInFlows card.

Yeah I get that. You think it can be usable when you narrow it down to the onoff capability of the class (virtual)light?

Yes, Arie, you are correct. Since each triggering card would result in a seperate tag, the only way to circumvent that would be to have a single watch card for which you could select multiple devices at once.

I also agree with you that this should be limited to specifically selected devices to prevent accidental overloading of Homey.

1 Like