Commit Graph

173 Commits

Author SHA1 Message Date
stefanbode 2eac0e979e
Fix crash during hammering buttons 2021-01-21 11:51:05 +01:00
Theo Arends 827a1e7764 Refactor shutter logging 2021-01-02 15:47:03 +01:00
Theo Arends dcbb3f1e0e Happy New Year 2021-01-01 13:44:04 +01:00
stefanbode ad5b04934d
Update xdrv_27_shutter.ino
code and variable optimization. Now internally testest against regression test
2020-12-28 12:27:45 +01:00
stefanbode fbe7466bc8
#10166 fixed
improved stop procedure to avoid overrun due to rounding issues between % and the real_position
2020-12-18 09:19:45 +01:00
stefanbode 52fc668714
bugfix addlog_p2 2020-12-16 07:06:50 +01:00
stefanbode 41c3dea424
Fixed overflow on runtime > 100 sek 2020-12-15 17:44:06 +01:00
stefanbode 79c3d625f5
Correct Pulsetime error to switch same relay two times 2020-12-15 12:44:49 +01:00
stefanbode 3487c4969a
optimize switch off time
Detailed analysis of where time is used during stop and optimize stop.
2020-12-15 12:40:47 +01:00
stefanbode 48bc3c9409
update Motordelay stop issue ##10033
reorder stop to esure direct stop after command
2020-12-14 18:23:01 +01:00
stefanbode 8a29adfa8b
#9906 fixed
reporting now also after manual relay change
2020-12-14 18:08:13 +01:00
Theo Arends fa9b04cd1b Satisfy compiler 2020-11-14 14:02:15 +01:00
Theo Arends fa7fdbd51a Consolidate `AddLog_P`
Consolidate `AddLog_P` into `AddLog_P2` and rename to `AddLog_P`
2020-11-06 17:09:13 +01:00
Theo Arends af5082320d Use global struct 2020-10-30 12:29:48 +01:00
Theo Arends e59bfc1d69 Use global struct 2020-10-29 13:58:50 +01:00
Theo Arends 280f0a9de7 Use global struct 2020-10-29 13:37:09 +01:00
Theo Arends cd91f09f8f
Merge pull request #9660 from stefanbode/patch-4
Resolve #9632 after sethalfway back to 50
2020-10-29 13:06:20 +01:00
stefanbode 81ce023e42
Update xdrv_27_shutter.ino 2020-10-29 12:44:05 +01:00
stefanbode bb01baa651
Update xdrv_27_shutter.ino 2020-10-29 12:41:53 +01:00
Theo Arends 0cfe1ac3e1 Use global struct 2020-10-29 12:39:44 +01:00
stefanbode e40c736dfb
Resolve #9632 after sethalfway back to 50 2020-10-29 12:28:07 +01:00
Theo Arends 3bebfb32d3 Use global struct 2020-10-29 12:21:24 +01:00
Theo Arends f1ac7b2d67 Use global struct 2020-10-28 19:03:39 +01:00
Theo Arends b93b719108 Use global struct 2020-10-28 17:32:07 +01:00
stefanbode c8d4ae4c71
Update xdrv_27_shutter.ino
Add new command to increase/decrease opening by %
2020-10-21 10:19:56 +02:00
Theo Arends 4b6ad8b904 Fix compile error when scripting and shutter is enabled
Fix compile error when scripting and shutter is enabled (#9512)
2020-10-11 10:51:20 +02:00
stefanbode f95462f916
Update xdrv_27_shutter.ino
...ongoing
2020-10-09 10:02:43 +02:00
stefanbode ce9ea40166
Update xdrv_27_shutter.ino
optimize logging
2020-10-09 09:58:33 +02:00
stefanbode 5b9c725c6d
Insert hook to rule BEFORE moving
New hook that can guarantee a rule will be executed before the movement starts. Will change documentation:
change "var<shutternumber>" to 99 to enable hook. Create a rule that executes on shutter#moving ONCE and set VARx to 0. Add rule at shutter#moved=1 to set VARx=99 and enable ONCE again.
example:
{"Rule1":"ON","Once":"ON","StopOnError":"OFF","Length":62,"Free":449,"Rules":"on shutter#moving=1 do backlog power3 on;delay 10;var1 0 endon"}
{"Rule2":"ON","Once":"OFF","StopOnError":"OFF","Length":51,"Free":460,"Rules":"on shutter#moved=1 do backlog var1 99;rule1 5 endon"}
2020-10-08 19:55:17 +02:00
stefanbode 5e5590b75a
Update xdrv_27_shutter.ino
Always room for a bug...
2020-10-07 18:01:07 +02:00
stefanbode b8d4bce213
Update xdrv_27_shutter.ino
#9458 fix int16 overflow in calibration matrix
2020-10-05 12:45:08 +02:00
stefanbode e8466371ad
Fix on Reboot and wrong operation during shutterstop
fix #9340
2020-09-27 15:36:56 +02:00
stefanbode ecf9e4ea65
Fix int16 overflow on large open times 2020-09-18 08:31:05 +02:00
stefanbode 15ef20b685
small bug 2020-09-09 16:34:03 +02:00
stefanbode 9b8138f2a0
PWMrange introduced 2020-09-09 16:23:50 +02:00
stefanbode 2db18c3e6d
Introduced PWM range for servo shutters 2020-09-09 15:24:21 +02:00
stefanbode 43c9705349
continues optimization 2020-09-09 14:04:57 +02:00
stefanbode 60aeeb445f
Editorial changes
- harmonized variable naming
- add more code comments to help others to understand
- SWITCH/PULSE now defined for each shutter.
2020-09-09 08:58:00 +02:00
stefanbode 72afb15601
Fixes on Stepper + Servo
- fix restart bug on servo
- refactor smooth-ramp for stepper and servo. Now in RTC and much more stable
- increased internal resolution to better work with ramps
- testing, testing, testing....
2020-09-08 19:34:10 +02:00
stefanbode 1c657e86e7
Optimizes ramp 2020-09-06 12:14:29 +02:00
stefanbode c3f04288fa
Update xdrv_27_shutter.ino 2020-09-05 23:35:05 +02:00
stefanbode b2b0dfcbfd
Bugfix 2020-09-05 21:07:59 +02:00
stefanbode 5c7e73f29b
New major Version 2020-09-05 20:39:24 +02:00
stefanbode 400fa10594
Update xdrv_27_shutter.ino 2020-08-20 16:21:13 +02:00
Norbert Richter cd6de24f14
Fix ShutterStopToggleDir init 2020-07-30 18:10:29 +02:00
Norbert Richter f0177f3c48
Add ShutterToggleDir/ShutterStopToggleDir
same function as ShutterToggle/ShutterStopToggle but based on last movement direction, not on current position (< or > 50%)
2020-07-21 07:25:02 +02:00
Theo Arends a84ebe552a Refactor rules processing 2020-07-20 17:24:51 +02:00
Norbert Richter e7cd96689f
Shutter reactivate rule trigger during move 2020-07-04 13:23:35 +02:00
Norbert Richter 46542e4cbb
Shutter change loglevels+1 2020-07-04 13:20:53 +02:00
Norbert Richter 0cebf9a28f
Fix shutter target == 255 on close 2020-07-04 10:43:02 +02:00
Theo Arends 6853926948 Fix array index
Fix array index (#8823)
2020-06-30 15:05:07 +02:00
Theo Arends 1f80336ae4 Fix shutter watchdogs
Fix shutter watchdogs (#8721)
2020-06-23 17:30:06 +02:00
stefanbode fba98d9839
Update xdrv_27_shutter.ino 2020-06-22 13:24:36 +02:00
stefanbode 252100704c
8.3 fixes for Shutters (Stepper Motors) #8721
PWM control has changed in SDK. CHanged shutter functionality  takes into consideration that physically the PWM frequency is minimum 40Hz
2020-06-22 13:21:13 +02:00
Theo Arends 0ca5bf4e41
Merge pull request #8243 from ctc/development
Restore tilt of venetian blinds after movement
2020-05-07 16:12:50 +02:00
Theo Arends c939077514 Change pin handling part 3 2020-04-27 12:54:07 +02:00
Theo Arends c9149b53c5 Change pin handling part 1 2020-04-26 17:33:27 +02:00
Ingo Flaschberger d9ff42f5b7 Add ShutterSetOpen command 2020-04-21 16:20:20 +02:00
Ingo Flaschberger 4518abaf32 Update Position / Trigger only active shutter 2020-04-21 16:19:42 +02:00
Ingo Flaschberger 2b1a9845d7 Fix: update position for all shutter types 2020-04-21 16:18:18 +02:00
Theo Arends b172e9bde2 Fix Shutter multi-press command 2020-04-21 09:41:35 +02:00
Theo Arends f594c72609 Fix some compile errors 2020-04-20 20:00:49 +02:00
to-scho 7feb463ffe Added 'toggle' to valid ShutterPosition arguments like up, down, open, close
doc already updated
2020-04-12 10:36:24 +02:00
to-scho 771f53ddcd New shutter commands ShutterToggle, ShutterStopOpen, ShutterStopClose, ShutterStopToggle, ShutterStopPosition
ShutterToggle opens shutter when actual shutterposition <=50 and closes otherwise. ShutterStopXxx commands will stop shutter when shutter is currently moving and will be same as ShutterXxx otherwise.
2020-04-11 08:28:05 +02:00
Norbert Richter 898fff9dbc
Add multiple GroupTopic<x> (x=1-4) (default disabled)
grouptopic (1-4) subscription even when USE_DEVICE_GROUPS
is not used.
2020-03-28 11:17:16 +01:00
Matteo Albinola 2cab0d0539 New command ShutterInvertWebButtons 2020-03-10 08:41:37 +01:00
Theo Arends 25c2a6f639
Merge pull request #7845 from to-scho/hotfix/shutterbuttons_multipress_window_timing
extended multipress window from 0.5s to 0.75s
2020-03-02 21:32:16 +01:00
to-scho 543f83218e extended multipress window from 0.5s to 0.75s 2020-03-02 20:49:11 +01:00
to-scho 02ba705eca Shutterbutton does not work for 1 button, fixes #7793 2020-03-02 20:32:55 +01:00
stefanbode edf223e4ac
Ensure rule execution at start
- fix report of TARGET in Teleperiod message
- enhance Rules support to ensure rule is triggered at start ALWAYS and not crashes on complex rules
- Fixes wong TARGET on shutterinvert=1
2020-02-27 08:32:05 +01:00
stefanbode 78e707e736
minor bug fixes and enhancements
- fix bug in multi-push from last commit
- remove rules execution every second. only at start and stop
- enable rules for Shutter#Button
- tbd: How to correctly detect a simultaneous button push
2020-02-25 17:55:45 +01:00
stefanbode b54f2d406e
Update xdrv_27_shutter.ino 2020-02-24 12:38:00 +01:00
stefanbode 66a1dc9573
Update xdrv_27_shutter.ino
- fixed shutter#moved rule not triggered
2020-02-24 12:33:52 +01:00
stefanbode 7a3a9bd364
fixes and enhancements
- shutterposition now reports actual position if the shutter is moving #7686
- new RuleEvent: Shutter1#Target to get upfront info where the shutter is moving
- RuleExecution now every second to get an update of the current position
- New functionality for Stepper Motors. Now supporting 4 Stepper shutters working simultanously
2020-02-24 12:23:03 +01:00
to-scho c6a2854a6e simultaneous shutter button press per shutter
detect simultaneous press per shutter and not for whole module
2020-01-30 14:33:33 +01:00
to-scho 11b13f73b0 fix shutterposition call w/o arguments after boot 2020-01-27 11:05:11 +01:00
to-scho 0d03c1682e fix position wrap around when shutterendstoptime is enabled 2020-01-27 09:46:39 +01:00
to-scho 6e81262709 Shutterbutton to MQTT and rules 2020-01-22 13:23:59 +01:00
to-scho 64d3d0c075 Change MQTT reporting of instantaneous shutter position from tele to stat 2020-01-14 13:32:51 +01:00
to-scho 0327d7f4b4 New command ShutterEnableEndStopTime 2020-01-13 12:00:34 +01:00
to-scho d00bea84ec Fix target shutter position inaccuracy
Introduced numerical rounding when calculating between "%" and "time" position values
2020-01-13 09:48:29 +01:00
to-scho 8cf411a1c3 New command ShutterLock
Command shutterlock<x> 1 locks shutter <x> movement. Any ongoing movement is still finished when called. Subsequent calls of shutter commands about movement, web buttons and shutter buttons  are blocked when shutter is locked. shutterlock<x> 0 unlocks shutter <x>.
2020-01-12 14:18:15 +01:00
Theo Arends 2dde0329ed
Merge pull request #7466 from to-scho/hotfix/shutterbuttons_no_key_restrictions
Enable WIFI setup, restart and reset via ShutterButtons
2020-01-09 14:52:54 +01:00
to-scho a1ccd0131d Enable WIFI setup, restart and reset via ShutterButtons
When no button restriction is given and ALL shutter buttons are pressed simultaneously more than 5 times or hold simultaneously follow Tasmota's basic button behavior.
2020-01-09 14:48:23 +01:00
Theo Arends a6dcf46771 Move heap to stack 2020-01-09 11:35:01 +01:00
Theo Arends a52c059cdc
Merge pull request #7465 from to-scho/hotfix/shutterbuttons_short_command
Add MQTT field to short shutterButton command syntax
2020-01-09 10:42:18 +01:00
to-scho 3675388148 Add MQTT field to short shutterButton command syntax
Align code to latest command doc suggestion
2020-01-09 10:35:27 +01:00
to-scho 2c6659fca4 Fix labeling of web buttons for shutters
Instead of switching power of the shutter relais web buttons will issue shutter commands to work right when in shuttermode 1. Up down labels arrow up/down fixed for more than one shutter.
2020-01-09 09:17:39 +01:00
Theo Arends 5c97cdc12e
Merge pull request #7437 from to-scho/hotfix/shutterbuttons_inverted_command
inverted ShutterButton command
2020-01-04 16:42:00 +01:00
Theo Arends 81d3b35d0c
Merge pull request #7436 from to-scho/hotfix/shutterbuttons
Fixed exception with ShutterButton
2020-01-04 16:41:24 +01:00
to-scho f6f4a3f88f inverted ShutterButton command
As discussed in doc repo this is the code for my inverted shutter button command.
2020-01-04 16:24:45 +01:00
to-scho cea20feab3 Fixed exception with ShutterButton
When a button assigned to a shutter is pressed before any command is issued an exception occured
2020-01-04 16:10:03 +01:00
Theo Arends 49137ec79f Refactor shutters 2020-01-04 15:09:57 +01:00
Theo Arends 8be7dbe235 Fix shutter JSON 2020-01-04 14:20:41 +01:00
kabongsteve 1b451e722f Improve multiple shutter operation and MQTT 2020-01-04 13:38:56 +11:00
Theo Arends eb7e7d45b2
Merge pull request #7403 from to-scho/feature/initial_shutter_button_support
Initial support for shutter button control
2020-01-02 14:48:13 +01:00
Theo Arends 8e3540d58d
Merge pull request #7405 from to-scho/hotfix/shutter_calibration_command_add_response
Add response to ShutterCalibration command
2020-01-02 14:40:25 +01:00
to-scho a9a5c33327 Wrong shutter percentage reporting
With calibrated shutters and ShutterPosition<x> 100 the resulting position may not be 100. This is due to 2 issues. a) percentage is calculated wrong from position due to numerical precision. b) real_position and subsequently position after movement is slightly smaller than max_position.

a) is fixed here by avoiding calculation when position is equal to calibration point
b) open, not fixed here. Issue further depends on start_position which makes it hard to reproduce. Maybe 'stop_position_delta=20' results is real_position not reaching max_position.
2020-01-02 12:46:12 +01:00
to-scho f2a89605af Add response to ShutterCalibration command
When ShutterCalibration<x> is called without any arguments no response was given before that allows to read out setting like for other commands. Workaround was to call ShutterRelay<x> <y>.
2020-01-02 12:37:07 +01:00
to-scho 406a5a15f5 Initial support for shutter button control
New command "ShutterButton<x> <a> <b> <c> <d> <e> <f> <g> <h> <i> <j>" added that allows to assign a tasmota button <x> to control shutter <a>.

