Having trouble configuring https://www.home-assistant.io/components/ads/. I get no errors when i do configuration check but when HA start up it says “Invalid config” ‘ads’ could not be set up and that i need to check my config. Twincat is running on my device “Beckhoff CX5130”. I guess i have to create ads rout between my CX and HA. But how?
Error during setup of component ads
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/ads/init.py”, line 57, in setup
import pyads
File “/usr/local/lib/python3.6/site-packages/pyads/init.py”, line 5, in
from .ads import open_port, close_port, get_local_address, read_state,
File “/usr/local/lib/python3.6/site-packages/pyads/ads.py”, line 23, in
from .pyads_ex import (
File “/usr/local/lib/python3.6/site-packages/pyads/pyads_ex.py”, line 46, in
_adsDLL = ctypes.CDLL(adslib)
File “/usr/local/lib/python3.6/ctypes/init.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: Error loading shared library /usr/local/lib/python3.6/site-packages/pyads/adslib.so: Exec format error
I had a similar problem with Twincat2. Problem was the AMS router of the PLC. I added the AmsNetId id of my raspberry pi (id = ipaddress + ‘.1.1’ f.e. 192.168.0.50.1.1). You can add this on the PLC (rightclick on the beckoff tray icon - properties - tab ‘AMS router’). Didn’t work after adding ams router. I had to reboot the PLC, then I saw thecorrect sensor values.
can you explain your complete setting?
What do have done in your setting?
Can you sent me a example with HA config, PLC program. more ore less a complete example for both sides (HA and PLC).
My configuration is HA on PI, Beckhoff CX9020 with running PLC on Port 801
I was not able to get a connection to the ADS.
On the beckhoff side:
First you must add your HA device to the AMS router of the PLC. I added the AmsNetId id of my raspberry pi (id = ipaddress + ‘.1.1’ f.e. 192.168.0.50.1.1). You can add this on the PLC (rightclick on the beckhoff tray icon - properties - tab ‘AMS router’). Don’t forget to restart the PLC.
And every ‘adsvar’ in the configuration.yaml points to a TwinCAT variable.
F.e. temperature: adsvar: Temperatuur.HAEetruimte is an integer variable ‘HAEetruimte’ in the program ‘Temperatuur’. (If you use global variables the variable must start with a point.)