Closed cbkcbkcbk closed 4 years ago
Forgot the mention that I added the following lines in "user_config_override.h"
You need to compare fanspeed with a value like in this example
on fanspeed#data=3 do buzzer 3,3 endon
You need to compare fanspeed with a value like in this example
on fanspeed#data=3 do buzzer 3,3 endon
My rules using fanspeed seem to be working as I wanted as written. Hoping for a fix to the problem of the System#Boot trigger not working (the first line of my rule).
ON system#boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON
is not a valid rule expression. Try ON different trigger DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON
and it will not work too.
Please, address this to the Tasmota Support Chat. The chat is a better and more dynamic channel for helping you. Github issues are meant for Tasmota Software Bug Reporting.
Please check the Contributing Guideline and Policy and the Support Guide.
Thanks.
See Wiki for more information. See Chat for more user experience. See Community for forum. See Code of Conduct
Hi,
The rule:
ON system#boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON
Is not valid because on SYSTEM BOOT the MQTT was not initialized, so the subscribe command is ignored.
You have to use MQTT#CONNECTED instead.
Thanks
I tried and now agree that it won’t work with a different trigger, but I don’t see how this is an invalid expression. I still suspect this is a bug. If you insist it’s an invalid expression, I will go to the chat. But please at least consider this:
I followed exactly the given example in the wiki.
https://github.com/arendst/Tasmota/wiki/Subscribe-&-Unsubscribe
“Examples:
Rule1
ON System#Boot DO Subscribe BkLight, stat/%topic%/POWER ENDON
ON Event#BkLight=ON DO
16:07:22 CMD: ***Demonstration 16:07:27 CMD: Subscribe 16:07:27 MQT: stat/SFan01/RESULT = {"Subscribe":""} 16:07:31 CMD: Rule1 16:07:31 MQT: stat/SFan01/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Free":268,"Rules":"ON system#boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON ON Fanspeed#Data DO publish custom/SFan01/FanSpeed %value% ENDON ON Fanspeed#Data>0 DO Mem1 %value% ENDON ON Event#Fpwr=1 DO FanSpeed %Mem1% ENDON ON Event#Fpwr=0 DO FanSpeed 0 ENDON"} 16:07:45 CMD: Subscribe Fpwr, custom/SFan01/Fpwr 16:07:45 MQT: stat/SFan01/RESULT = {"Subscribe":"FPWR,custom/SFan01/Fpwr/#"} 16:07:50 CMD: Subscribe 16:07:50 MQT: stat/SFan01/RESULT = {"Subscribe":"FPWR,custom/SFan01/Fpwr; "}
I totally acknowledge I can be missing something stupid here.
Hi,
Again:
The rule:
ON system#boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON
Is not valid because on SYSTEM#BOOT the MQTT was not initialized, so the subscribe command is ignored, because THERE IS NO MQTT CONNECTION !
You have to use MQTT#CONNECTED instead.
The wiki article was wrong. Fixing... EDIT: done.
Thanks for pointing this mistake on the docs :+1:
BUG DESCRIPTION
A clear and concise description of what the bug is.
System#Boot is not working as a rule trigger with iFan03.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED
[ ] Provide the output of command:
Backlog Template; Module; GPIO
:16:18:56 CMD: Module 16:18:56 MQT: stat/SFan01/RESULT = {"Module":{"71":"Sonoff iFan03"}}
16:19:48 CMD: GPIOS 16:19:48 MQT: stat/SFan01/RESULT = {"GPIOs1":{"0":"None","18":"Button2","91":"Button2n","123":"Button2i","127":"Button2in","19":"Button3","92":"Button3n","124":"Button3i","128":"Button3in","20":"Button4","93":"Button4n","125":"Button4i","129":"Button4in","9":"Switch1","82":"Switch1n","10":"Switch2","83":"Switch2n","11":"Switch3","84":"Switch3n","12":"Switch4","85":"Switch4n","13":"Switch5","86":"Switch5n","14":"Switch6","87":"Switch6n","15":"Switch7","88":"Switch7n"}} 16:19:48 MQT: stat/SFan01/RESULT = {"GPIOs2":{"16":"Switch8","89":"Switch8n","25":"Relay5","33":"Relay5i","26":"Relay6","34":"Relay6i","27":"Relay7","35":"Relay7i","28":"Relay8","36":"Relay8i","53":"Led2","57":"Led2i","54":"Led3","58":"Led3i","55":"Led4","59":"Led4i","157":"LedLink","158":"LedLinki","37":"PWM1","46":"PWM1i","38":"PWM2","47":"PWM2i","39":"PWM3","48":"PWM3i","40":"PWM4","49":"PWM4i","41":"PWM5","50":"PWM5i","42":"Counter1","94":"Counter1n"}} 16:19:48 MQT: stat/SFan01/RESULT = {"GPIOs3":{"43":"Counter2","95":"Counter2n","44":"Counter3","96":"Counter3n","45":"Counter4","97":"Counter4n","160":"Buzzer","5":"I2C SCL","6":"I2C SDA","1":"DHT11","2":"AM2301","3":"SI7021","4":"DS18x20","7":"WS2812","147":"ALux IrRcv","159":"ALux IrSel","143":"MY92x1 DI","144":"MY92x1 DCKI","140":"SM16716 CLK","141":"SM16716 DAT","142":"SM16716 PWR","180":"SM2135 Clk","181":"SM2135 Dat","107":"Tuya Tx","108":"Tuya Rx"}} 16:19:48 MQT: stat/SFan01/RESULT = {"GPIOs4":{"183":"EXS Enable","8":"IRsend","51":"IRrecv","73":"SR04 Tri","74":"SR04 Ech","102":"HX711 SCK","103":"HX711 DAT","130":"HLWBL SEL","131":"HLWBL SELi","132":"HLWBL CF1","133":"HLW8012 CF","134":"BL0937 CF","156":"ADE7953 IRQ","145":"CSE7766 Tx","146":"CSE7766 Rx","135":"MCP39F5 Tx","136":"MCP39F5 Rx","137":"MCP39F5 Rst","62":"PZEM0XX Tx","63":"PZEM004 Rx","98":"PZEM016 Rx","99":"PZEM017 Rx","71":"SerBr Tx","72":"SerBr Rx"}} 16:19:48 MQT: stat/SFan01/RESULT = {"GPIOs5":{"60":"MHZ Tx","61":"MHZ Rx","64":"SAir Tx","65":"SAir Rx","101":"SDS0X1 Tx","70":"SDS0X1 Rx","69":"PMS5003"}}
Rules output here: 17:13:46 CMD: Backlog Rule1 17:13:46 MQT: stat/SFan01/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Free":268,"Rules":"ON system#boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON ON Fanspeed#Data DO publish custom/SFan01/FanSpeed %value% ENDON ON Fanspeed#Data>0 DO Mem1 %value% ENDON ON Event#Fpwr=1 DO FanSpeed %Mem1% ENDON ON Event#Fpwr=0 DO FanSpeed 0 ENDON"} 17:14:35 CMD: Backlog Rule2 17:14:35 MQT: stat/SFan01/RESULT = {"Rule2":"OFF","Once":"OFF","StopOnError":"OFF","Free":511,"Rules":""} 17:14:42 CMD: Backlog Rule3 17:14:42 MQT: stat/SFan01/RESULT = {"Rule3":"OFF","Once":"OFF","StopOnError":"OFF","Free":511,"Rules":""}
STATUS 0 output here:
17:15:09 CMD: Status 0 17:15:09 MQT: stat/SFan01/STATUS = {"Status":{"Module":71,"FriendlyName":["Sonoff"],"Topic":"SFan01","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":1}} 17:15:09 MQT: stat/SFan01/STATUS1 = {"StatusPRM":{"Baudrate":9600,"GroupTopic":"sonoffs","OtaUrl":"http://thehackbox.org/tasmota/release/sonoff-minimal.bin","RestartReason":"Software/System restart","Uptime":"0T00:42:00","StartupUTC":"2019-11-11T15:33:09","Sleep":50,"CfgHolder":4617,"BootCount":23,"SaveCount":1139,"SaveAddress":"F8000"}} 17:15:09 MQT: stat/SFan01/STATUS2 = {"StatusFWR":{"Version":"6.7.1(sonoff)","BuildDateTime":"2019-11-11T14:50:41","Boot":7,"Core":"STAGE","SDK":"2.2.2-dev(38a443e)"}} 17:15:09 MQT: stat/SFan01/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["WeepingAngels",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008029","2805C8000100060000005A00000000000000","00020000"]}} 17:15:09 MQT: stat/SFan01/STATUS4 = {"StatusMEM":{"ProgramSize":556,"Free":444,"Heap":24,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"144051","FlashMode":3,"Features":["00000809","8FDAE197","042683A1","22B617CD","01001BC0","0000F081"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,22,24,26,30","Sensors":"1,2,3,4,5,6,7,8,9,10,14,15,17,18,20,22,26,34"}} 17:15:09 MQT: stat/SFan01/STATUS5 = {"StatusNET":{"Hostname":"SFan01-1046","IPAddress":"192.168.1.111","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.1.1","Mac":"DC:4F:22:B0:64:16","Webserver":2,"WifiConfig":4}} 17:15:09 MQT: stat/SFan01/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.1.106","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_B06416","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":30}} 17:15:09 MQT: stat/SFan01/STATUS7 = {"StatusTIM":{"UTC":"Mon Nov 11 16:15:09 2019","Local":"Mon Nov 11 17:15:09 2019","StartDST":"Sun Mar 31 02:00:00 2019","EndDST":"Sun Oct 27 03:00:00 2019","Timezone":"+01:00","Sunrise":"07:52","Sunset":"17:15"}} 17:15:09 MQT: stat/SFan01/STATUS10 = {"StatusSNS":{"Time":"2019-11-11T17:15:09"}} 17:15:09 MQT: stat/SFan01/STATUS11 = {"StatusSTS":{"Time":"2019-11-11T17:15:09","Uptime":"0T00:42:00","UptimeSec":2520,"Heap":23,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"WeepingAngels","BSSId":"B0:BE:76:7C:6E:C1","Channel":1,"RSSI":70,"LinkCount":1,"Downtime":"0T00:00:08"}}}
Console output here: 00:00:00 CFG: Loaded from flash at FB, Count 1136 00:00:00 Project sonoff Sonoff Version 6.7.1(sonoff)-STAGE 00:00:00 WIF: Connecting to AP1 WeepingAngels in mode 11N as SFan01-1046... 00:00:06 WIF: Connected 00:00:06 HTP: Web server active on SFan01-1046 with IP address 192.168.1.111 16:08:51 MQT: Attempting connection... 16:08:51 MQT: Connected 16:08:51 MQT: tele/SFan01/LWT = Online (retained) 16:08:51 MQT: cmnd/SFan01/POWER = 16:08:51 MQT: tele/SFan01/INFO1 = {"Module":"Sonoff iFan03","Version":"6.7.1(sonoff)","FallbackTopic":"cmnd/DVES_B06416_fb/","GroupTopic":"sonoffs"} 16:08:51 MQT: tele/SFan01/INFO2 = {"WebServerMode":"Admin","Hostname":"SFan01-1046","IPAddress":"192.168.1.111"} 16:08:51 MQT: tele/SFan01/INFO3 = {"RestartReason":"Software/System restart"} 16:08:51 MQT: stat/SFan01/RESULT = {"POWER1":"OFF"} 16:08:51 MQT: stat/SFan01/POWER1 = OFF (retained) 16:08:51 MQT: stat/SFan01/RESULT = {"FanSpeed":0} 16:08:51 RUL: FANSPEED#DATA performs "publish custom/SFan01/FanSpeed 0" 16:08:51 MQT: custom/SFan01/FanSpeed = 0 16:08:59 MQT: tele/SFan01/STATE = {"Time":"2019-11-11T16:08:59","Uptime":"0T00:00:18","UptimeSec":18,"Heap":30,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"WeepingAngels","BSSId":"B0:BE:76:7C:6E:C1","Channel":1,"RSSI":66,"LinkCount":1,"Downtime":"0T00:00:07"}} 16:10:49 CMD: Rule1 16:10:49 MQT: stat/SFan01/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Free":268,"Rules":"ON System#Boot DO Subscribe Fpwr, custom/SFan01/Fpwr ENDON ON Fanspeed#Data DO publish custom/SFan01/FanSpeed %value% ENDON ON Fanspeed#Data>0 DO Mem1 %value% ENDON ON Event#Fpwr=1 DO FanSpeed %Mem1% ENDON ON Event#Fpwr=0 DO FanSpeed 0 ENDON"} 16:10:58 CMD: Subscribe 16:10:58 MQT: stat/SFan01/RESULT = {"Subscribe":""} 16:11:13 CMD: Subscribe Fpwr, custom/SFan01/Fpwr 16:11:13 MQT: stat/SFan01/RESULT = {"Subscribe":"FPWR,custom/SFan01/Fpwr/#"} 16:11:13 RUL: EVENT#FPWR=0 performs "FanSpeed 0" 16:11:13 MQT: stat/SFan01/RESULT = {"FanSpeed":0} 16:11:13 RUL: FANSPEED#DATA performs "publish custom/SFan01/FanSpeed 0" 16:11:13 MQT: custom/SFan01/FanSpeed = 0 16:11:21 CMD: Subscribe 16:11:21 MQT: stat/SFan01/RESULT = {"Subscribe":"FPWR,custom/SFan01/Fpwr; "}