Closed taste66 closed 4 years ago
I will try the solution indicated in this post: https://github.com/arendst/Tasmota/issues/7133#issuecomment-586680162 Will close the issue if it works!
Sorry was too fast, need to check again
btw the reason I use an LC-TECH is it fits into a European style wall box if you cut the corners a bit.
Looks like the rule is not trigger while
delay(MOTOR_STOP_TIME);
is executed. As I am nog SW engineer I would not know how to fix this
Yes, this might be correct, because it is a delay(500); that for sure freezes the program execution for 0.5 sec. There is no simple way to overcome this. You can set the delay in the INO file to "0". In this case, the motor immediately changes direction. If I give back control at this time I will have definitely side effects during the main execution of the functions.
Hi Stefan, Thanks I will see if I can simply avoid you change the direction without a stop in between. Currently this means te LC-TECH is not usable this way since it does break the direction relay (confirmed)
PROBLEM DESCRIPTION
A clear and concise description of what the problem is. I am using a LC-Tech X2 relay to control my shutter. This relay needs rules to change the relay status over the serial link to the extra processor. (see https://github.com/arendst/Tasmota/wiki/LC-Technology-WiFi-Relay) If you change the shutter direction while moving the commands to stop and start the motor ar to close so do not propagate to the actual relais. This breaks the direction relay if this action is performed while moving.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
: 20:25:36 CMD: Backlog Template; Module; GPIO 255 20:25:36 MQT: stat/Shutter/01/RESULT = {"NAME":"Generic","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":15,"BASE":18} 20:25:37 MQT: stat/Shutter/01/RESULT = {"Module":{"18":"Generic"}} 20:25:37 MQT: stat/Shutter/01/RESULT = {"GPIO0":{"21":"Relay1"},"GPIO1":{"0":"None"},"GPIO2":{"22":"Relay2"},"GPIO3":{"0":"None"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"}} Configuration output here: {"NAME":"Generic","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":15,"BASE":18}Rules output here: 20:26:23 MQT: stat/Shutter/01/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Free":253,"Rules":"on System#Boot do Backlog Baudrate 115200; SerialSend5 0 endon on Power1#State=1 do SerialSend5 A00101A2 endon on Power1#State=0 do SerialSend5 A00100A1 endon on Power2#State=1 do SerialSend5 A00201A3 endon on Power2#State=0 do SerialSend5 A00200A2 endon"}
STATUS 0 output here: 20:27:47 MQT: stat/Shutter/01/STATUS = {"Status":{"Module":18,"FriendlyName":["Shutter_01","Shutter_01a"],"Topic":"Shutter/01","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}}
Console output here: 20:33:02 SHT: Shutter1 Real 29605, Start 40000, Stop 0, Dir -1, Delay 0, Rtc 4.95 [s], Freq 1052 20:33:02 MQT: stat/Shutter/01/RESULT = {"Shutter1":{"Position":74,"Direction":-1}} 20:33:03 SHT: Shutter1 Real 27505, Start 40000, Stop 0, Dir -1, Delay 0, Rtc 5.95 [s], Freq 1052 20:33:03 MQT: stat/Shutter/01/RESULT = {"Shutter1":{"Position":69,"Direction":-1}} 20:33:03 SHT: Wait for Motorstop.. 20:33:03 MQT: tele/Shutter/01/STATE = {"Time":"2020-02-13T20:33:03","Uptime":"0T00:37:06","UptimeSec":2226,"Vcc":3.432,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"ON","Wifi":{"AP":1,"SSId":"taste2","BSSId":"08:62:66:3D:BD:90","Channel":6,"RSSI":100,"Signal":-45,"LinkCount":1,"Downtime":"0T00:00:09"}} 20:33:03 MQT: stat/Shutter/01/RESULT = {"POWER1":"OFF"} 20:33:03 MQT: stat/Shutter/01/POWER1 = OFF (retained) 20:33:04 MQT: tele/Shutter/01/STATE = {"Time":"2020-02-13T20:33:04","Uptime":"0T00:37:07","UptimeSec":2227,"Vcc":3.434,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"ON","Wifi":{"AP":1,"SSId":"taste2","BSSId":"08:62:66:3D:BD:90","Channel":6,"RSSI":100,"Signal":-44,"LinkCount":1,"Downtime":"0T00:00:09"}} 20:33:04 MQT: stat/Shutter/01/RESULT = {"POWER1":"OFF"} 20:33:04 MQT: stat/Shutter/01/POWER1 = OFF (retained) 20:33:04 MQT: tele/Shutter/01/STATE = {"Time":"2020-02-13T20:33:04","Uptime":"0T00:37:07","UptimeSec":2227,"Vcc":3.432,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"taste2","BSSId":"08:62:66:3D:BD:90","Channel":6,"RSSI":100,"Signal":-44,"LinkCount":1,"Downtime":"0T00:00:09"}} 20:33:04 MQT: stat/Shutter/01/RESULT = {"POWER2":"OFF"} 20:33:04 MQT: stat/Shutter/01/POWER2 = OFF (retained) 20:33:04 MQT: tele/Shutter/01/STATE = {"Time":"2020-02-13T20:33:04","Uptime":"0T00:37:07","UptimeSec":2227,"Vcc":3.434,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"ON","POWER2":"OFF","Wifi":{"AP":1,"SSId":"taste2","BSSId":"08:62:66:3D:BD:90","Channel":6,"RSSI":100,"Signal":-44,"LinkCount":1,"Downtime":"0T00:00:09"}} 20:33:04 MQT: stat/Shutter/01/RESULT = {"POWER1":"ON"} 20:33:04 MQT: stat/Shutter/01/POWER1 = ON (retained) 20:33:04 MQT: stat/Shutter/01/RESULT = {"ShutterOpen1":100} 20:33:04 RUL: POWER2#STATE=0 performs "SerialSend5 A00200A2" 20:33:04 MQT: stat/Shutter/01/RESULT = {"SerialSend":"Done"} 20:33:04 SHT: Shutter1 Real 27395, Start 27295, Stop 40000, Dir 1, Delay 0, Rtc 0.05 [s], Freq 1000 20:33:04 MQT: stat/Shutter/01/RESULT = {"Shutter1":{"Position":68,"Direction":1}} 20:33:05 SHT: Shutter1 Real 29895, Start 27295, Stop 40000, Dir 1, Delay 0, Rtc 1.30 [s], Freq 1000 20:33:05 MQT: stat/Shutter/01/RESULT = {"Shutter1":{"Position":75,"Direction":1}} 20:33:06 SHT: Shutter1 Real 31895, Start 27295, Stop 40000, Dir 1, Delay 0, Rtc 2.30 [s], Freq 1000
As you can see the rule to switch off POWER1 is never send