Homey Community Forum

Handling Else-If scenarios in flows


#1

Hi everyone.
I know, that Homey do not support else if in flows so until they add that (fingers crossed) how do you handle this?

Being a developer im dying because of the missing else if possibilities so ill like to hear if you have any tips/suggestions how to work around this - without ending up with 1000 flows.

Sorry if this has been asked before, but i was not able to find and concrete in the forums.


#2

Hi,

do you have an example of a flow you want to add which you can’t do right now? I’m a developer myself and yes it is sometimes a bit cumbersome (making 3 flows for something that seems to be able in 1 ) but most of the time I manage to do so.


#3

At the moment it’s not that I’m not able to do what I want. But as you say it takes 3 or more flows for something that should/could be done in one.

So I just thought someone might have found the holy grail.

But a simple one could be reacting to a event with a value

When event SetLightMode
And EventValue == Normal
Then SetSomeLight
Else if EventValue == Dimmed
Then SetSomeOtherLight
Else if EventValue == Movie
Then SetSomeThirdLight


#4

Unfortunatly that is not possible and I guess will never be. This is due to the target audience of Homey. It is, as far as I understand, aimed at casual customers. It’s not, like domoticz or something similar, aimed to tech people :wink:


#5

http://homeyscript.athom.com/ for the more technical people :slight_smile:


#6

I understand that they want to keep it simple for the “normal” user. But why not just add an “advanced” mode for the rest of us.
I know I havde done so many times in various projects.

I know about homeyscript, but the second I start doing that, I stop everyone else in the house from editing the flows - the can easily understand a basic if then else if then flow, but from there and a UI to homeyscript is a long, long way.


#7

The best alternative you can have, not using Homeyscript, is to have multiple flows or use an app like https://apps.athom.com/app/name.klep.flow-event-bus.


#8

I concluded that as well.

The eventbus is great but unfortunately you are not able to use the event values in neither the “and” or the “then”
And that is a damn shame :slightly_frowning_face:


#9

Events are ephemeral, but you could look at using variables instead.


#10

Yes and that is the problem.
As a developer I would expect to be able to handle the events payload.

Variables is a solution but honestly it sucks.