Skip to content
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 13 commits into from
Dec 5, 2017
60 changes: 60 additions & 0 deletions source/_components/ads.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
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
logo: home-assistant.png
ha_category: Hub
ha_release: 0.59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.60"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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*): The AMS NetId that identifies the device.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

- **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.

{% 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

39 changes: 39 additions & 0 deletions source/_components/binary_sensor.ads.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
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.59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.60"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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*): The name of the variable which you want to access on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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.

{% endconfiguration %}
38 changes: 38 additions & 0 deletions source/_components/light.ads.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.60"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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 %}
48 changes: 48 additions & 0 deletions source/_components/sensor.ads.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
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.59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.60"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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*): The name of the variable which you want to access on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a default keyword for default values or should I just add the default value to the description?

Copy link
Member

@MartinHjelmare MartinHjelmare Dec 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a default key, so use that, 👍.

- **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.

{% endconfiguration %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No type here for factor either.


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`.
35 changes: 35 additions & 0 deletions source/_components/switch.ads.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
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.59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.60"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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*): The name of the variable which you want to access on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

the ADS device.
{% endconfiguration %}