So why are you using Switchmode 15? Perhaps if you explain what you are trying to achieve we can help? Switchmode 15 stops the switch controlling the relay and then you create a rule to use the switch to control the relay. Setoption 114 may be a better option for example.
Could you also share the module configuration page too?
BTW it is better get into the habit to explicitly use Switchmode1 15 than just Switchmode 15
Regards
Phil K
Sent from Mail for Windows
From: Andrew Waser
Sent: 12 January 2022 22:06
To: TasmotaUsers
Subject: Re: Switchmode 15 effect on rules?
Wouldn't "switchmode1 15" do exactly the same thing as "switchmode 15"?
anyway, I tried it, and the behavior is the same.
My understanding from reading the docs is that if you have a rule related to a switch state, switchmode shouldn't matter (https://tasmota.github.io/docs/Buttons-and-Switches/#rules):
" To ignore the default behaviour define a rule which triggers on Switch<x> for all state changes or on Switch<x>#State for specific state changes. If a rule matches only certain states, default switch behaviour is suppressed only for those states."
and yet for me, it still seems like my rules aren't picking up on Switch1#State when I'm in Switchmode 15.
Just trying to figure out if I'm misunderstanding the docs, making a stupid mistake, or something else.
Andrew
On Wednesday, January 12, 2022 at 5:30:45 AM UTC-7 knowles...@gmail.com wrote:
From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Andrew Waser <awa...@gmail.com>
Sent: Monday, January 10, 2022 9:54:57 PM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Switchmode 15 effect on rules?
Can someone clarify to me if Switchmode 15 affects the triggering of switch#state rules?
Tried to research this myself but all I could find was someone with the same question and no answer.My assumption was that since the value of switch1 still changes when the switch itself changes, switch1#state should still fire at the same time.
However, when I write a simple rule to test this, using the console like so:
switchmode 15rule1 ON Switch1#State DO Power1 %value% ENDON
rule1 1
I'd expect the behavior to mimic switchmode 1, but instead it does nothing.
I've been using tasmota (with home assistant) for quite a while, but I'm relatively new to writing rules. It's possible I'm just doing something dumb with syntax, but I'm stumped.
Can anyone point me in the right direction here?--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/0eec2acc-f39d-4766-8c27-200db0f64b39n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/22658a79-af24-4217-8395-c0b5def5b16cn%40googlegroups.com.
There’s possibly an easier way. I’ve had issues programmatically switching rules on and off.
Use your timer to set var1 to 1 or 0.
On switch1#state=1 do power1 %var1% endon
On switch1#state=0 do power1 0 endon
You can then switch off but only switch on if the timer is set.
You could also use events (which is probably the way you should go because of the potential complexity)
In the old days I would say to create a ‘truth table’ of the inputs and outputs...
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/b8bdeb40-df1e-44b7-9f6a-571886207a80n%40googlegroups.com.
There’s a way without using switchmode and using a dummy relay
Assign relay1 to a spare gpio
Rule1 On power1#state=1 do power2 1 endon
It would be better to use a button rather than a switch as the position of the switch may cause confusion.
To switch off you would need to issue power2 0
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/f12f110f-0b09-4c49-aae8-55740afd23f8n%40googlegroups.com.