[tacmi] Fix unintended toggleing and add update policy (#10095)

* [tacmi] TA-CMI: Improvements on Schema API Connection

* Removed deprecation warning
* Ensure channels get re-added when removed manually
* Debounce unintended toggeling when status-polling overlaps with new commands.
  Status fetching sometimes takes longer and then it occurs the status page reports still the old/previous value.
  With this change values for things will be ignored when the thing was updated after the start of the page fetch.

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>

* [tacmi] TA-CMI: Schema API Connection: Bugfix: On initialization check if custom channel types still exists and re-create them when needed...

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>

* [tacmi] TA-CMI: Schema API Connection: Improvement: channels now have a 'updatePolicy' configuration parameter to specify the update behaviour

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>

* [tacmi] TA-CMI: Improvements & some initial SI-Units for the COE connection handler

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>

* [tacmi] TA-CMI: only catch URISyntaxException instead of generic Exception

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>
This commit is contained in:
Christian Niessner
2021-04-02 22:15:38 +02:00
committed by GitHub
parent 260d6ba083
commit f8f0d8972b
8 changed files with 203 additions and 48 deletions

View File

@@ -127,10 +127,22 @@ The thing has no channels by default - they have to be added manually matching t
### TA C.M.I. schema API connection
The channels provided by this thing depends on the configuration of the "schema API page".
The channels provided by this thing depend on the configuration of the "schema API page".
All the channels are dynamically created to match it.
Also when the API Page is updated, the channels are also updated during the next refresh.
The channels have a parameter allowing to configure their update behavior:
| Parameter Label | Parameter ID | Description | Accepted values |
|-------------------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| Update Policy | updatePolicy | Update policy for this channel. Default means "On-Change" for channels that can be modified and "On-Change" for read-only channels. | 0 (Default), 1 (On-Fetch), 2 (On-Change) |
The behavior in detail:
* `Default` (`0`): When the channel is 'read-only' the update-policy defaults to _On-Fetch_ . When the channel is linked to something that can be modified it defaults to _On-Change_ .
* `On-Fetch` (`1`): This is the default for read-only values. This means the channel is updated every time the schema page is polled. Ideally for values you want to monitor and log into charts.
* `On-Change` (`2`): When channel values can be changed via OH it is better to only update the channel when the value changes. The binding will cache the previous value and only send an update when it changes to the previous known value. This is especially useful if you intend to link other things (like i.e. ZigBee or Shelly switches) to the TA via OH that can be controlled by different sources. This prevents unintended toggles or even toggle-loops.
### TA C.M.I. CoE Connection
Some comments on the CoE Connection and channel configuration: