-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ads #4115
Merged
Merged
Ads #4115
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7ceeb29
add ads hub and switch
8f78982
add ads binary sensor
0439a7c
add ADS sensor
d7ffccd
Merge remote-tracking branch 'upstream/next' into next
9a08219
Merge branch 'next' of https://github.com/home-assistant/home-assista…
ba10632
Merge branch 'next' of https://github.com/home-assistant/home-assista…
e27e58f
Merge branch 'next' of https://github.com/MrLeeh/home-assistant.githu…
ca12296
fix version numbers
349d03d
separate configuration tag
81e3a35
remove device notification config
ddf1193
fix configuration schema.
119b2cc
replace tabs with spaces
d931b34
add type key-value-pairs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
layout: page | ||
title: "ADS" | ||
description: Connect Home Assistant to TwinCAT devices via the ADS interface | ||
date: 2017-12-05 12:00 | ||
sidebar: true | ||
comments: false | ||
sharing: true | ||
footer: true | ||
logo: home-assistant.png | ||
ha_category: Hub | ||
ha_release: 0.60 | ||
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 parameters: | ||
|
||
{% configuration %} | ||
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, 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 | ||
type: string | ||
{% endconfiguration %} | ||
|
||
|
||
```yaml | ||
# Example configuration.yaml entry | ||
ads: | ||
device: '127.0.0.1.1.1' | ||
port: 48898 | ||
``` | ||
|
||
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
layout: page | ||
title: "ADS Binary Sensor" | ||
description: "Instructions on how to set up ADS binary sensors within Home Assistant." | ||
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.60 | ||
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 | ||
``` | ||
|
||
Configuration variables: | ||
|
||
{% configuration %} | ||
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 light 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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
layout: page | ||
title: "ADS Light" | ||
description: Instructions 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.60 | ||
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: 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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
layout: page | ||
title: "ADS Sensor" | ||
description: "Instructions how to integrate ADS numeric values into Home Assistant." | ||
date: 2017-10-25 10:00 | ||
sidebar: true | ||
comments: false | ||
sharing: true | ||
footer: true | ||
logo: home-assistant.png | ||
ha_category: Sensor | ||
ha_release: 0.60 | ||
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: | ||
|
||
{% configuration %} | ||
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 %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No |
||
|
||
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
layout: page | ||
title: "ADS Switch" | ||
description: "Instructions on how to set up ADS switches within Home Assistant." | ||
date: 2017-10-25 10:00 | ||
sidebar: true | ||
comments: false | ||
sharing: true | ||
footer: true | ||
logo: home-assistant.png | ||
ha_category: Switch | ||
ha_release: 0.60 | ||
ha_iot_class: "Local Push" | ||
--- | ||
|
||
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` | ||
file: | ||
|
||
```yaml | ||
# Example configuration.yaml entry | ||
switch: | ||
- platform: ads | ||
adsvar: .global_bool | ||
``` | ||
Configuration variables: | ||
|
||
{% configuration %} | ||
adsvar: | ||
required: true | ||
description: The name of the variable which you want to access on the ADS device | ||
name: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
required: false | ||
description: An identifier for the switch in the frontend | ||
type: string | ||
{% endconfiguration %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
(the key abovefactor
) is missing thetype
key-value pair.