Updated Blinds and Roller Shades (markdown)

Michael Ingraham 2019-10-06 23:31:11 -04:00
parent 9fb209a779
commit a2f5e58fec
1 changed files with 42 additions and 42 deletions

@ -10,8 +10,8 @@ To use this feature, you must compile your own firmware binary. Use any of the [
The device must have at least two relays (e.g., a [Sonoff Dual R2](#sonoff-dual-r2-required-configuration)). Otherwise the shutter feature will not work.
## Shutter Modes
There are three different shutter modes determined according to the PulseTime and Interlock settings:
1. Normal Operation (ShutterMode: 0) - First relay: OFF/DOWN, Second relay: OFF/UP
There are three shutter modes which are defined according to the PulseTime and Interlock settings. The examples below are for a `ShutterRelay1 1` configuration (i.e., `Relay1` and `Relay2`).
1. Normal Operation (ShutterMode: 0) - First relay: OFF/DOWN, Second relay: OFF/UP
- `Backlog PulseTime1 0; PulseTime2 0`
- `Backlog Interlock 1,2; Interlock ON` (Interlocked relay pair)
2. Short Circuit Safe (ShutterMode: 1) - First relay: ON/OFF, Second relay: UP/DOWN
@ -23,7 +23,7 @@ There are three different shutter modes determined according to the PulseTime an
[Diagrams](#wiring-diagrams) for Normal, Stepper motor, and Short Circuit-Safe configurations are available at the end of this page. Even if the shutter does not have two motors, three wires have to be connected.
**After setting the options for shutter mode, the device must be rebooted.** Otherwise, the sliders won't be available in the web UI, and the `ShutterOpenDuration`and `ShutterCloseDuration` commands will report "Shutter unknown". Send `ShutterRelay<x> 1` and check what `ShutterMode` is displayed:
**After setting the options for shutter mode, the device must be rebooted.** Otherwise, the sliders won't be available in the web UI, and the `ShutterOpenDuration<x>`and `ShutterCloseDuration<x>` commands will report "Shutter unknown". Send `ShutterRelay<x> 1` and check what `ShutterMode` is displayed:
```
Shutter accuracy digits: 1
Shutter 0 (Relay:1): Init. Pos: 20000 [100 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 20000, Opentime 10.0 [s], Closetime 10.0 [s], CoedffCalc: c0: 0, c1 200, c2: 200, c3: 0, c4: 0, binmask 3, is inverted 1, ShutterMode 0
@ -73,32 +73,32 @@ There are shutters that have two relays but only need a pulse to start or stop.
## Calibration
[Shutter calibration video tutorial](https://www.youtube.com/watch?v=Z-grrvnu2bU)
- Set the `ShutterOpenDuration` to the time the shutter needs to open completely.
- Set the `ShutterCloseDuration` at least to the time the shutter needs to close completely. If the shutter does not close completely or runs too long, the calibration point of a closed shutter can be defined with `ShutterSetClose`. Move the shutter to the close position and execute `ShutterSetClose` command. `ShutterPosition` will be reset to 0 (`ShutterClose`).
- Set the 50% open position of the shutter. Some shutters need some time from totally closed until they begin moving the bottom-most part and opening. This often results a shutter that is less than 50% open when the shutter has been operating for 50% of the set duration. This can be corrected by using `ShutterSetHalfway`. Use this procedure to calibrate the half-open position:
1. `ShutterClose` (confirm that the shutter is completely closed)
2. `ShutterSetHalfway 50` (reset to default)
- Set the `ShutterOpenDuration<x>` to the time the shutter needs to open completely.
- Set the `ShutterCloseDuration<x>` at least to the time the shutter needs to close completely. If the shutter does not close completely or runs too long, the calibration point of a closed shutter can be defined with `ShutterSetClose<x>`. Move the shutter to the close position and execute `ShutterSetClose<x>` command. `ShutterPosition<x>` will be reset to 0 (`ShutterClose<x>`).
- Set the 50% open position of the shutter. Some shutters need some time from totally closed until they begin moving the bottom-most part and opening. This often results a shutter that is less than 50% open when the shutter has been operating for 50% of the set duration. This can be corrected by using `ShutterSetHalfway<x>`. Use this procedure to calibrate the half-open position:
1. `ShutterClose<x>` (confirm that the shutter is completely closed)
2. `ShutterSetHalfway<x> 50` (reset to default)
3. Move the shutter to actual 50% open position.
4. `ShutterPosition` and record the value (e.g., 63)
5. `ShutterClose`
6. `ShutterSetHalfway 63` (using the value from step #4 above)
4. `ShutterPosition<x>` and record the value (e.g., 63)
5. `ShutterClose<x>`
6. `ShutterSetHalfway<x> 63` (using the value from step #4 above)
7. `Restart 1`
<!---
### Increasing Calibration Granularity
If you desire that the %-opening closely match what `ShutterPosition` and web UI indicate, there is a granular calibration matrix available. Ensure that `ShutterClose` and `ShutterOpen` moves the shutter more or less to the limit positions and follow this procedure:
- `ShutterSetHalfway 50` (reset to default)
- `ShutterCalibration 30 50 70 90 100`
If you desire that the %-opening closely match what `ShutterPosition<x>` and web UI indicate, there is a granular calibration matrix available. Ensure that `ShutterClose<x>` and `ShutterOpen<x>` moves the shutter more or less to the limit positions and follow this procedure:
- `ShutterSetHalfway<x> 50` (reset to default)
- `ShutterCalibration<x> 30 50 70 90 100`
- `Restart 1`
- `ShutterClose`
- `ShutterClose<x>`
- Now move the shutter to each of the following positions and measure the opening for each.
- `ShutterPosition 30` (e.g., measurement = `15`)
- `ShutterPosition 50` (e.g., measurement = `50`)
- `ShutterPosition 70` (e.g., measurement = `100`)
- `ShutterPosition 90` (e.g., measurement = `150`)
- `ShutterPosition 100` (e.g., measurement = `180`)
- `ShutterPosition<x> 30` (e.g., measurement = `15`)
- `ShutterPosition<x> 50` (e.g., measurement = `50`)
- `ShutterPosition<x> 70` (e.g., measurement = `100`)
- `ShutterPosition<x> 90` (e.g., measurement = `150`)
- `ShutterPosition<x> 100` (e.g., measurement = `180`)
- Now enter the measurements as the calibration:
`ShutterCalibration 15 50 100 150 180`
`ShutterCalibration<x> 15 50 100 150 180`
Notice that there is no calibration for the 10\% position. On many shutters, there is no movement during the initial phase (i.e., nearly 10% of total time). Therefore the opening could be `0`. This measurement would cause an execution DIV 0 exception. Therefore the first calibration point is 30%. In most cases this is not a large opening so the calibration will be near enough. Yes, until ~10%, the position will be a bit "off" but not enough for concern.
-->
@ -111,10 +111,10 @@ If using a Sonoff Dual R2, use the following Template:
### Checklist
- Ensure that the first relay opens the shutter
- Ensure that the second relay closes the shutter
- Set `ShutterRelay`
- Set `ShutterOpenDuration`
- Set `ShutterCloseDuration`
- Set `ShutterSetHalfway`
- Set `ShutterRelay<x>`
- Set `ShutterOpenDuration<x>`
- Set `ShutterCloseDuration<x>`
- Set `ShutterSetHalfway<x>`
- If the shutter uses a stepper motor instead of separate motors for each direction (i.e., duration based), define `PulseTime<x> 2` on both relays. The driver's behavior will change to a stepper motor that needs pulses to start and stop.
## Rules
@ -149,11 +149,11 @@ cover:
position_topic: stat/<topic>/Shutter1
position_open: 100
position_closed: 0
set_position_topic: "cmnd/<topic>/ShutterPosition"
command_topic: "cmnd/<topic>/backlog"
payload_open: "ShutterOpen"
payload_close: "ShutterClose"
payload_stop: "ShutterStop"
set_position_topic: "cmnd/<topic>/ShutterPosition1"
command_topic: "cmnd/<topic>/Backlog"
payload_open: "ShutterOpen1"
payload_close: "ShutterClose1"
payload_stop: "ShutterStop1"
retain: false
optimistic: false
qos: 1
@ -167,21 +167,21 @@ cover:
name: "Test"
availability_topic: "tele/<topic>/LWT"
state_topic: "stat/<topic>/RESULT"
command_topic: "cmnd/<topic>/backlog"
command_topic: "cmnd/<topic>/Backlog"
value_template: '{{value_json.ShutterPosition1}}'
qos: 1
retain: true
payload_open: "ShutterOpen"
payload_close: "ShutterClose"
payload_stop: "ShutterStop"
payload_open: "ShutterOpen1"
payload_close: "ShutterClose1"
payload_stop: "ShutterStop1"
state_open: "ON"
state_closed: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: true
tilt_command_topic: 'cmnd/<topic>/ShutterPosition'
tilt_status_topic: 'cmnd/<topic>/ShutterPosition'
set_position_topic: 'cmnd/<topic>/ShutterPosition'
tilt_command_topic: 'cmnd/<topic>/ShutterPosition1'
tilt_status_topic: 'cmnd/<topic>/ShutterPosition1'
set_position_topic: 'cmnd/<topic>/ShutterPosition1'
tilt_min: 0
tilt_max: 100
tilt_closed_value: 0
@ -199,19 +199,19 @@ cover:
open_cover:
service: mqtt.publish
data:
topic: 'cmnd/<topic>/ShutterOpen'
topic: 'cmnd/<topic>/ShutterOpen1'
close_cover:
service: mqtt.publish
data:
topic: 'cmnd/<topic>/ShutterClose'
topic: 'cmnd/<topic>/ShutterClose1'
stop_cover:
service: mqtt.publish
data:
topic: 'cmnd/<topic>/shutterstop'
topic: 'cmnd/<topic>/shutterstop1'
set_cover_position:
service: mqtt.publish
data_template:
topic: 'cmnd/<topic>/ShutterPosition'
topic: 'cmnd/<topic>/ShutterPosition1'
payload: '{{position}}'
```
@ -223,7 +223,7 @@ cover:
![ShortCicuitSafe](https://user-images.githubusercontent.com/34340210/65997877-3517e180-e468-11e9-9b8c-2f0787f977f6.png)
## Sample Log Output
Typical log output (log level `3`) when starting from ShutterOpen. The first command is `ShutterClose`. After closing, open it to 50% with `ShutterPosition 50`
Typical log output (log level `3`) when starting from `ShutterOpen1`. The first command is `ShutterClose1`. After closing, open it to 50% with `ShutterPosition1 50`
```
SHT: Accuracy digits: 1
SHT: Shutter 0 (Relay:1): Init. Pos: 20000 [100 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 20000, Opentime 10.0 [s], Closetime 10.0 [s], CoedffCalc: c0: 0, c1 200, c2: 200, c3: 0, c4: 0, binmask 3, is inverted 0, ShutterMode 0