Single press button shutter is set to position <b>.  Double press button shutter is set to position <c>. Tripple press button shutter is set to position <d>. Hold button shutter is set to position <e>. Disabling any button action is given by <b> ... <e> equal to "-". Any press of the button while the shutter is moving will immediately stop that shutter.

Global steering of all your shutters at home is supported by MQTT. By any button action an MQTT command can be initiated to the <grouptopic> of the device. For single press button this can be enabled by <f> equal to "1". Disabling is indicated by <f> equal to "0". Double to hold actions are given by <g> ... <i>, correspondingly. When <j> is equal to "0" only "cmnd/<grouptopic>/Shutterposition<y> ..." with <y>=<x> is fired. When <j> is equal to "1" <y>=1...4 is used to control any shutter number of a tasmota device having same <grouptopic>.

Easy setup for an "up" button:
ShutterButton<x> <a> up (same as ShutterButton<x> <a> 100 50 74 100 0 0 0 1 1)
Single press will move shutter up to 100%, double press to 50% and tripple press to 74%. Holding the button for more than the hold time (SetOption32) moves all shutters with same <grouptopic> up to 100%.

Easy setup for an "down" button:
ShutterButton<x> <a> down (same as ShutterButton<x> <a> 0 50 24 0 0 0 0 1 1)
Single press will move shutter down to 0%, double press to 50% and tripple press to 24%. Holding the button for more than the hold time (SetOption32) moves all shutters with same <grouptopic> down to 0%.

Easy setup for an "updown" button:
ShutterButton<x> <a> updown (same as ShutterButton<x> <a> 100 0 50 - 0 0 0 0 0)
Single press will move shutter up to 100%, double press down to 0% and tripple press to 50%. No hold action and no other shutter control by MQTT.
2020-01-02 11:23:11 +01:00