Tasmota: Concatenate triggers with logical operators

Created on 29 Jun 2018  ·  3Comments  ·  Source: arendst/Tasmota

Have you look for this feature in other issues and in the wiki?
Yes.

I suggest to add support for concatening rule triggers with logical operators, e.g.
on APDS9960#Ambient<100 && switch1#state=1 do power on endon
to allow a motion detector to switch the light on only when ambient light is below 100 lux.

Most helpful comment

I added this example to the wiki at https://github.com/arendst/Sonoff-Tasmota/wiki/Rules#11-energy-saving-smart-switch

All 3 comments

Hi,

I like your suggestion :+1: but remember that every on [something] are triggers, not comparators.

For comparators should be needed an IF statement that currently is not implemented in Tasmota.

At this moment you can make that concatenation like this:

on switch1#state=1 do var1 100 endon
on switch1#state=0 do backlog var1 0; power1 off endon
on APDS9960#Ambient<%var1% do power1 on endon

This means that when the switch is on, the light will turn on but only when you have less than 100 lux in that room. While if the switch is off the light will be off. _(I like your rule idea)_


_For anyone else reading this: the rule need to be all together to work, like this:_

rule 1
rule on switch1#state=1 do var1 100 endon on switch1#state=0 do backlog var1 0; power1 off endon on APDS9960#Ambient<%var1% do power1 on endon

Hope this helps.

I added this example to the wiki at https://github.com/arendst/Sonoff-Tasmota/wiki/Rules#11-energy-saving-smart-switch

Hi,

If you have further comments or questions about this, please, reopen this issue. Thanks :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vujagig picture Vujagig  ·  3Comments

JoergZ2 picture JoergZ2  ·  3Comments

grizewald picture grizewald  ·  3Comments

kckepz picture kckepz  ·  3Comments

MorrisJobke picture MorrisJobke  ·  3Comments