home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.85k stars 30.1k forks source link

ADSError: Unknown Error (-1) #124866

Open drindal82 opened 1 month ago

drindal82 commented 1 month ago

The problem

Every time I want to read or write a variable via the ads integration the error ADSError: Unknown Error (-1) is shown in the log. This bug exists now since a loooong time.

What version of Home Assistant Core has the issue?

core-2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

https://www.home-assistant.io/integrations/ads/

Link to integration documentation on our website

No response

Diagnostics information

Error writing GVL.M_Licht_Aussen_Grill: ADSError: Unknown Error (-1).

Example YAML snippet

ads:
  device: "xxx"
  port: 851
  ip_address: xxx.xxx.xxx.x

switch:
  - platform: ads
    adsvar: GVL.M_Licht_EG_WZ_Fernsehen
    name: SW Licht EG WZ Couch
#    unique_id: sw_licht_eg_wz_couch

  - platform: ads
    adsvar: GVL.M_Licht_Aussen_Grill
    name: 'SW Licht Laube'

light:
  - platform: template
    lights:
      laube_light_template:
        friendly_name: "Laube Light"
        value_template: >-
          {% if is_state('light.laube_light', 'on') %}
            on
          {% else %}
            off
          {% endif %}
        turn_on:
          service: switch.turn_on
          entity_id: switch.sw_licht_laube
        turn_off:
          service: switch.turn_off
          entity_id: switch.sw_licht_laube

Anything in the logs that might be useful for us?

Logger: homeassistant.components.ads
Quelle: components/ads/__init__.py:189
Integration: ADS (Dokumentation, Probleme)
Erstmals aufgetreten: 17:28:05 (1 Vorkommnisse)
Zuletzt protokolliert: 17:28:05

Additional information

No response

home-assistant[bot] commented 1 month ago

ads documentation ads source

mrpasztoradam commented 3 weeks ago

try extending your logging like this, maybe there is some useful info:

logger:
  default: info
  logs:
    homeassistant.components.ads: debug
    custom_components.ads: debug

Are you absolutely sure the connection is happening?

drindal82 commented 3 weeks ago

try extending your logging like this, maybe there is some useful info:

logger:
  default: info
  logs:
    homeassistant.components.ads: debug
    custom_components.ads: debug

Are you absolutely sure the connection is happening?

Thanks for your response: The connection is definitely open. I can read the values of sensor, switch and light types

But when i want to write a switch or a light following error occurs: 2024-09-07 14:27:03.655 ERROR (SyncWorker_5) [homeassistant.components.ads] Error writing GVL.M_Licht_Aussen_Grill: ADSError: Unknown Error (-1). Unfortunately there aren't any other errors in the log.

mrpasztoradam commented 3 weeks ago

Tried to reproduce it with my live system (rpi4), but looks good to me...

Core 2024.8.3
Supervisor 2024.08.0
Operating System 13.1
Frontend 20240809.0

Also, on dev version, no issues (macmini 2014).

Core 2024.10.0.dev0
Frontend 20240904.0
drindal82 commented 2 weeks ago

my home assistant is running on a lenovo nuc with following versions:

Core 2024.9.1 Supervisor 2024.08.0 Operating System 13.1 Frontend 20240906.0

my configuration.yaml

i also tried to trigger the action via the developer tools: image

I've tried with and without the prefix GVL

home-assistant.log 2024-09-10 07:39:52.498 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script 2024-09-10 07:39:52.499 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service 2024-09-10 07:39:52.502 ERROR (SyncWorker_5) [homeassistant.components.ads] Error writing GVL.HZ_OG_KiZi_1: ADSError: Unknown Error (-1). 2024-09-10 07:42:41.622 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script 2024-09-10 07:42:41.622 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service 2024-09-10 07:42:41.624 ERROR (SyncWorker_11) [homeassistant.components.ads] Error writing .HZ_OG_KiZi_1: ADSError: Unknown Error (-1).

Unfortunately I don't know how to debug the service.

Somehow it's like it is loosing its connection and never tries to reconnect again. 3 days ego, I restarted my home assistant the last time. My temperature value has been read the last time 3 days ago and never got updated again. image

Via the node-red-ads plugin it's working. BUt i would prefer the original ads integration, because it is far easier to handle

mrpasztoradam commented 2 weeks ago

Somehow it's like it is loosing its connection and never tries to reconnect again. 3 days ego, I restarted my home assistant the last time. My temperature value has been read the last time 3 days ago and never got updated again.

Looks like related to the issue here: https://github.com/home-assistant/core/issues/99258 The PR might fix it: https://github.com/home-assistant/core/pull/119521

drindal82 commented 2 weeks ago

This would be great, if it can be fixed.

Converting to MQTT is not an option for me, because then I would have to buy an expensive licence from Beckhoff, only for communicating with home assistant.

Thanks for looking into my problem