Is there a card that can randomly trigger one THEN card

Hi,

Is there a way to randomly select one from multiple THEN cards?

So is not always saying the same thing.

Thanks!

There is a LOGIC AND card ā€œContinue with a change of x percentā€.

You could try to use the app custom logic

Custom logic

This can generate a random number. After that you check the number and start one of the voice actions. (To be clear, you have to make 3 different checks of the numbers who you have to connect to the different voice output cards)

What @Justin_de_Knegt suggests can also be done in a similar way using the Flow Gadget app.

Example:

I wanted to do something similar a couple months ago. Just for fun I wanted to send my lovely wife a message every day. I spent time researching with Gemini to come up with a solution which landed on using the Better Logic Library to pick a message from a list defined as a variable. Gemini gave me the code. I’m an old fart and not smart enough anymore to explain the code. But look at BLL where you can set your different variables up as a string in the BLL variable and then select it randomly. In the snapshot below, the message has like 150 different dumb messages to brighten her day which I go through with an index and a list of emojis that I select randomly. The flow was very simple once Gemini figured it out. Just a couple flow cards. Again, the list of messages and emojis are defined as part of the BLL variable. They are not an external list. Hope this gives you an idea to simplify your flow.

Actually, here’s one that I did which is more of what you are trying to do. Here our back door slider closes, motion is detected and the Alexa device in the kitchen spits out some wise ass message.

@Rmb Hi, I gave it a try and in the 1st time it trigger one random.

But then the second time it did not. So it seems the chance values 25% dont equal 100% so it could not trigger always. on another test 2 of them trigger.

@Justin_de_Knegt thanks, would check it out between that one and the one
@DirkG suggested to see which one seem easier.

Dirk thanks for the flow that definitely helps a lot.

@Ron_Smith wow that seems super interesting.
but all that code im not sure if I could figure it out.
I have not yet used any of the AI to do code.
A quick test I was not able to figure it out.
Thanks!

Try this:

(Typo in last card: should be option 4 of course)

Does this method also work with an odd number of Then… flow cards? :thinking:

@Jumacao, this is basically the same flow I showed already in Post #4, but without the need for an additional app. For this flow, however, you’ll need a numeric variable, named ā€œBeispielVariableā€ here:

Then you need a slightly different approach:

(I noticed when I tested this flow with the start-button it always selected option 5 (?). But when I added a ā€˜every 3 seconds’-trigger it selected the other options too)

I Use Gemini AI for many things. Here is an example for making a text when I get mail in mailbox - it always create a new text. I dont know if it can be used.

Hm, I’m not sure if this layout gives all the options an equal chance either… :thinking:

Option 1: 20% chance.
So it’s 80% chance left for option 2,3,4 or 5.
Option 2: 25% of 80% = 20%
So it’s 75% of 80% = 60% chance for option 3,4 or 5
Option 3: 33,3% of 60% =20%
So it’s 66,7% of 60% = 40 % chance for option 4 or 5.
Option 4 or 5: 50% of 40% = 20%

This worked for me:

You can use a Homey script for this. I have created a script using AI that randomly plays a playlist/favorite. Each playlist/favorite is played one time. Once they have all been played, a reset takes place and any playlist/favorite can be selected again. The advantage is that a playlist is only played once.in your case, youre wife will never hear the same text two days in a row :-).

o Wow, some great option to get this done.

I ended up using the Flow Gadget app, that was before I saw Wim option with only the Homey Logic, that one also look super easy to do. and no need to download extra Apps.

Is there an easy way to figure out when an App is used in a flow, asking for if I need to delete some Apps later on, or do I have to look at each Flow?

Thanks!

If you go to the app (so the screen where you can configure or delete the app it self ), you can see in which flow it is used or to device it is connected to

Thanks,

No wonder why I could not find it I was using the PC browser.

But in the Ipad app it does show where is being used.

I automatically looked in the mobile app of homey, and was not aware that it is not shown in the browser :sweat_smile:

Hopefully it will be also implemented in the browser version in the near feature..