From f63dad2eea679ff9464f226998871c815928e920 Mon Sep 17 00:00:00 2001 From: Guy Driesen Date: Sun, 27 Dec 2020 20:35:07 +0100 Subject: [PATCH 1/3] Add dimmer strategy configuration for ubisys D1(-R) --- docs/devices/D1.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/devices/D1.md b/docs/devices/D1.md index 7e5cb64c24659..ae76e3d1ee1f7 100644 --- a/docs/devices/D1.md +++ b/docs/devices/D1.md @@ -41,6 +41,49 @@ By publishing to `zigbee2mqtt/FRIENDLY_NAME/get/ballast_config` the values of th also be read back from the device and be printed to the normal Zigbee2MQTT log (flagged as warnings but only to make sure they do not get suppressed). To account for errors due to missing optional attributes (since this is a general function), every cluster attribute will be queried separately and the complete process can therefore take a moment. +### Dimmer strategy configuration +By publishing to `zigbee2mqtt/FRIENDLY_NAME/set` the dimmer strategy configuration can be set. Supported values for the `mode` attibute are `automatic`, `forward` and `reverse`. +Example: +```json +{ + "ubisys_dimmer_setup": { + "mode": "automatic" + } +} +``` + +By publishing to `zigbee2mqtt/FRIENDLY_NAME/get/ubisys_dimmer_setup` the values of the dimmer strategy configuration attributes can also be read back from the device and be printed to the normal Zigbee2MQTT log (flagged as warnings but only to make sure they do not get suppressed). More information about the meaning of the returned bitmaps can be found in the [ubisys D1 technical reference manual](https://www.smarthome-store.de/media/documents/ubisys-d1-technical-reference.pdf), chapter "7.2.8. Dimmer Setup Cluster (Server)". + +* Capabilities Attribute + +Bit(s) | Description +---|--- +0 | When this bit is set, the dimmer supports AC forward phase control. +1 | When this bit is set, the dimmer supports AC reverse phase control. +2..4 | These bits are reserved for future use and must be written as 0 and ignored when read. +5 | When this bit is set, the dimmer is capable of measuring the reactance of the attached ballast good enough to distinguish inductive and capacitive loads and select the appropriate dimming technique accordingly. +6 | When this bit is set, the dimmer is capable of replacing the built-in, default dimming curve, with a curve that better suits the attached ballast +7 | When this bit is set, the dimmer is capable of detecting an output overload and shutting the output off to prevent damage to the dimmer. + +* Status Attribute + +Bit(s) | Description +---|--- +0 | When this bit is set, the dimmer is currently operating in AC forward phase control mode. +1 | When this bit is set, the dimmer is currently operating in AC reverse phase control. +2 | This bit is reserved for future use and must be written as 0 and ignored when read. +3 | The output is currently turned off, because the dimmer has detected an overload. +4..5 | Reserved for future use. Set to 0 when writing, ignore when reading. +6 | When this bit is set, the dimmer's reactance discriminator had detected a capacitive load +7 | When this bit is set, the dimmer's reactance discriminator had detected an inductive load + +* Mode Attribute + +Bit(s) | Description +---|--- +0..1 | Specifies the mode of operation:
00b: Automatically select the appropriate dimming technique
01b: Always use forward phase control (leading edge, L)
10b: Always use reverse phase control (trailing edge, C/R)
11b: Reserved. Do not use. +2..7 | These bits are reserved for future use. Write as 0, ignore when reading. + ### Device type specific configuration *[How to use device type specific configuration](../information/configuration.md)* From e1a6635030fa282ebc80036b89995c5bfb2251ac Mon Sep 17 00:00:00 2001 From: Guy Driesen Date: Fri, 1 Jan 2021 20:48:12 +0100 Subject: [PATCH 2/3] ubisys D1 doc updated to reflect recent converter changes --- docs/devices/D1.md | 195 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 156 insertions(+), 39 deletions(-) diff --git a/docs/devices/D1.md b/docs/devices/D1.md index ae76e3d1ee1f7..6a86ab0563019 100644 --- a/docs/devices/D1.md +++ b/docs/devices/D1.md @@ -42,47 +42,11 @@ also be read back from the device and be printed to the normal Zigbee2MQTT log ( To account for errors due to missing optional attributes (since this is a general function), every cluster attribute will be queried separately and the complete process can therefore take a moment. ### Dimmer strategy configuration -By publishing to `zigbee2mqtt/FRIENDLY_NAME/set` the dimmer strategy configuration can be set. Supported values for the `mode` attibute are `automatic`, `forward` and `reverse`. -Example: -```json -{ - "ubisys_dimmer_setup": { - "mode": "automatic" - } -} -``` - -By publishing to `zigbee2mqtt/FRIENDLY_NAME/get/ubisys_dimmer_setup` the values of the dimmer strategy configuration attributes can also be read back from the device and be printed to the normal Zigbee2MQTT log (flagged as warnings but only to make sure they do not get suppressed). More information about the meaning of the returned bitmaps can be found in the [ubisys D1 technical reference manual](https://www.smarthome-store.de/media/documents/ubisys-d1-technical-reference.pdf), chapter "7.2.8. Dimmer Setup Cluster (Server)". - -* Capabilities Attribute +The dimmer phase control mode can be changed by publishing `{ "mode_phase_control": "MODE" }` to `zigbee2mqtt/FRIENDLY_NAME/set` where `MODE` is one of the following values: `automatic` (default), `forward` or `reverse`. -Bit(s) | Description ----|--- -0 | When this bit is set, the dimmer supports AC forward phase control. -1 | When this bit is set, the dimmer supports AC reverse phase control. -2..4 | These bits are reserved for future use and must be written as 0 and ignored when read. -5 | When this bit is set, the dimmer is capable of measuring the reactance of the attached ballast good enough to distinguish inductive and capacitive loads and select the appropriate dimming technique accordingly. -6 | When this bit is set, the dimmer is capable of replacing the built-in, default dimming curve, with a curve that better suits the attached ballast -7 | When this bit is set, the dimmer is capable of detecting an output overload and shutting the output off to prevent damage to the dimmer. +A word of caution is in order: configuring the wrong dimmer phase control mode could destory the device or the attached load! -* Status Attribute - -Bit(s) | Description ----|--- -0 | When this bit is set, the dimmer is currently operating in AC forward phase control mode. -1 | When this bit is set, the dimmer is currently operating in AC reverse phase control. -2 | This bit is reserved for future use and must be written as 0 and ignored when read. -3 | The output is currently turned off, because the dimmer has detected an overload. -4..5 | Reserved for future use. Set to 0 when writing, ignore when reading. -6 | When this bit is set, the dimmer's reactance discriminator had detected a capacitive load -7 | When this bit is set, the dimmer's reactance discriminator had detected an inductive load - -* Mode Attribute - -Bit(s) | Description ----|--- -0..1 | Specifies the mode of operation:
00b: Automatically select the appropriate dimming technique
01b: Always use forward phase control (leading edge, L)
10b: Always use reverse phase control (trailing edge, C/R)
11b: Reserved. Do not use. -2..7 | These bits are reserved for future use. Write as 0, ignore when reading. +More information can be found in the [ubisys D1 technical reference manual](https://www.smarthome-store.de/media/documents/ubisys-d1-technical-reference.pdf), chapter "7.2.8. Dimmer Setup Cluster (Server)". ### Device type specific configuration *[How to use device type specific configuration](../information/configuration.md)* @@ -135,6 +99,73 @@ It's not possible to read (`/get`) or write (`/set`) this value. The minimimal value is `0` and the maximum value is `255`. The unit of this value is `lqi`. +### Dimmer Capabilities: Forward phase control (binary) + +Indicates if the dimmer supports AC forward phase control. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_forward_phase_control": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Capabilities: Reverse phase control (binary) + +Indicates if the dimmer supports AC reverse phase control. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_reverse_phase_control": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Capabilities: Reactance discriminator (binary) + +Indicates if the dimmer is capable of measuring the reactanceto distinguish inductive and capacitive loads. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_reactance_discriminator": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Capabilities: Configurable curve (binary) + +Indicates if the dimmer is capable of replacing the built-in, default dimming curve. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_configurable_curve": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Capabilities: Overload detection (binary) + +Indicates if the dimmer is capable of detecting an output overload and shutting the output off. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_overload_detection": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Status: Forward phase control (binary) + +Indicates that the dimmer is currently operating in AC forward phase control mode. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_forward_phase_control": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Status: Reverse phase control (binary) + +Indicates that the dimmer is currently operating in AC reverse phase control mode. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_reverse_phase_control": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Status: Overload (binary) + +Indicates that the output is currently turned off, because the dimmer has detected an overload. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_overload": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Status: Capacitive load (binary) + +Indicates that the dimmer's reactance discriminator had detected a capacitive load. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_capacitive_load": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Status: Inductive load (binary) + +Indicates that the dimmer's reactance discriminator had detected an inductive load. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_inductive_load": ""}`. +It's not possible to write (`/set`) this value. + +### Dimmer Mode: Phase control (enum) + +Configures the dimming technique. +To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"mode_phase_control": ""}`. +To write (`/set`) a value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/set` with payload `{"mode_phase_control": NEW_VALUE}`. +The possible values are: `automatic`, `forward` and `reverse`. + ## Manual Home Assistant configuration Although Home Assistant integration through [MQTT discovery](../integration/home_assistant) is preferred, manual integration is possible with the following configuration: @@ -177,6 +208,92 @@ binary_sensor: payload_on: true payload_off: false value_template: "{{ value_json.update_available}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.capabilities_forward_phase_control}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.capabilities_reverse_phase_control}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.capabilities_reactance_discriminator}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.capabilities_configurable_curve}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.capabilities_overload_detection}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.status_forward_phase_control}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.status_reverse_phase_control}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.status_overload}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.status_capacitive_load}}" + +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.status_inductive_load}}" + +sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + value_template: "{{ value_json.mode_phase_control }}" ``` {% endraw %} From b30558be4334294bd0cc025ed66ab9caf41f1609 Mon Sep 17 00:00:00 2001 From: Guy Driesen Date: Sat, 2 Jan 2021 20:32:29 +0100 Subject: [PATCH 3/3] Removed duplicates after merge --- docs/devices/D1.md | 153 --------------------------------------------- 1 file changed, 153 deletions(-) diff --git a/docs/devices/D1.md b/docs/devices/D1.md index 94feefc63cde5..b6430bb384a87 100644 --- a/docs/devices/D1.md +++ b/docs/devices/D1.md @@ -190,73 +190,6 @@ It's not possible to read (`/get`) or write (`/set`) this value. The minimal value is `0` and the maximum value is `255`. The unit of this value is `lqi`. -### Dimmer Capabilities: Forward phase control (binary) - -Indicates if the dimmer supports AC forward phase control. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_forward_phase_control": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Capabilities: Reverse phase control (binary) - -Indicates if the dimmer supports AC reverse phase control. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_reverse_phase_control": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Capabilities: Reactance discriminator (binary) - -Indicates if the dimmer is capable of measuring the reactanceto distinguish inductive and capacitive loads. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_reactance_discriminator": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Capabilities: Configurable curve (binary) - -Indicates if the dimmer is capable of replacing the built-in, default dimming curve. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_configurable_curve": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Capabilities: Overload detection (binary) - -Indicates if the dimmer is capable of detecting an output overload and shutting the output off. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"capabilities_overload_detection": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Status: Forward phase control (binary) - -Indicates that the dimmer is currently operating in AC forward phase control mode. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_forward_phase_control": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Status: Reverse phase control (binary) - -Indicates that the dimmer is currently operating in AC reverse phase control mode. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_reverse_phase_control": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Status: Overload (binary) - -Indicates that the output is currently turned off, because the dimmer has detected an overload. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_overload": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Status: Capacitive load (binary) - -Indicates that the dimmer's reactance discriminator had detected a capacitive load. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_capacitive_load": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Status: Inductive load (binary) - -Indicates that the dimmer's reactance discriminator had detected an inductive load. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"status_inductive_load": ""}`. -It's not possible to write (`/set`) this value. - -### Dimmer Mode: Phase control (enum) - -Configures the dimming technique. -To read (`/get`) the value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"mode_phase_control": ""}`. -To write (`/set`) a value publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/set` with payload `{"mode_phase_control": NEW_VALUE}`. -The possible values are: `automatic`, `forward` and `reverse`. - ## Manual Home Assistant configuration Although Home Assistant integration through [MQTT discovery](../integration/home_assistant) is preferred, manual integration is possible with the following configuration: @@ -392,92 +325,6 @@ binary_sensor: payload_on: true payload_off: false value_template: "{{ value_json.update_available}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.capabilities_forward_phase_control}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.capabilities_reverse_phase_control}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.capabilities_reactance_discriminator}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.capabilities_configurable_curve}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.capabilities_overload_detection}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.status_forward_phase_control}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.status_reverse_phase_control}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.status_overload}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.status_capacitive_load}}" - -binary_sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.status_inductive_load}}" - -sensor: - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - value_template: "{{ value_json.mode_phase_control }}" ``` {% endraw %}