Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tasmota/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger committed Sep 1, 2023
2 parents 6bff4d7 + 0b08126 commit 2ec9780
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 53 deletions.
3 changes: 2 additions & 1 deletion docs/Berry-Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,10 @@ def netflip()
end
tasmota.set_timer(30000,netflip) #4
```

1. store variable "eth" with Ethernet status - "true" if Ethernet IP exists and "false" if not
2. check if wifi status is true and compare to eth status
3. send command `Wifi` with parameter depending on eth variable. `..` is to concatenate a string. See Berry [manualg(https://github.com/berry-lang/berry/wiki/Chapter-3#-operator-1)
3. send command `Wifi` with parameter depending on eth variable. `..` is to concatenate a string. See Berry [manual](https://github.com/berry-lang/berry/wiki/Chapter-3#-operator-1)
4. set a timer to execute the netflip function 30000ms (30 seconds) after loading `autoexec.be`

## TMP117 Driver
Expand Down
23 changes: 20 additions & 3 deletions docs/Blinds-and-Shutters.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,24 @@ Shutter 0 (Relay:1): Init. Pos: 20000 [100 %], Open Vel.: 100 Close Vel.: 100 ,
## Operation
Turning a device relay on or off directly (i.e., using `Power`) will function to affect a shutter's movement. In momentary mode (i.e., stepper motor), the relays start or stop the motor. The driver takes care of the direction and proper update of the shutter position.

The shutter reports its position and can also be sent to a dedicated position. `ShutterPosition 0` means the shutter is closed and `ShutterPosition 100` means the shutter is open. If you need the position values reversed (`0` = open, `100` = closed), define and [calibrate your shutter as documented below](#calibration). Then tell Tasmota to reverse the shutter position meaning via the `ShutterInvert<x> 1` command. All internal calculations are the same (the log output is the same). Only the interaction with the user and other systems changes. Now `ShutterPosition<x> 0` will open the shutter and `ShutterPosition<x> 100` will close the shutter. To set a value to all shutter you can use the index 0. For example `ShutterPosition0 30` will move all shutters to 30%. The index 0 also works with all configuration items.
The shutter reports its position and can also be sent to a dedicated position. `ShutterPosition 0` means the shutter is closed and `ShutterPosition 100` means the shutter is open. If you need the position values reversed (`0` = open, `100` = closed), define and [calibrate your shutter as documented below](#calibration). Then tell Tasmota to reverse the shutter position meaning via the `ShutterInvert<x> 1` command. All internal calculations are the same (the log output is the same). Only the interaction with the user and other systems changes. Now `ShutterPosition<x> 0` will open the shutter and `ShutterPosition<x> 100` will close the shutter.

Function | ShutterInvert 0 | ShutterInvert 1
-- | -- | --
Relay 1 | open shutter | open shutter
Relay 2 | close shutter | close shutter
Webbutton UP | open shutter | open shutter
Webbutton DOWN | close shutter | close shutter
Slider OPEN | open shutter | open shutter
Slider CLOSE | close shutter | close shutter
ShutterOpen | open shutter | open shutter
ShutterClose | close shutter | close shutter
ShutterPosition 100 | open shutter | close shutter
ShutterPosition 0 | close shutter | open shutter
Reported position when open | 100 | 0
Reported position when close | 0 | 100

To set a value to all shutter you can use the index 0. For example `ShutterPosition0 30` will move all shutters to 30%. The index 0 also works with all configuration items.

When `SetOption80 1` is invoked you have to define `Shutterrelay1 <value>` to get started
If possible to avoid any injury on unexpected movement all RELAYS should start in OFF mode when the device reboots: `PowerOnState 0`
Expand Down Expand Up @@ -178,7 +195,7 @@ Following defaults are pre-compiled into the code and can only be changed by com
### Motor Stop time
When shutters change direction immediatly it can happen that there is a short circuit or at least high moments on the motors. Therfore the default time between a STOP and the next START of the shutter is 0.5s = 500ms. This allows in most cases the shutter to fully stop and then start from a static position. With Version 12.3 you can change the duration through `shuttermotorstop 500` or any other value in ms. The value is for all defined shutters the same.

WARNING: If you control the relay DIRECT through buttons os switches and do not use shutterbuttons or a rule to decouple it, then the MOTOSTOPTIME cannot kick in. The Relay in ON before the shutterdriver can intercept.
WARNING: If you control the relay DIRECT through buttons or switches and do not use shutterbuttons or a rule to decouple it, then the MOTOSTOPTIME cannot kick in. The Relay is ON before the shutterdriver can intercept.

### Button Control
When shutter is running in `ShutterMode 1` (normal two relay up/off down/off), you already have basic control over the shutter movement using switches or buttons in the module configuration to directly drive the shutter relays. For short circuit safe operation `ShutterMode 2` direct control of the relays will not give you a nice user interface since you have to 1st set the direction with one switch/button and 2nd switch on the power by the other switch/button. Because the button controll use multi-press events ensure that the "immediate action" is disabled: `SetOption13 0` (default)
Expand Down Expand Up @@ -209,7 +226,7 @@ More advanced control of the button press actions is given by the following `Shu

`ShutterButton<x> <button> <p1> <p2> <p3> <ph> <m1> <m2> <m3> <mh> <mi>`

`<button>` ESP8266:`1..4`,ESP32:`1..32` : Button number, `0/-`: disable buttons for this shutter<BR>`<p1>` `0..100`: single press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` single press increment position<BR>`<p2>` `0..100`: double press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` double press increment position<BR>`<p3>` `0..100`: triple press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` tripple press increment position<BR>`<ph>` `0..100`: hold press position, shutter stop after releasing the hold button, `t`: toggle, `-`: disable<BR>`<m1>` `1`: enable single press position MQTT broadcast, `0/-`: disable<BR>`<m2>` `1`: enable double press position MQTT broadcast, `0/-`: disable<BR>`<m3>` `1`: enable triple press position MQTT broadcast, `0/-`: disable<BR>`<mh>` `1`: enable hold press position MQTT broadcast, `0/-`: disable<BR>`<mi>` `1`: enable MQTT broadcast to all shutter indices, `0/-`: disable
`<button>` ESP8266:`1..4`,ESP32:`1..32` : Button number, `0/-`: disable buttons for this shutter<BR>`<p1>` `0..100`: single press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` single press increment position<BR>`<p2>` `0..100`: double press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` double press increment position<BR>`<p3>` `0..100`: triple press position, `t`: toggle, `-`: disable, `--0..100` or `++0..100` tripple press increment position<BR>`<ph>` `0..100`: hold press position, shutter stop after releasing the hold button if no group send `<mh>` is defined. If`<mh>` is 1 the release of the botton will NOT stop any shutter, `t`: toggle, `-`: disable<BR>`<m1>` `1`: enable single press position MQTT broadcast, `0/-`: disable<BR>`<m2>` `1`: enable double press position MQTT broadcast, `0/-`: disable<BR>`<m3>` `1`: enable triple press position MQTT broadcast, `0/-`: disable<BR>`<mh>` `1`: enable hold press position MQTT broadcast, `0/-`: disable<BR>`<mi>` `1`: enable MQTT broadcast to all shutter indices, `0/-`: disable

Parameters are optional. When missing, all subsequent parameters are set to `disable`.

Expand Down
36 changes: 19 additions & 17 deletions docs/Bluetooth_MI32.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ cbp = tasmota.gen_cb(cb)
BLE.conn_cb(cbp,cbuf)
```

Error codes:
####Error codes:

- 0 - no error
- 1 - connection error
Expand All @@ -444,7 +444,7 @@ Error codes:
- 8 - did not write value
- 9 - timeout: did not read on notify

Op codes:
####Op codes:

- 1 - read
- 2 - write
Expand Down Expand Up @@ -499,21 +499,23 @@ BLE.serv_cb(cbp,cbuf)
# now add characteristics and advertisement ...
```

Command operators:
- 201 - add and/or set advertisement data according to the BLE standard, typically chaining small packets in the in the format of `length-type-data`. When called for the first time, will return a bytes buffer, that represents an array of the 16-bit-handles of all characteristics in the order of addition.
- 202 - add and/or set scan response data, according to the BLE standard which is equally to the advertisement data. Should be used sparsely.
- 211 - add and/or set characteristic with value of bytes buffer. For simplicity a `Client Characteristic Configuration Descriptor` (aka 0x2902) will be added on construction of every characteristic and read, write, notification and indication is enabled. You can select write with or without response withe the optional boolean of `BLE.set_chr(string, bool)`, which defaults to "write with no response". The function call will always trigger a *notification*. As every *characteristic* belongs to a *service*, `BLE.set_svc(string)` must have been called before.

Response operators (to client access to the server):
- 221 - on read of a characteristic, returns no buffer data
- 222 - on write of a characteristic, returns the written values as byte buffer data
- 223 - on unsubscribe, returns no buffer data
- 224 - on subscribe to notifications, returns no buffer data
- 225 - on subscribe to indications, returns no buffer data
- 226 - on subscribe to notifications and indications, returns no buffer data
- 227 - on connect, returns MAC of client device as byte buffer
- 228 - on disconnect, returns no buffer data
- 229 - on status, returns error code as byte buffer
####Command op codes:

- 201 - add and/or set advertisement data according to the BLE standard, typically chaining small packets in the in the format of `length-type-data`. When called for the first time, will return a bytes buffer, that represents an array of the 16-bit-handles of all characteristics in the order of addition.
- 202 - add and/or set scan response data, according to the BLE standard which is equally to the advertisement data. Should be used sparsely.
- 211 - add and/or set characteristic with value of bytes buffer. For simplicity a `Client Characteristic Configuration Descriptor` (aka 0x2902) will be added on construction of every characteristic and read, write, notification and indication is enabled. You can select write with or without response withe the optional boolean of `BLE.set_chr(string, bool)`, which defaults to "write with no response". The function call will always trigger a *notification*. As every *characteristic* belongs to a *service*, `BLE.set_svc(string)` must have been called before.

####Response op codes (triggered when a client interacts with the server):

- 221 - on read of a characteristic, returns no buffer data
- 222 - on write of a characteristic, returns the written values as byte buffer data
- 223 - on unsubscribe, returns no buffer data
- 224 - on subscribe to notifications, returns no buffer data
- 225 - on subscribe to indications, returns no buffer data
- 226 - on subscribe to notifications and indications, returns no buffer data
- 227 - on connect, returns MAC of client device as byte buffer
- 228 - on disconnect, returns no buffer data
- 229 - on status, returns error code as byte buffer



Expand Down
Loading

0 comments on commit 2ec9780

Please sign in to comment.