Giter Club home page Giter Club logo

hacore_opcua's People

Contributors

minix1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

racelandshop

hacore_opcua's Issues

unique ID could collide

in the sensors file the unique I'd could collide if two sensors on different hubs have the same name.

consider adding in the hub name to the unique I'd

self._unique_id

Library structure error?

When trying to add the custom repository via HACS I get the following message "Repository structure for main not compliant".
Is there an issue with the structure or something with how I'm doin it?

I don't get the same message for other integrations.

OPC-UA

Hi,

try this component, but it does not work with the actual HA Version because "setup_Sensors". Can you help?

Thanks, Jochen

Read Value Error: [Errno 32] Broken pipe

Hello,

After some hours of running OPCUA reading, I have this error on the HA log file:

2021-07-24 15:40:57 ERROR (SyncWorker_4) [custom_components.opcua] ns=4;s=|var|WAGO 750-8101 PFC100 2ETH.Application.Publish_NativeMQTT.dwMyCounter, Read Value Error: [Errno 32] Broken pipe

With this config:

  • platform: opcua
    scan_interval: 10
    nodes:
    • name: SensorOPC_UA
      hub: WAGO_OPC_UA
      nodeid: "ns=4;s=|var|WAGO 750-8101 PFC100 2ETH.Application.Publish_NativeMQTT.dwMyCounter"
      unit_of_measurement: degrees

WAGO PLC nodeid write problem

I have also a problem to write to a node on my WAGO PLC.
I created automation script like your example and I have the following message in the log

Error: “The server does not support writing the combination of value, status and timestamps provided.”(BadWriteNotSupported) encountered when attempting to write a value of: 5448123 to nodeid: ns=4;s=|var|WAGO 750-8101 PFC100 2ETH.Application.GVL.OPCUA_WritedVar

I have no problem with other OPC_UA client (like UAExpert)

OPCUA Broken after 2024.1 update

Hello,

can you help me with this please ?
after updating to 2024.1 no more data is coming from the opc server and the error is

ns=2;s=Siemens s7 300.data.1, Read Value Error: argument to node must be a NodeId object or a string defining a nodeid found ns=2;s=Siemens s7 300.data.1 of type <class 'homeassistant.util.yaml.objects.NodeStrClass'>

my configuration
opcua:

  • name: opc
    url: "opc.tcp://10.110.10.40:49321"
    session_timeout: 60000

sensor:

  • platform: opcua
    scan_interval: 30
    nodes:

    • name: "data"
      hub: opc
      nodeid: "ns=2;s=Siemens s7 300.data.1"

Thank you

No way to see connection data.

Currently, we can only see data for configured sensors. It would be nice if there were a HA entity that represented data from the base hub (connection)

OPCUA server should have some general properties we can pull as well.

image

image

need to add ns=0 to pull base namespace server items.

image

Enable SCAN_INTERVAL for entities

the current basic sensor does not allow for setting the generic SCAN_INTERVAL settings. it appears that we should be able to pull it out from the YAML configuration and input it into the entity setup in a similar fashion to the generic sensor platform .

from datetime import timedelta

SCAN_INTERVAL = timedelta(seconds=30)

async def async_setup(hass, config):
    """Track states and offer events for sensors."""
    component = hass.data[DOMAIN] = EntityComponent(
        _LOGGER, DOMAIN, hass, SCAN_INTERVAL
    )

Setup connect method errors fail the custom component

As discussed in #1 if the initial connect method in the setup method errors out then the component will fail.

we should look at how we can clear setup before connecting to the opc UA targets and make the whole component more flexible.

Problem writing on Siemens S7

I'm trying to connect a Siemens S7 with HA.
I can read everything with no issue, but I cannot write.

opcua:
  - name: pastorizzatore
    url: "opc.tcp://192.168.1.166:4840/"
    application_uri: "urn:SIMATIC.S7-1200.OPC-UA.Application:PLC_Pastorizzatore"
    session_timeout: 600000
    secure_timeout: 600000
    security_string: ""

No problem with reading values.

I tried to write

service: opcua.set_value
data:
  nodeid: 'ns=4;i=189'
  value: "mytest"
  hub: pastorizzatore

And have

2023-07-25 13:40:01.215 ERROR (SyncWorker_3) [custom_components.opcua] Error: "The server does not support writing the combination of value, status and timestamps provided."(BadWriteNotSupported)  encountered when attempting to write a value of: mytest to nodeid: ns=4;i=189

Tried with

service: opcua.set_attribute
data:
  nodeid: 'ns=4;i=189'
  value: "mytest"
  hub: pastorizzatore

I receive no error, but I do not see any update on the S7

2023-07-25 13:42:10.862 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-07-25 13:42:10.863 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-07-25 13:42:10.870 INFO (SyncWorker_7) [opcua.client.ua_client] read
2023-07-25 13:42:10.919 INFO (Thread-3 (_run)) [opcua.uaprotocol] received header: Header(type:b'MSG', chunk_type:b'F', body_size:68, channel:3083442666)
2023-07-25 13:42:10.922 INFO (SyncWorker_7) [opcua.client.ua_client] read
2023-07-25 13:42:11.001 INFO (Thread-3 (_run)) [opcua.uaprotocol] received header: Header(type:b'MSG', chunk_type:b'F', body_size:52, channel:3083442666)

Any ideas?
Thanks

ps: Using UAExpert I can write with no issue.

Critical HA error on socket teardown

appears that a critical error occurs while opcua attempts to connect to an opc ua server and it is rejected. in this case due to incorrect security configuration. first reported at HA Community Forum

That said it shouldn't crash HA or prevent further loading. additional investigation required.

Home-assistant.log file :

2021-03-03 14:00:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.


2021-03-03 14:00:34 CRITICAL (Thread-3) [opcua.client.ua_client.Socket] Received an error: MessageAbort(error:StatusCode(BadSecurityPolicyRejected), reason:None)
2021-03-03 14:00:34 ERROR (Thread-3) [opcua.client.ua_client.Socket] Protocol Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/opcua/client/ua_client.py", line 101, in _run
    self._receive()
  File "/usr/local/lib/python3.8/site-packages/opcua/client/ua_client.py", line 121, in _receive
    self._call_callback(0, ua.UaStatusCodeError(msg.Error.value))
  File "/usr/local/lib/python3.8/site-packages/opcua/client/ua_client.py", line 129, in _call_callback
    raise ua.UaError(
opcua.ua.uaerrors._base.UaError: No future object found for request: 0, callbacks in list are dict_keys([2])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.