ADS
The ADS (automation device specification) describes a device-independent and fieldbus independent interface for communication between Beckhoff
There is currently support for the following device types within Home Assistant:
Configuration
To enable ADS, add the following lines to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file.
After changing the configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.
# Example configuration.yaml entry
ads:
device: "127.0.0.1.1.1"
port: 801
Action
The ADS integration will register the write_by_name
action allowing you to write a value to a variable on your ADS device.
{
"adsvar": ".myvariable",
"adstype": "int",
"value": 123
}
Action parameters:
-
adsvar: Name of the variable on the ADS device. To access global variables on TwinCAT2 use a prepending dot
.myvariable
, for TwinCAT3 useGBL.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.
Binary sensor
The ads
binary sensor platform 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 and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
binary_sensor:
- platform: ads
adsvar: .boolean1
Configuration Variables
Sets the class of the device, changing the device state and icon that is displayed on the frontend.
Light
The ads
light platform allows you to control your connected ADS lights.
To use your ADS device, you first have to set up your ADS hub and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
light:
- platform: ads
adsvar: GVL.enable_light
adsvar_brightness: GVL.brightness
Sensor
The ads
sensor platform allows reading the value of a numeric variable on your ADS device. The variable can be of type BOOL, BYTE, INT, UINT, SINT, USINT, DINT, UDINT, WORD, DWORD, REAL, or LREAL.
To use your ADS device, you first have to set up your ADS hub and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
sensor:
- platform: ads
adsvar: GVL.temperature
unit_of_measurement: "°C"
adstype: int
Configuration Variables
The datatype of the ADS variable, possible values are bool, byte, int, uint, sint, usint, dint, udint, word, dword, real and lreal.
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
.
Switch
The ads
switch platform 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 and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
switch:
- platform: ads
adsvar: .global_bool
Cover
The ads
cover platform allows you to control your connected ADS covers.
To use your ADS device, you first have to set up your ADS hub and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
cover:
- platform: ads
name: Curtain master bed room
adsvar_open: covers.master_bed_room_open
adsvar_close: covers.master_bed_room_close
adsvar_stop: covers.master_bed_room_stop
device_class: curtain
Configuration Variables
The name of the boolean variable that returns the current status of the cover (True
= closed)
The name of the variable that returns the current cover position, use a byte variable on the PLC side
The name of the variable that sets the new cover position, use a byte variable on the PLC side
Sets the class of the device, changing the device state and icon that is displayed on the frontend.
Select
The ads
select entity accesses an ENUM (int) variable on the connected ADS device. The variable is identified by its name. You have to set up a corresponding ENUM in the TwinCAT PLC. It is recommended to use explicit values starting from 0
.
TYPE E_SampleA :
(
e1 := 0,
e2 := 1,
e3 := 2,
);
END_TYPE
Valve
The ads
valve entity 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 and then add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]
file:
# Example configuration.yaml entry
select:
- platform: ads
adsvar: MAIN.eMyEnum
options:
- "Off"
- "Setup"
- "Automatic"
- "Manual"
- "Guest"
- "Error"
valve:
- platform: ads
adsvar: MAIN.bValveControl