Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shutter] Inverted shutter behaves not like expected #19114

Closed
9 of 14 tasks
SteWers opened this issue Jul 14, 2023 · 34 comments · Fixed by #20752
Closed
9 of 14 tasks

[Shutter] Inverted shutter behaves not like expected #19114

SteWers opened this issue Jul 14, 2023 · 34 comments · Fixed by #20752

Comments

@SteWers
Copy link
Contributor

SteWers commented Jul 14, 2023

PROBLEM DESCRIPTION

Inverted shutter behaves not like expected.

REQUESTED INFORMATION

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): Designator3 and other ESP 8266 devices
  • Tasmota binary firmware version number used: 13.0.0
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: _____
  • Provide the output of command: Backlog Template; Module; GPIO 255:
{"NAME":"Designator3","GPIO":[0,0,0,0,225,0,0,0,32,224,33,0,544,0],"FLAG":0,"BASE":18}
{"Module":{"0":"Designator3"}}
{"GPIO0":{"0":"None"},"GPIO1":{"0":"None"},"GPIO2":{"0":"None"},"GPIO3":{"0":"None"},"GPIO4":{"225":"Relay2"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"32":"Button1"},"GPIO13":{"224":"Relay1"},"GPIO14":{"33":"Button2"},"GPIO15":{"0":"None"},"GPIO16":{"544":"LedLink"},"GPIO17":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
No rules
  • Provide the output of this command: Status 0:
STATUS = {"Status":{"Module":0,"DeviceName":"Tasmota","FriendlyName":["Tasmota",""],"Topic":"Shutter2","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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota-DE.bin.gz","RestartReason":"Power On","Uptime":"0T18:32:52","StartupUTC":"2023-07-13T14:14:31","Sleep":50,"CfgHolder":4617,"BootCount":20,"BCResetTime":"2023-01-17T13:07:37","SaveCount":217,"SaveAddress":"F6000"}}
STATUS2 = {"StatusFWR":{"Version":"13.0.0(tasmota)","BuildDateTime":"2023.06.26 10:58:29","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"354/699"}}
STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["JRF-73529421",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["0000C009","2805C80001000600003C5A0A192800000000","40000080","00006000","00004000","00000000"]}}
STATUS4 = {"StatusMEM":{"ProgramSize":635,"Free":368,"Heap":21,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"1540C8","FlashFrequency":40,"FlashMode":"DOUT","Features":["00000407","8F9AC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","54000020","00000080"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45,62,68","Sensors":"1,2,3,4,5,6","I2CDriver":"7"}}
STATUS5 = {"StatusNET":{"Hostname":"Shutter2-4508","IPAddress":"10.100.200.106","Gateway":"10.100.200.1","Subnetmask":"255.255.255.0","DNSServer1":"10.100.200.1","DNSServer2":"0.0.0.0","Mac":"84:CC:A8:B7:F1:9C","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0}}
STATUS6 = {"StatusMQT":{"MqttHost":"10.100.200.222","MqttPort":1883,"MqttClientMask":"Shutter2_%06X","MqttClient":"Shutter2_B7F19C","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
STATUS7 = {"StatusTIM":{"UTC":"2023-07-14T08:47:23","Local":"2023-07-14T10:47:23","StartDST":"2023-03-26T02:00:00","EndDST":"2023-10-29T03:00:00","Timezone":99,"Sunrise":"06:01","Sunset":"21:50"}}
STATUS10 = {"StatusSNS":{"Time":"2023-07-14T10:47:23","Shutter1":{"Position":0,"Direction":0,"Target":100,"Tilt":0}}}
STATUS11 = {"StatusSTS":{"Time":"2023-07-14T10:47:23","Uptime":"0T18:32:52","UptimeSec":66772,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"JRF-73529421","BSSId":"09:ab:2F:07:76:15","Channel":6,"Mode":"11n","RSSI":70,"Signal":-65,"LinkCount":1,"Downtime":"0T00:00:05"}}}
STATUS13 = {"StatusSHT":{"SHT0":{"Relay1":1,"Relay2":2,"Open":100,"Close":100,"50perc":50,"Delay":0,"Opt":"0001","Calib":[300,500,700,900,1000],"Mode":"1"}}}
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:

TO REPRODUCE

Steps to reproduce the behavior:

  • setup a device as shutter
  • set ShutterInvert1 1

EXPECTED BEHAVIOUR

When a shutter is used in inverted mode it behaves not like expected. In version 12 everything was OK. I tried to show it in the following table:

Test ShutterInvert 0 ShutterInvert 1 (expected behavior) ShutterInvert 1 (real behavior)
Relay 1 open shutter open shutter close shutter
Relay 2 close shutter close shutter open shutter
Webbutton UP open shutter open shutter closing shutter (Relay 2), slider moves to CLOSE
Webbutton DOWN close shutter close shutter opening shutter (Relay 1), slider moves to OPEN
Slider OPEN open shutter open shutter closing shutter (Relay 2); click on OPEN, when it is OPEN(!?); slider moves to CLOSE
Slider CLOSE close shutter close shutter opening shutter (Relay 1); click on CLOSE, when it is CLOSE(!?); slider moves to OPEN
ShutterOpen open shutter open shutter closing shutter (Relay 2), slider moves to CLOSE
ShutterClose close shutter close shutter opening shutter (Relay 1), slider moves to OPEN
ShutterPosition 100 open shutter close shutter opening shutter (Relay 1), slider moves to OPEN
ShutterPosition 0 close shutter open shutter closing shutter (Relay 2), slider moves to CLOSE
Reported position when open 100 0 Not clear; slider OPEN -> 0; shutter open -> 100
Reported position when close 0 100 Not clear; slider CLOSE -> 100; shutter close -> 0
@NoName1311
Copy link

For me, the issue also occurs. Version 12.5.0 works as expected.

@stefanbode
Copy link
Contributor

uups missed that conversation. Let me check. where is get messed up. The idea of INVERTED that ONLY the reporting 0..100% is inverted. and that shutterposition 20 for example executes a shutterposition 80. There was some updates on the WEBUI that now updates during the move. And the WebUI was not correct with the INVERTED. Let me double check on this.

@stefanbode
Copy link
Contributor

When a shutter is used in inverted mode it behaves not like expected. In version 12 everything was OK. I tried to show it in the following table:

Test ShutterInvert 0 ShutterInvert 1 (expected behavior) ShutterInvert 1 (real behavior)
Relay 1 open shutter open shutter close shutter (fixed/checked)
Relay 2 close shutter close shutter open shutter (fixed/checked)
Webbutton UP open shutter open shutter closing shutter (Relay 2), slider moves to CLOSE (fixed/checked)
Webbutton DOWN close shutter close shutter opening shutter (Relay 1), slider moves to OPEN (fixed/checked)
Slider OPEN open shutter open shutter closing shutter (Relay 2); click on OPEN, when it is OPEN(!?); slider moves to CLOSE (fixed/checked)
Slider CLOSE close shutter close shutter opening shutter (Relay 1); click on CLOSE, when it is CLOSE(!?); slider moves to OPEN (fixed/checked)
ShutterOpen open shutter open shutter closing shutter (Relay 2), slider moves to CLOSE (fixed/checked)
ShutterClose close shutter close shutter opening shutter (Relay 1), slider moves to OPEN (fixed/checked)
ShutterPosition 100 open shutter close shutter opening shutter (Relay 1), slider moves to OPEN (fixed/checked)
ShutterPosition 0 close shutter open shutter closing shutter (Relay 2), slider moves to CLOSE (fixed/checked)
Reported position when open 100 0 Not clear; slider OPEN -> 0; shutter open -> 100 (pls recheck)
Reported position when close 0 100 Not clear; slider CLOSE -> 100; shutter close -> 0 (pls recheck)

@SteWers
Copy link
Contributor Author

SteWers commented Aug 2, 2023

At the moment I can't test it, as I am enjoying the sun of Greece instead of the rain in Germany. I'll test it, as soon as I am back.

@stefanbode
Copy link
Contributor

At the moment I can't test it, as I am enjoying the sun of Greece instead of the rain in Germany. I'll test it, as soon as I am back.

We can change. I replace you in greece and you can test in rainy, cold germany. Let me know where to go. :-)

@SteWers
Copy link
Contributor Author

SteWers commented Aug 3, 2023

We can change. I replace you in greece and you can test in rainy, cold germany. Let me know where to go. :-)

Hmm. 🤔 NO! 😂

@stefanbode
Copy link
Contributor

I think we can close this. @SteWers will check after holiday, but I'm confident to pass the test.

@SteWers
Copy link
Contributor Author

SteWers commented Aug 8, 2023

I think so, too.

@SteWers SteWers closed this as completed Aug 8, 2023
@sukram3001
Copy link

Looks like something got lost in the change - see #19328

@SteWers
Copy link
Contributor Author

SteWers commented Aug 17, 2023

@stefanbode: I saw you found a bug. The problem from @sukram3001 seem not be present on an ESP8266. But there are a few things, which are till not solved.

In short:

  • Web buttons are swapped
  • Clicking on the slider is swapped
  • Commands ShutterOpen and ShutterClose are swapped

@NoName1311
Copy link

@SteWers can you please reopen the issue? I can confirm that this is only partially resolved.

@SteWers
Copy link
Contributor Author

SteWers commented Sep 10, 2023

@NoName1311 I think, it's better, when you open a new issue. This is very old, and I cannot see any problems with the last dev on an ESP8266.

@stefanbode
Copy link
Contributor

yes open a new one. or just post here on the closed one. Both fine for me to get it fixed

@NoName1311
Copy link

I tested it with 13.1.0 and the bugs mentioned above were still there. I will test it again with the next release and then open a new issue if necessary. Thank you for your good work

@stefanbode
Copy link
Contributor

Can you please check against the actual development branch. Thx

@NoName1311
Copy link

Please excuse my late reply. Today I downloaded and tested the development branch V13.1.0.3. In this version the issue is resolved. Thank you again for the good work.

@stueB
Copy link

stueB commented Feb 14, 2024

hello there again :) imho this problem is not fully resolved.

my configuration:
tasmota 13.3 on Shelly2PM-ESP32

Interlock ON
SetOption80 1
ShutterMode 1
ShutterRelay1 1
ShutterInvert 1 (or 0)

In your table above "ShutterPosition UP" and "ShutterPosition DOWN" are not mentioned.

expected on ShutterInvert 0 and ShutterInvert 1:

ShutterPosition UP -> Shutter moves to top position
ShutterPosition DOWN -> Shutter moves to lowest position

in my case:

ShutterPosition DOWN resolves in "Command: Error" (regardless of the ShutterInvert Mode and of the current position)
ShutterInvert 0: ShutterPosition UP -> Shutter moves to top position (as expected)
ShutterInvert 1: ShutterPosition UP -> Shutter moves to lowest position (thats wrong imho)

@stefanbode
Copy link
Contributor

Regression accepted. Will fix. Up down does not work on inverted shutter

@stefanbode
Copy link
Contributor

@stueB : Thanks for bringing it up. A fix is on its way. Pls let me know if you still have issues. Tested on ESP32 and ESP8266

@Andi-Coder
Copy link

Hello, I have another problem with tasmota 14.0.0, esp8266 and the invert function.
The error occurs when the shutter is fully closed or open (0 or 100) and I try to get the shutter position via the web api "http://device1/cm?cmnd=shutterposition".
No more correct direction MQTT open/close command is executed after the web query anymore.
Only an opposite mqtt command causes a movement.
Example: Shutter is fully open, I query shutterposition through web api and than after that I want to close the shutter through mqtt command. No reaction happed. Only when I send an MQTT open command, but then is the shutter closed.

@stefanbode
Copy link
Contributor

Hmm, strange that calling a position screw it all up. Can you attach some log files with loglevel 4. I am on holiday with limited testing equipment. Please do it when shutter is at 30% to get most info.

@Andi-Coder
Copy link

Andi-Coder commented May 24, 2024

I've tested a few scenarios. It looks like a web query will always swap the invert function for opening and closing on the first mqtt command.

log.txt

@stefanbode
Copy link
Contributor

sorry for the delay. weather was very good on holiday. I found the root cause of the behavior and will work on it. Due to limited testing it will take some time. I was able to reproduce the issue.

@stefanbode
Copy link
Contributor

There is a fix submitted a few minutes ago to the DEV branch. Please give it a try. should now work with MQTT

@Andi-Coder
Copy link

Just tested dev branch. If I now drive to 0, it goes to 100 and vice versa.
log.txt

@stefanbode
Copy link
Contributor

Isn't this as it should be?

@Andi-Coder
Copy link

No, exactly the opposite happens when controlled via MQTT

@plu
Copy link

plu commented Jun 19, 2024

Maybe we need some control over which relay does what. So I can configure that relay1 is moving the shutter up, and relay2 is moving the shutter down?

@stefanbode
Copy link
Contributor

Be back from holiday and now have access again to the testbench. I can agree that the fix was only one part and need an additional fix. Submitted: #21663

@stueB
Copy link

stueB commented Oct 1, 2024

@stueB : Thanks for bringing it up. A fix is on its way. Pls let me know if you still have issues. Tested on ESP32 and ESP8266

I’ve finally managed to test it, and it’s been working with no problems with my settup so far.

@Unintendedsideeffects
Copy link

Great, I am finally the guy from the xkdc comic but I am really interested in having the behavior that was fixed here, any other option to invert the direction of shutterclose and shutteropen, not just the position? Basically the regression was the behavior I needed

@stefanbode
Copy link
Contributor

stefanbode commented Oct 27, 2024

If you just need it revert then simple switch the gpio on relay 1 and 2

@Unintendedsideeffects
Copy link

Unintendedsideeffects commented Oct 27, 2024 via email

@stefanbode
Copy link
Contributor

Maybe you write down what is your actual configuration and what do you want to archive. Relay 1 is up and 2 is down. This is mandatory. Is it is mounted in the wall and you cannot change them just flip the gpio on the configuration page. Now shutterclose and open should do what you want. If your integration now has a problem if 0 or 100 is required for the open position then use Shutterinvert. That's all you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants