• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pending] IF ... THEN ... ELSE
Hi Folks,

it seems, that  ELSE is not implemented?

From my Point of view this would make some Configs much simpilier, e.g.:

"IF device1.state IS connected THEN switch DEVICE device2 TO on ELSE switch DEVICE device2 TO off"
"IF device1.state IS connected THEN label DEVICE label0 TO abc ELSE label DEVICE label0 TO def"

Thanks, Alex
That would be helpfull

now i have almost duplicate rules

If device.state IS on THEN... turn on
if device.state IS off THEN... turn off

The else statement would be helpful.

Not sure if it is posible but it would be helpfull if there are multiple IF statements posible.

    "rule": "IF device.state IS on THEN(
IF Remote01C13.state IS ON THEN switch DEVICE Remote01C13 TO off")
switch DEVICE Remote01C13 TO on,

is there some planning about this?

I have several rules like this:

"dev-tv-check-on": {
                        "rule": "IF sonne.sun == set AND Fernseher.state == connected THEN switch DEVICE Fernsehlicht TO on",
                        "active": 1
                "dev-tv-check-off": {
                        "rule": "IF Fernseher.state == disconnected THEN switch DEVICE Fernsehlicht TO off AFTER 1 MINUTE",
                        "active": 1

and like to avoid using two rules. Or is there another way to do dis?
Not at this moment. Also, because rules most of the time fail. You don't want to execute an action in these cases everytime.
The new eventing code that i will push gradually this week will incoporate this feature.

Forum Jump:

Browsing: 1 Guest(s)