From 7ceeb2961a216236c33cdae9b8a0dc82817728be Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Wed, 18 Oct 2017 18:07:16 +0200 Subject: [PATCH 1/9] add ads hub and switch --- source/_components/ads.markdown | 31 ++++++++++++++++++++++++++ source/_components/switch.ads.markdown | 31 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 source/_components/ads.markdown create mode 100644 source/_components/switch.ads.markdown diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown new file mode 100644 index 000000000000..2ac31a98261a --- /dev/null +++ b/source/_components/ads.markdown @@ -0,0 +1,31 @@ +--- +layout: page +title: "ADS" +description: "Connect Home Assistant to TwinCAT devices via the ADS interface." +date: 2016-05-25 23:39 +sidebar: true +comments: false +sharing: true +footer: true +ha_category: Hub +ha_release: 0.21 +ha_iot_class: "Local Push" +--- + +The ADS (automation device specification) describes a device-independent and +fieldbus-independent interface for communication between Beckhoff® automation +devices running TwinCAT® and other devices implementing this interface. + +Configuration variables: + +- **device** (*Required*): The AMS NetId that identifies the device. +- **port** (*Required*): The port that runs the AMS server on the device. +- **ip_address** (*Optional*): The IP-Address to which the Ams NetId is routed. +If None is given the first 4 bytes of the device id will be used. + +```yaml +# Example configuration.yaml entry +ads: + device: '127.0.0.1.1.1' + port: 48898 +``` \ No newline at end of file diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown new file mode 100644 index 000000000000..00b7d8027766 --- /dev/null +++ b/source/_components/switch.ads.markdown @@ -0,0 +1,31 @@ +--- +layout: page +title: "ADS Switch" +description: "Instructions on how to set up ADS switches within Home Assistant." +date: 2016-05-25 23:49 +sidebar: true +comments: false +sharing: true +footer: true +ha_category: Switch +ha_release: 0.21 +ha_iot_class: "Local Push" +--- + +An ADS switch accesses a boolean variable of the connected ADS device. + +To use your ADS device, you first have to set up your [ADS +hub](/components/ads/) and then add the following to your `configuration.yaml` +file: + +```yaml +# Example configuration.yaml entry +switch: + - platform: ads + adsvar: .global_bool +``` + +Configuration variables: + +- **adsvar** (*Required*): The name of the variable which you want to access on +the ADS device. \ No newline at end of file From 8f78982eb4bd9e6c120d1407734a8e3102ffe95f Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Wed, 18 Oct 2017 18:28:25 +0200 Subject: [PATCH 2/9] add ads binary sensor --- source/_components/binary_sensor.ads.markdown | 51 +++++++++++++++++++ source/_components/switch.ads.markdown | 3 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 source/_components/binary_sensor.ads.markdown diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown new file mode 100644 index 000000000000..7e7e2abb82c4 --- /dev/null +++ b/source/_components/binary_sensor.ads.markdown @@ -0,0 +1,51 @@ +--- +layout: page +title: "ADS Binary Sensor" +description: "Instructions on how to set up ADS binary sensors within Home Assistant." +date: 2017-10-18 10:30 +sidebar: true +comments: false +sharing: true +footer: true +ha_category: Binary Sensor +ha_release: 0.21 +ha_iot_class: "Local Push" +--- + +The binary sensor can be used to monitor a boolean value on your ADS device. + +To use your ADS device, you first have to set up your [ADS +hub](/components/ads/) and then add the following to your `configuration.yaml` +file: + +```yaml +# Example configuration.yaml entry +binary_sensor: + - platform: ads + adsvar: .boolean1 +``` + +If you want to disable device notifications and use regular polling instead use +the following configuration: + +```yaml +# Example configuration.yaml entry +binary_sensor: + - platforms: ads + adsvar: GVL.polled_boolean + use_notify: no + poll_interval: 5000 +``` + +Configuration variables: +- **adsvar** (*Required*): The name of the variable which you want to access on +the ADS device. +- **name** (*Optional*): An identifier for the switch in the frontend. +- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. +- **use_notify** (*Optional*): Enable device notifications. Default: yes. +- **poll_interval** (*Optional*): If device notifications are disabled polling +is used. This parameter defines the pollint interval in milliseconds. Defaults +to 1000. + +If *device notifications* are enabled the *ADS* device will push a change +directly to Home Assistant. Otherwise the value will be polled regularly. \ No newline at end of file diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown index 00b7d8027766..45381efab34d 100644 --- a/source/_components/switch.ads.markdown +++ b/source/_components/switch.ads.markdown @@ -12,7 +12,8 @@ ha_release: 0.21 ha_iot_class: "Local Push" --- -An ADS switch accesses a boolean variable of the connected ADS device. +An ADS switch accesses a boolean variable on the connected ADS device. The +variable is identified by its name. To use your ADS device, you first have to set up your [ADS hub](/components/ads/) and then add the following to your `configuration.yaml` From 0439a7ce4bf0fe8b4625cc3a85af4d7816c6098a Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Wed, 18 Oct 2017 18:56:27 +0200 Subject: [PATCH 3/9] add ADS sensor --- source/_components/sensor.ads.markdown | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source/_components/sensor.ads.markdown diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown new file mode 100644 index 000000000000..4f46e876b7b9 --- /dev/null +++ b/source/_components/sensor.ads.markdown @@ -0,0 +1,49 @@ +--- +layout: page +title: "ADS Sensor" +description: "Instructions how to integrate ADS numeric values into Home Assistant." +date: 2017-10-18 12:00 +sidebar: true +comments: false +sharing: true +footer: true +ha_category: Sensor +ha_release: 0.21 +ha_iot_class: "Local Push" +--- + +The `ADS` sensor platform allows reading the value of a numeric variable on +your ADS device. The variable can be of type *INT*, *UINT* or *BYTE*. + +To use your ADS device, you first have to set up your [ADS +hub](/components/ads/) and then add the following to your `configuration.yaml` +file: + +```yaml +# Example configuration.yaml entry +sensor: + - platform: ads + adsvar: GVL.temperature + unit_of_measurement: '°C' + adstype: int +``` + +Configuration variables: + +- **adsvar** (*Required*): The name of the variable which you want to access on +- **adstype** (*Optional*): The datatype of the ADS variable. Default: *int*. +Possible values are: *int, uint, byte*. +- **name** (*Optional*): An identifier for the sensor +- **use_notify** (*Optional*): Enable device notifications. Default: yes. +- **poll_interval** (*Optional*): If device notifications are disabled polling +is used. This parameter defines the pollint interval in milliseconds. Defaults +to 1000. +- **factor** (*Optional*): Use a factor that divides the stored value before +displaying in Home Assistant. Default: 1. + +If *device notifications* are enabled the *ADS* device will push a change +directly to Home Assistant. Otherwise the value will be polled regularly. + +The *factor* can be used to implement fixed decimals. E.g. set *factor* to 100 +if you want to display a fixed decimal value with two decimals. A variable +value of `123` will be displayed as `1.23`. \ No newline at end of file From ca1229621e73f189d33dd360e3091541b1981de1 Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Mon, 20 Nov 2017 20:10:35 +0100 Subject: [PATCH 4/9] fix version numbers --- source/_components/ads.markdown | 39 +++++++++++++++++-- source/_components/binary_sensor.ads.markdown | 13 ++++--- source/_components/light.ads.markdown | 36 +++++++++++++++++ source/_components/sensor.ads.markdown | 18 +++++---- source/_components/switch.ads.markdown | 9 +++-- 5 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 source/_components/light.ads.markdown diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown index 2ac31a98261a..338d24c9c188 100644 --- a/source/_components/ads.markdown +++ b/source/_components/ads.markdown @@ -7,8 +7,9 @@ sidebar: true comments: false sharing: true footer: true +logo: home-assistant.png ha_category: Hub -ha_release: 0.21 +ha_release: 0.59 ha_iot_class: "Local Push" --- @@ -16,16 +17,48 @@ The ADS (automation device specification) describes a device-independent and fieldbus-independent interface for communication between Beckhoff® automation devices running TwinCAT® and other devices implementing this interface. -Configuration variables: +Configuration parameters: +{% configuration %} - **device** (*Required*): The AMS NetId that identifies the device. - **port** (*Required*): The port that runs the AMS server on the device. - **ip_address** (*Optional*): The IP-Address to which the Ams NetId is routed. If None is given the first 4 bytes of the device id will be used. +- **use_notify** (*Optional*): If this parameter is set to *True* all platforms +will get push notifications on variable changes. If set to *False* polling will +be used. The poll interval can be changed by the **poll_interval** parameter. +Default: *True* +- **poll_interval** (*Optional*): Sets the polling interval in milliseconds. +Only used if *use_notify* is *False*. Default: 1000 +{% endconfiguration %} + ```yaml # Example configuration.yaml entry ads: device: '127.0.0.1.1.1' port: 48898 -``` \ No newline at end of file +``` + +## Service + +The ADS component will register the service `write_by_name` allowing you to +write a value to a variable on your ADS device. + +```json +{ + "adsvar": ".myvariable", + "adstype": "int", + "value": 123 +} +``` + +Service parameters: + +- **adsvar**: name of the variable on the ADS device. To access global variables +on *TwinCAT2* use a prepending dot `.myvariable`, for TwinCAT3 use +`GBL.myvariable` +- **adstype**: specify the type of the variable. Use one of the following: +`int`, `byte`, `uint`, `bool` +- **value**: the value that will be written in the variable + diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown index 7e7e2abb82c4..8d6d834cfdfd 100644 --- a/source/_components/binary_sensor.ads.markdown +++ b/source/_components/binary_sensor.ads.markdown @@ -2,13 +2,14 @@ layout: page title: "ADS Binary Sensor" description: "Instructions on how to set up ADS binary sensors within Home Assistant." -date: 2017-10-18 10:30 +date: 2017-10-25 10:00 sidebar: true comments: false sharing: true footer: true +logo: home-assistant.png ha_category: Binary Sensor -ha_release: 0.21 +ha_release: 0.59 ha_iot_class: "Local Push" --- @@ -38,14 +39,16 @@ binary_sensor: ``` Configuration variables: + +{% configuration %} - **adsvar** (*Required*): The name of the variable which you want to access on the ADS device. - **name** (*Optional*): An identifier for the switch in the frontend. - **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **use_notify** (*Optional*): Enable device notifications. Default: yes. - **poll_interval** (*Optional*): If device notifications are disabled polling -is used. This parameter defines the pollint interval in milliseconds. Defaults to 1000. +{% endconfiguration %} -If *device notifications* are enabled the *ADS* device will push a change -directly to Home Assistant. Otherwise the value will be polled regularly. \ No newline at end of file +If *device notifications* are enabled, the *ADS* device will push a change +directly to Home Assistant. Otherwise, the value will be polled regularly. diff --git a/source/_components/light.ads.markdown b/source/_components/light.ads.markdown new file mode 100644 index 000000000000..dcadce38c909 --- /dev/null +++ b/source/_components/light.ads.markdown @@ -0,0 +1,36 @@ +--- +layout: page +title: "ADS Light" +description: "Instruction on how to set up ADS lights within Home Assistant." +date: 2017-10-25 10:00 +sidebar: true +comments: false +sharing: true +footer: true +logo: home-assistant.png +ha_category: Light +ha_release: 0.59 +ha_iot_class: "Local Push" +--- + +To use your ADS device, you first have to set up your [ADS +hub](/components/ads/) and then add the following to your `configuration.yaml` +file: + +```yaml +# Example configuration.yaml entry +light: + - platform: ads + adsvar: GVL.enable_light + adsvar_brightness: GVL.brightness +``` + +Configuration variables: + +{% configuration %} +- **adsvar** (*Required*): The name of the boolean variable that switches the +light on. +- **adsvar_brightness** (*Optional*): The name of the variable that controls the +brightness. This variable needs to be of type *UINT*. +- **name** (*Optional*): An identifier for the Light in the frontend. +{% endconfiguration %} \ No newline at end of file diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index 4f46e876b7b9..8e4766cf79ac 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -2,13 +2,14 @@ layout: page title: "ADS Sensor" description: "Instructions how to integrate ADS numeric values into Home Assistant." -date: 2017-10-18 12:00 +date: 2017-10-25 10:00 sidebar: true comments: false sharing: true footer: true +logo: home-assistant.png ha_category: Sensor -ha_release: 0.21 +ha_release: 0.59 ha_iot_class: "Local Push" --- @@ -30,20 +31,21 @@ sensor: Configuration variables: +{% configuration %} - **adsvar** (*Required*): The name of the variable which you want to access on - **adstype** (*Optional*): The datatype of the ADS variable. Default: *int*. Possible values are: *int, uint, byte*. - **name** (*Optional*): An identifier for the sensor - **use_notify** (*Optional*): Enable device notifications. Default: yes. -- **poll_interval** (*Optional*): If device notifications are disabled polling -is used. This parameter defines the pollint interval in milliseconds. Defaults -to 1000. +- **poll_interval** (*Optional*): Sets the polling interval in milliseconds. +Only used if *use_notify* is *False*. Default: 1000 - **factor** (*Optional*): Use a factor that divides the stored value before displaying in Home Assistant. Default: 1. +{% endconfiguration %} -If *device notifications* are enabled the *ADS* device will push a change -directly to Home Assistant. Otherwise the value will be polled regularly. +If *device notifications* are enabled, the *ADS* device will push a change +directly to Home Assistant. Otherwise, the value will be polled regularly. -The *factor* can be used to implement fixed decimals. E.g. set *factor* to 100 +The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 if you want to display a fixed decimal value with two decimals. A variable value of `123` will be displayed as `1.23`. \ No newline at end of file diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown index 45381efab34d..78fe7325df7a 100644 --- a/source/_components/switch.ads.markdown +++ b/source/_components/switch.ads.markdown @@ -2,13 +2,14 @@ layout: page title: "ADS Switch" description: "Instructions on how to set up ADS switches within Home Assistant." -date: 2016-05-25 23:49 +date: 2017-10-25 10:00 sidebar: true comments: false sharing: true footer: true +logo: home-assistant.png ha_category: Switch -ha_release: 0.21 +ha_release: 0.59 ha_iot_class: "Local Push" --- @@ -28,5 +29,7 @@ switch: Configuration variables: +{% configuration %} - **adsvar** (*Required*): The name of the variable which you want to access on -the ADS device. \ No newline at end of file +the ADS device. +{% endconfiguration %} \ No newline at end of file From 349d03dcfd96ee8bf6b6e23618c3475981ebde4d Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Mon, 20 Nov 2017 20:21:55 +0100 Subject: [PATCH 5/9] separate configuration tag --- source/_components/ads.markdown | 2 ++ source/_components/binary_sensor.ads.markdown | 2 ++ source/_components/light.ads.markdown | 2 ++ source/_components/sensor.ads.markdown | 2 ++ 4 files changed, 8 insertions(+) diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown index 338d24c9c188..29e2952b7dbb 100644 --- a/source/_components/ads.markdown +++ b/source/_components/ads.markdown @@ -20,6 +20,7 @@ devices running TwinCAT® and other devices implementing this interface. Configuration parameters: {% configuration %} + - **device** (*Required*): The AMS NetId that identifies the device. - **port** (*Required*): The port that runs the AMS server on the device. - **ip_address** (*Optional*): The IP-Address to which the Ams NetId is routed. @@ -30,6 +31,7 @@ be used. The poll interval can be changed by the **poll_interval** parameter. Default: *True* - **poll_interval** (*Optional*): Sets the polling interval in milliseconds. Only used if *use_notify* is *False*. Default: 1000 + {% endconfiguration %} diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown index 8d6d834cfdfd..6e2ecf2f6a29 100644 --- a/source/_components/binary_sensor.ads.markdown +++ b/source/_components/binary_sensor.ads.markdown @@ -41,6 +41,7 @@ binary_sensor: Configuration variables: {% configuration %} + - **adsvar** (*Required*): The name of the variable which you want to access on the ADS device. - **name** (*Optional*): An identifier for the switch in the frontend. @@ -48,6 +49,7 @@ the ADS device. - **use_notify** (*Optional*): Enable device notifications. Default: yes. - **poll_interval** (*Optional*): If device notifications are disabled polling to 1000. + {% endconfiguration %} If *device notifications* are enabled, the *ADS* device will push a change diff --git a/source/_components/light.ads.markdown b/source/_components/light.ads.markdown index dcadce38c909..afac3fc98a15 100644 --- a/source/_components/light.ads.markdown +++ b/source/_components/light.ads.markdown @@ -28,9 +28,11 @@ light: Configuration variables: {% configuration %} + - **adsvar** (*Required*): The name of the boolean variable that switches the light on. - **adsvar_brightness** (*Optional*): The name of the variable that controls the brightness. This variable needs to be of type *UINT*. - **name** (*Optional*): An identifier for the Light in the frontend. + {% endconfiguration %} \ No newline at end of file diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index 8e4766cf79ac..4bd1452ff1d7 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -32,6 +32,7 @@ sensor: Configuration variables: {% configuration %} + - **adsvar** (*Required*): The name of the variable which you want to access on - **adstype** (*Optional*): The datatype of the ADS variable. Default: *int*. Possible values are: *int, uint, byte*. @@ -41,6 +42,7 @@ Possible values are: *int, uint, byte*. Only used if *use_notify* is *False*. Default: 1000 - **factor** (*Optional*): Use a factor that divides the stored value before displaying in Home Assistant. Default: 1. + {% endconfiguration %} If *device notifications* are enabled, the *ADS* device will push a change From 81e3a3528afdf1f1c4c3557b1f340dfd02a7c066 Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Fri, 1 Dec 2017 17:17:55 +0100 Subject: [PATCH 6/9] remove device notification config --- source/_components/ads.markdown | 6 ------ source/_components/binary_sensor.ads.markdown | 17 ----------------- source/_components/sensor.ads.markdown | 5 ----- 3 files changed, 28 deletions(-) diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown index 29e2952b7dbb..2c25964561dc 100644 --- a/source/_components/ads.markdown +++ b/source/_components/ads.markdown @@ -25,12 +25,6 @@ Configuration parameters: - **port** (*Required*): The port that runs the AMS server on the device. - **ip_address** (*Optional*): The IP-Address to which the Ams NetId is routed. If None is given the first 4 bytes of the device id will be used. -- **use_notify** (*Optional*): If this parameter is set to *True* all platforms -will get push notifications on variable changes. If set to *False* polling will -be used. The poll interval can be changed by the **poll_interval** parameter. -Default: *True* -- **poll_interval** (*Optional*): Sets the polling interval in milliseconds. -Only used if *use_notify* is *False*. Default: 1000 {% endconfiguration %} diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown index 6e2ecf2f6a29..ee0c7e03f201 100644 --- a/source/_components/binary_sensor.ads.markdown +++ b/source/_components/binary_sensor.ads.markdown @@ -26,18 +26,6 @@ binary_sensor: adsvar: .boolean1 ``` -If you want to disable device notifications and use regular polling instead use -the following configuration: - -```yaml -# Example configuration.yaml entry -binary_sensor: - - platforms: ads - adsvar: GVL.polled_boolean - use_notify: no - poll_interval: 5000 -``` - Configuration variables: {% configuration %} @@ -46,11 +34,6 @@ Configuration variables: the ADS device. - **name** (*Optional*): An identifier for the switch in the frontend. - **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. -- **use_notify** (*Optional*): Enable device notifications. Default: yes. -- **poll_interval** (*Optional*): If device notifications are disabled polling to 1000. {% endconfiguration %} - -If *device notifications* are enabled, the *ADS* device will push a change -directly to Home Assistant. Otherwise, the value will be polled regularly. diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index 4bd1452ff1d7..91ed8a966117 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -37,17 +37,12 @@ Configuration variables: - **adstype** (*Optional*): The datatype of the ADS variable. Default: *int*. Possible values are: *int, uint, byte*. - **name** (*Optional*): An identifier for the sensor -- **use_notify** (*Optional*): Enable device notifications. Default: yes. -- **poll_interval** (*Optional*): Sets the polling interval in milliseconds. Only used if *use_notify* is *False*. Default: 1000 - **factor** (*Optional*): Use a factor that divides the stored value before displaying in Home Assistant. Default: 1. {% endconfiguration %} -If *device notifications* are enabled, the *ADS* device will push a change -directly to Home Assistant. Otherwise, the value will be polled regularly. - The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 if you want to display a fixed decimal value with two decimals. A variable value of `123` will be displayed as `1.23`. \ No newline at end of file From ddf1193530bbc864e7ed5f45cce67c85bf70cf98 Mon Sep 17 00:00:00 2001 From: "stefan.st.lehmann" Date: Tue, 5 Dec 2017 07:15:16 -0500 Subject: [PATCH 7/9] fix configuration schema. --- source/_components/ads.markdown | 20 +++++++++------ source/_components/binary_sensor.ads.markdown | 21 ++++++++++------ source/_components/light.ads.markdown | 21 ++++++++++------ source/_components/sensor.ads.markdown | 25 +++++++++++-------- source/_components/switch.ads.markdown | 8 +++--- 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown index 2c25964561dc..d34f075dc850 100644 --- a/source/_components/ads.markdown +++ b/source/_components/ads.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: home-assistant.png ha_category: Hub -ha_release: 0.59 +ha_release: 0.60 ha_iot_class: "Local Push" --- @@ -20,12 +20,18 @@ devices running TwinCAT® and other devices implementing this interface. Configuration parameters: {% configuration %} - -- **device** (*Required*): The AMS NetId that identifies the device. -- **port** (*Required*): The port that runs the AMS server on the device. -- **ip_address** (*Optional*): The IP-Address to which the Ams NetId is routed. -If None is given the first 4 bytes of the device id will be used. - + device: + required: true + description: The AMS NetId that identifies the device + type: string + port: + required: true + description: The port that runs the AMS server on the device + type: integer + ip_address: + required: false + description: The IP-Address of the ADS device (if not set the first 4 bytes of the device id will be used) + type: string {% endconfiguration %} diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown index ee0c7e03f201..c8263b418886 100644 --- a/source/_components/binary_sensor.ads.markdown +++ b/source/_components/binary_sensor.ads.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: home-assistant.png ha_category: Binary Sensor -ha_release: 0.59 +ha_release: 0.60 ha_iot_class: "Local Push" --- @@ -29,11 +29,16 @@ binary_sensor: Configuration variables: {% configuration %} - -- **adsvar** (*Required*): The name of the variable which you want to access on -the ADS device. -- **name** (*Optional*): An identifier for the switch in the frontend. -- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. -to 1000. - + adsvar: + required: true + description: The name of the variable which you want to access on the ADS device + type: string + name: + required: false + description: An identifier for the switch in the frontend + type: string + device_class: + required: false + description: The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend + type: string {% endconfiguration %} diff --git a/source/_components/light.ads.markdown b/source/_components/light.ads.markdown index afac3fc98a15..13c907694b5c 100644 --- a/source/_components/light.ads.markdown +++ b/source/_components/light.ads.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: home-assistant.png ha_category: Light -ha_release: 0.59 +ha_release: 0.60 ha_iot_class: "Local Push" --- @@ -28,11 +28,16 @@ light: Configuration variables: {% configuration %} - -- **adsvar** (*Required*): The name of the boolean variable that switches the -light on. -- **adsvar_brightness** (*Optional*): The name of the variable that controls the -brightness. This variable needs to be of type *UINT*. -- **name** (*Optional*): An identifier for the Light in the frontend. - + adsvar: + required: true + description: The name of the boolean variable that switches the light on + type: string + adsvar_brightness: + required: false + description: The name of the variable that controls the brightness (Use an unsigned integer on the PLC side) + type: integer + name: + required: false + description: An identifier for the Light in the frontend + type: string {% endconfiguration %} \ No newline at end of file diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index 91ed8a966117..ffd04eeb56ee 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: home-assistant.png ha_category: Sensor -ha_release: 0.59 +ha_release: 0.60 ha_iot_class: "Local Push" --- @@ -32,15 +32,20 @@ sensor: Configuration variables: {% configuration %} - -- **adsvar** (*Required*): The name of the variable which you want to access on -- **adstype** (*Optional*): The datatype of the ADS variable. Default: *int*. -Possible values are: *int, uint, byte*. -- **name** (*Optional*): An identifier for the sensor -Only used if *use_notify* is *False*. Default: 1000 -- **factor** (*Optional*): Use a factor that divides the stored value before -displaying in Home Assistant. Default: 1. - + adsvar: + required: true + description: The name of the variable which you want to access + type: string + adstype: + required: false + description: The datatype of the ADS variable (possible values are int, uint, byte; default: int) + type: string + name: + required: false + description: An identifier for the sensor + factor: + required: false + description: A factor that divides the stored value before displaying in Home Assistant (default: 1) {% endconfiguration %} The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown index 78fe7325df7a..3bb10c26d3a5 100644 --- a/source/_components/switch.ads.markdown +++ b/source/_components/switch.ads.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: home-assistant.png ha_category: Switch -ha_release: 0.59 +ha_release: 0.60 ha_iot_class: "Local Push" --- @@ -26,10 +26,10 @@ switch: - platform: ads adsvar: .global_bool ``` - Configuration variables: {% configuration %} -- **adsvar** (*Required*): The name of the variable which you want to access on -the ADS device. + adsvar: + required: true + description: The name of the variable which you want to access on the ADS device {% endconfiguration %} \ No newline at end of file From 119b2ccf055daef2b908fd26ac5c3c4d65e9aec5 Mon Sep 17 00:00:00 2001 From: "stefan.st.lehmann" Date: Tue, 5 Dec 2017 08:12:52 -0500 Subject: [PATCH 8/9] replace tabs with spaces --- source/_components/ads.markdown | 17 ++++++++--------- source/_components/binary_sensor.ads.markdown | 4 ++-- source/_components/light.ads.markdown | 4 ++-- source/_components/sensor.ads.markdown | 12 +++++++----- source/_components/switch.ads.markdown | 4 ++++ 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/source/_components/ads.markdown b/source/_components/ads.markdown index d34f075dc850..f24715471ce3 100644 --- a/source/_components/ads.markdown +++ b/source/_components/ads.markdown @@ -1,8 +1,8 @@ --- layout: page title: "ADS" -description: "Connect Home Assistant to TwinCAT devices via the ADS interface." -date: 2016-05-25 23:39 +description: Connect Home Assistant to TwinCAT devices via the ADS interface +date: 2017-12-05 12:00 sidebar: true comments: false sharing: true @@ -20,17 +20,17 @@ devices running TwinCAT® and other devices implementing this interface. Configuration parameters: {% configuration %} - device: - required: true + device: + required: true description: The AMS NetId that identifies the device type: string port: - required: true - description: The port that runs the AMS server on the device + required: true + description: The port that runs the AMS server on the device, typically this would be 801 or 851 type: integer ip_address: - required: false - description: The IP-Address of the ADS device (if not set the first 4 bytes of the device id will be used) + required: false + description: The IP-Address of the ADS device, if not set the first 4 bytes of the device id will be used type: string {% endconfiguration %} @@ -63,4 +63,3 @@ on *TwinCAT2* use a prepending dot `.myvariable`, for TwinCAT3 use - **adstype**: specify the type of the variable. Use one of the following: `int`, `byte`, `uint`, `bool` - **value**: the value that will be written in the variable - diff --git a/source/_components/binary_sensor.ads.markdown b/source/_components/binary_sensor.ads.markdown index c8263b418886..a76adbfbcd94 100644 --- a/source/_components/binary_sensor.ads.markdown +++ b/source/_components/binary_sensor.ads.markdown @@ -29,13 +29,13 @@ binary_sensor: Configuration variables: {% configuration %} - adsvar: + adsvar: required: true description: The name of the variable which you want to access on the ADS device type: string name: required: false - description: An identifier for the switch in the frontend + description: An identifier for the light in the frontend type: string device_class: required: false diff --git a/source/_components/light.ads.markdown b/source/_components/light.ads.markdown index 13c907694b5c..6a46c5627477 100644 --- a/source/_components/light.ads.markdown +++ b/source/_components/light.ads.markdown @@ -1,7 +1,7 @@ --- layout: page title: "ADS Light" -description: "Instruction on how to set up ADS lights within Home Assistant." +description: Instructions how to set up ADS lights within Home Assistant date: 2017-10-25 10:00 sidebar: true comments: false @@ -34,7 +34,7 @@ Configuration variables: type: string adsvar_brightness: required: false - description: The name of the variable that controls the brightness (Use an unsigned integer on the PLC side) + description: The name of the variable that controls the brightness, use an unsigned integer on the PLC side type: integer name: required: false diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index ffd04eeb56ee..4c17cb640045 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -38,16 +38,18 @@ Configuration variables: type: string adstype: required: false - description: The datatype of the ADS variable (possible values are int, uint, byte; default: int) + description: The datatype of the ADS variable, possible values are int, uint, byte + default: int type: string name: - required: false + required: false description: An identifier for the sensor factor: - required: false - description: A factor that divides the stored value before displaying in Home Assistant (default: 1) + required: false + description: A factor that divides the stored value before displaying in Home Assistant + default: 1 {% endconfiguration %} -The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 +The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 if you want to display a fixed decimal value with two decimals. A variable value of `123` will be displayed as `1.23`. \ No newline at end of file diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown index 3bb10c26d3a5..7c31a0dec8ba 100644 --- a/source/_components/switch.ads.markdown +++ b/source/_components/switch.ads.markdown @@ -32,4 +32,8 @@ Configuration variables: adsvar: required: true description: The name of the variable which you want to access on the ADS device + name: + required: false + description: An identifier for the switch in the frontend + type: string {% endconfiguration %} \ No newline at end of file From d931b349510ba372f8a7bf8a094294ace9e6ffb1 Mon Sep 17 00:00:00 2001 From: "stefan.st.lehmann" Date: Tue, 5 Dec 2017 11:06:24 -0500 Subject: [PATCH 9/9] add type key-value-pairs --- source/_components/sensor.ads.markdown | 2 ++ source/_components/switch.ads.markdown | 1 + 2 files changed, 3 insertions(+) diff --git a/source/_components/sensor.ads.markdown b/source/_components/sensor.ads.markdown index 4c17cb640045..e7a960b6777c 100644 --- a/source/_components/sensor.ads.markdown +++ b/source/_components/sensor.ads.markdown @@ -44,10 +44,12 @@ Configuration variables: name: required: false description: An identifier for the sensor + type: string factor: required: false description: A factor that divides the stored value before displaying in Home Assistant default: 1 + type: integer {% endconfiguration %} The *factor* can be used to implement fixed decimals. E.g., set *factor* to 100 diff --git a/source/_components/switch.ads.markdown b/source/_components/switch.ads.markdown index 7c31a0dec8ba..0053a28734fc 100644 --- a/source/_components/switch.ads.markdown +++ b/source/_components/switch.ads.markdown @@ -32,6 +32,7 @@ Configuration variables: adsvar: required: true description: The name of the variable which you want to access on the ADS device + type: string name: required: false description: An identifier for the switch in the frontend