Revision history for TasmotaBathroomFanRules
No Differences
Additions:
%%ruletimer%%
Deletions:
No Differences
Additions:
=====Other useful info=====
**Button States**
**Check how long the rule timers have to go**
**ruletimer**
**Button States**
**Check how long the rule timers have to go**
**ruletimer**
Deletions:
No Differences
Additions:
%%rule2 on button2#state=10 do backlog power2 toggle; ruletimer2 3600 endon%%
Deletions:
No Differences
No Differences
No Differences
Additions:
-- All carried out inside the device with rules (no MQTT or external control needed)
No Differences
Additions:
-- Prevents mirror lights from remaining on
-- Does run on timer function for extract fan
-- Does run on timer function for extract fan
No Differences
Additions:
{{lastedit show="3"}}
----
CategoryHomeAutomation
CategoryMQTT
CategoryTasmota
CategoryTasmotaRules
----
CategoryHomeAutomation
CategoryMQTT
CategoryTasmota
CategoryTasmotaRules
No Differences
Additions:
======Tasmota Rules to control a triple Bathroom light button======
=====Button Type=====
-- A three pushbutton device with Tasmota installed (KS-811 Triple)
-- Controls Main Lights (1), Mirror Lights (2), Extract Fan (3)
=====First Rule=====
-- Combines 3 actions in rule1
-- If Timer 2 finishes, set Power2 OFF (I like to match the timer numbers etc with the output number. This isn't necessary)
-- If Timer 3 finishes, set Power3 Off
-- If Button 1 is pressed once, toggle Power1 output (just turn the main lights on/off on press)
%%rule1
on Rules#Timer=2 do power2 off endon
on Rules#Timer=3 do power3 off endon
on button1#state=10 do power1 toggle endon%%
=====Second Rule=====
-- Combines 1 actions in rule2
-- If button2 is pressed once, toggle the output2 and start the timer running down from 3600 (i.e mirror lights go on for one hour max)
%%rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon%%
=====Third Rule=====
-- Combines 3 actions in rule3
-- If Button 3 pressed once, toggle output 3 (the bathroom fan). Also, set ruletimer3 to start counting down from 600 seconds (10 minutes)
-- If Button 3 pressed twice, toggle output 3 and set ruletimer3 to start counting down from 3600 seconds (1 hour)
-- If Button 3 is triple pressed, toggle output 3 and set ruletimer3 to start counting down from 4 hours.
%%rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon
on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon%%
=====Setup Actions=====
Turn the rules on
%%backlog rule1 1;rule2 1; rule3 1; %%
Restrict button actions to 1-5 presses or HOLD (no special functions)
%%setoption1 1%%
Allow immediate single button press detection (this is the default)
%%setoption13 0%%
Number of 0.1 second increments for HOLD detection (it is 40 by default, we aren't using this yet)
%%setoption32 60%%
Detach all buttons from activating relays. It will just send MQTT messages and we will use rule to activate relays.
%%setoption73 1%%
=====Full rules and actions set=====
rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon on button3#state=11 do backlog power3 toggle; ruletimer3 3600 endon on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon
backlog rule1 1; rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
=====List of Button States=====
=====Button Type=====
-- A three pushbutton device with Tasmota installed (KS-811 Triple)
-- Controls Main Lights (1), Mirror Lights (2), Extract Fan (3)
=====First Rule=====
-- Combines 3 actions in rule1
-- If Timer 2 finishes, set Power2 OFF (I like to match the timer numbers etc with the output number. This isn't necessary)
-- If Timer 3 finishes, set Power3 Off
-- If Button 1 is pressed once, toggle Power1 output (just turn the main lights on/off on press)
%%rule1
on Rules#Timer=2 do power2 off endon
on Rules#Timer=3 do power3 off endon
on button1#state=10 do power1 toggle endon%%
=====Second Rule=====
-- Combines 1 actions in rule2
-- If button2 is pressed once, toggle the output2 and start the timer running down from 3600 (i.e mirror lights go on for one hour max)
%%rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon%%
=====Third Rule=====
-- Combines 3 actions in rule3
-- If Button 3 pressed once, toggle output 3 (the bathroom fan). Also, set ruletimer3 to start counting down from 600 seconds (10 minutes)
-- If Button 3 pressed twice, toggle output 3 and set ruletimer3 to start counting down from 3600 seconds (1 hour)
-- If Button 3 is triple pressed, toggle output 3 and set ruletimer3 to start counting down from 4 hours.
%%rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon
on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon%%
=====Setup Actions=====
Turn the rules on
%%backlog rule1 1;rule2 1; rule3 1; %%
Restrict button actions to 1-5 presses or HOLD (no special functions)
%%setoption1 1%%
Allow immediate single button press detection (this is the default)
%%setoption13 0%%
Number of 0.1 second increments for HOLD detection (it is 40 by default, we aren't using this yet)
%%setoption32 60%%
Detach all buttons from activating relays. It will just send MQTT messages and we will use rule to activate relays.
%%setoption73 1%%
=====Full rules and actions set=====
rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon on button3#state=11 do backlog power3 toggle; ruletimer3 3600 endon on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon
backlog rule1 1; rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
=====List of Button States=====
Deletions:
rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon
on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon
backlog rule1 1;rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
%%rule1 on Rules#Timer=1 do power3 off endon
rule2 on button1#state=10 do power3 toggle endon on button2#state=10 do power3 toggle endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
backlog rule1 1;rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
**List of button states**
No Differences
Additions:
%%rule1 on Rules#Timer=2 do power2 off endon on Rules#Timer=3 do power3 off endon on button1#state=10 do power1 toggle endon
rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon
on button3#state=11 do backlog power3 toggle; ruletimer3 3600 endon
on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon
rule2 on button2#state=10 do backlog power2 toggle endon; ruletimer2 3600 endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer3 600 endon
on button3#state=11 do backlog power3 toggle; ruletimer3 3600 endon
on button3#state=12 do backlog power3 toggle; ruletimer3 14400 endon
Deletions:
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon
on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon
on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
No Differences
Additions:
%%rule1 on Rules#Timer=1 do power3 off endon
rule2 on button1#state=10 do power3 toggle endon on button2#state=10 do power3 toggle endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon
on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon
on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
%%rule1 on Rules#Timer=1 do power3 off endon
rule2 on button1#state=10 do power3 toggle endon on button2#state=10 do power3 toggle endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
**List of button states**
rule2 on button1#state=10 do power3 toggle endon on button2#state=10 do power3 toggle endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon
on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon
on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
%%rule1 on Rules#Timer=1 do power3 off endon
rule2 on button1#state=10 do power3 toggle endon on button2#state=10 do power3 toggle endon
rule3 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon on button3#state=12 do backlog power3 toggle; ruletimer1 14400 endon
**List of button states**
Deletions:
rule2 on Rules#Timer=1 do power3 off endon
rule3 on button1#state=10 do power3 toggle
rule1 on button1#state=2 do backlog power1 toggle; ruletimer1 600 endon on button1#state=3 do backlog power1 1; ruletimer1 0 endon on power2#state=1 do backlog power1 1; power2 0; ruletimer1 3600 endon
rule2 on Rules#Timer=1 do power1 off endon
List of button states
No Differences
Additions:
rule3 on button1#state=10 do power3 toggle
backlog rule1 1;rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
backlog rule1 1;rule2 1; rule3 1; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
Deletions:
No Differences
Additions:
backlog rule1 1;rule2 1; rule3 0; setoption1 1; setoption13 0; setoption32 60; setoption73 1%%
Deletions:
No Differences
Additions:
%%rule1 on button3#state=10 do backlog power3 toggle; ruletimer1 600 endon on button3#state=11 do backlog power3 toggle; ruletimer1 3600 endon
Deletions:
No Differences
Additions:
%%rule1 on button3#state=11 do backlog power3 toggle; ruletimer1 60 endon
Deletions:
No Differences
Additions:
%%rule1 on button3#state=2 do backlog power3 toggle; ruletimer1 60 endon
rule1 on button1#state=2 do backlog power1 toggle; ruletimer1 600 endon on button1#state=3 do backlog power1 1; ruletimer1 0 endon on power2#state=1 do backlog power1 1; power2 0; ruletimer1 3600 endon
rule2 on Rules#Timer=1 do power1 off endon
List of button states
10=1 short press
11=2 short press
12=3 short press
13=4 short press
14=5 short press
3=LONG press
rule1 on button1#state=2 do backlog power1 toggle; ruletimer1 600 endon on button1#state=3 do backlog power1 1; ruletimer1 0 endon on power2#state=1 do backlog power1 1; power2 0; ruletimer1 3600 endon
rule2 on Rules#Timer=1 do power1 off endon
List of button states
10=1 short press
11=2 short press
12=3 short press
13=4 short press
14=5 short press
3=LONG press
Deletions:
No Differences
Full history for this page cannot be displayed within a single page, click here to view more.