minix1234 / hacore_opcua Goto Github PK
View Code? Open in Web Editor NEWopcua custom component for home assistant
License: MIT License
opcua custom component for home assistant
License: MIT License
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
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.
Hi,
try this component, but it does not work with the actual HA Version because "setup_Sensors". Can you help?
Thanks, Jochen
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:
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)
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:
sensor:
platform: opcua
scan_interval: 30
nodes:
Thank you
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
)
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.
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.
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])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.