trying to learn from example. used the example at: https://www.letscontrolit.com/wiki/inde ... rial_Rules
Rule:
Code: Select all
On System#Boot do
gpio,12,0
timerSet,1,5
endon
On Rules#Timer=1 do
if [E1SW1#Switch]=1
gpio,12,0
else
gpio,12,1
endif
timerSet,1,5
endon
virtual switch needs to be created in the "Devices" section to allow the reading the state of the LED (on or off). The Device needs to be "Switch Input" with the following settings:
Device Name - E1SW1
Enabled - Ticked
Internal PullUp - Ticked
1st GPIO - GPIO-12(D6)
Switch Type - Switch
Switch Button Type - Normal Switch
After rebooting the ESP, the LED will start blinking 10 seconds on then 10 seconds off.
But led stays on and log shows:
Code: Select all
2251651: EVENT: Rules#Timer=1
2251713: ACT : gpio,12,1
2251716: SW : GPIO 12 Set to 1
2251721: ACT : timerSet,1,5
2251730: Command: timerset
2253193: WD : Uptime 38 ConnectFailures 0 FreeMem 17776 WiFiStatus 3
12685: NTP : NTP replied: delay 30 mSec Accuracy increased by 0.981 seconds
12686: Time adjusted by -1556460418356.05 msec. Wander: -432350116.21 msec/second
12687: Current Time Zone: STD time start: 2019-10-27 03:00:00 offset: -180 min
12689: EVENT: Time#Initialized
12706: EVENT: Clock#Time=Sun,11:07
13627: EVENT: Rules#Timer=1
13687: ACT : gpio,12,1
13690: SW : GPIO 12 Set to 1
13695: ACT : timerSet,1,5
13703: Command: timerset
19627: EVENT: Rules#Timer=1
19687: ACT : gpio,12,1
19690: SW : GPIO 12 Set to 1
19694: ACT : timerSet,1,5
19702: Command: timerset
25627: EVENT: Rules#Timer=1
25688: ACT : gpio,12,1
25691: SW : GPIO 12 Set to 1
25695: ACT : timerSet,1,5
25703: Command: timerset
31627: EVENT: Rules#Timer=1
31686: ACT : gpio,12,1
31689: SW : GPIO 12 Set to 1
31695: ACT : timerSet,1,5
31703: Command: timerset
33181: WD : Uptime 1 ConnectFailures 0 FreeMem 17936 WiFiStatus 3
37628: EVENT: Rules#Timer=1
37688: ACT : gpio,12,1
37691: SW : GPIO 12 Set to 1
37695: ACT : timerSet,1,5
37703: Command: timerset
43627: EVENT: Rules#Timer=1
43687: ACT : gpio,12,1
43690: SW : GPIO 12 Set to 1
43694: ACT : timerSet,1,5
43702: Command: timerset
49627: EVENT: Rules#Timer=1
49686: ACT : gpio,12,1
49689: SW : GPIO 12 Set to 1
49694: ACT : timerSet,1,5
49702: Command: timerset
55627: EVENT: Rules#Timer=1
55688: ACT : gpio,12,1
55691: SW : GPIO 12 Set to 1
55695: ACT : timerSet,1,5
55703: Command: timerset
61627: EVENT: Rules#Timer=1
61686: ACT : gpio,12,1
61689: SW : GPIO 12 Set to 1
61694: ACT : timerSet,1,5
61703: Command: timerset
62628: EVENT: Clock#Time=Sun,11:08
63181: WD : Uptime 1 ConnectFailures 0 FreeMem 17936 WiFiStatus 3
67627: EVENT: Rules#Timer=1
67712: ACT : gpio,12,1
67715: SW : GPIO 12 Set to 1
67720: ACT : timerSet,1,5
67727: Command: timerset
73627: EVENT: Rules#Timer=1
73688: ACT : gpio,12,1
73691: SW : GPIO 12 Set to 1
73696: ACT : timerSet,1,5
73703: Command: timerset
79627: EVENT: Rules#Timer=1
79686: ACT : gpio,12,1
79689: SW : GPIO 12 Set to 1
79694: ACT : timerSet,1,5
79701: Command: timerset
85627: EVENT: Rules#Timer=1
85687: ACT : gpio,12,1
85690: SW : GPIO 12 Set to 1
85695: ACT : timerSet,1,5
85703: Command: timerset
91627: EVENT: Rules#Timer=1
91686: ACT : gpio,12,1
91689: SW : GPIO 12 Set to 1
91694: ACT : timerSet,1,5
Thx in advance!