eta_utility.connectors.node module
This module implements the node class, which is used to parametrize connections
- class eta_utility.connectors.node.NodeMeta(name: str, bases: tuple, namespace: dict[str, Any], **kwargs: Any)[source]
Bases:
type
Metaclass to define all Node classes as frozen attr dataclasses.
- class eta_utility.connectors.node.Node(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
object
The node objects represents a single variable. Valid keyword arguments depend on the protocol.
- url_parsed: ParseResult
Parse result object of the URL (in case more post-processing is required).
- dtype: Callable | None
Data type of the node (for value conversion). Note that strings will be interpreted as utf-8 encoded. If you do not want this behaviour, use ‘bytes’.
- classmethod from_dict(dikt: Sequence[Mapping] | Mapping[str, Any], fail: bool = True) list[Node] [source]
Create nodes from a dictionary of node configurations. The configuration must specify the following fields for each node:
Code (or name), URL, Protocol (i.e. modbus or opcua or eneffco). The URL should be a complete network location identifier. Alternatively it is possible to specify the location in two fields: IP and Port. These should only contain the respective parts (as in only an IP address and only the port number). The IP-Address should always be given without scheme (https://).
For local nodes no additional fields are required.
For Modbus nodes the following additional fields are required:
ModbusRegisterType (or mb_register), ModbusSlave (or mb_slave), ModbusChannel (or mb_channel).
For OPC UA nodes the following additional fields are required:
Identifier.
For EnEffCo nodes the code field must be present.
For EntsoE nodes the endpoint field must be present.
- Parameters:
dikt – Configuration dictionary.
fail – Set this to false, if you would like to log errors instead of raising them.
- Returns:
List of Node objects.
- classmethod from_excel(path: Path, sheet_name: str, fail: bool = True) list[Node] [source]
Method to read out nodes from an Excel document. The document must specify the following fields:
Code, IP, Port, Protocol (modbus or opcua or eneffco).
For Modbus nodes the following additional fields are required:
ModbusRegisterType, ModbusByte, ModbusChannel.
For OPC UA nodes the following additional fields are required:
Identifier.
For EnEffCo nodes the Code field must be present.
The IP-Address should always be given without scheme (https://).
- Parameters:
path – Path to Excel document.
sheet_name – name of Excel sheet, which will be read out.
fail – Set this to false, if you would like to log errors instead of raising them.
- Returns:
List of Node objects.
- classmethod get_eneffco_nodes_from_codes(code_list: Sequence[str], eneffco_url: str) list[Node] [source]
Utility function to retrieve Node objects from a list of EnEffCo Codes (Identifiers).
Deprecated since version v2.0.0: Use the from_ids function of the EnEffCoConnection Class instead.
- Parameters:
code_list – List of EnEffCo identifiers to create nodes from.
eneffco_url – URL to the EnEffCo system.
- Returns:
List of EnEffCo nodes.
- class eta_utility.connectors.node.NodeLocal(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
Node
Local Node (no specific protocol), useful for example to manually provide data to subscription handlers.
- url_parsed: ParseResult
Parse result object of the URL (in case more post-processing is required).
- class eta_utility.connectors.node.NodeModbus(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
Node
Node for the Modbus protocol.
- mb_register: str
Modbus Register name. One of input, discrete_input, coils and holding. Note that only coils and holding can be written to.
- class eta_utility.connectors.node.NodeOpcUa(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
Node
Node for the OPC UA protocol.
- class eta_utility.connectors.node.NodeEnEffCo(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
Node
Node for the EnEffCo API.
- class eta_utility.connectors.node.NodeEntsoE(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
Node
Node for the EntsoE API (see ENTSO-E Transparency Platform API).
Available endpoint Endpoint
Description
ActualGenerationPerType
Actual Generation Per Energy Type
Price
Price day ahead
Currently, there is only two endpoints available, due to the parameter managing required by the API documentation. The other possible endpoints are listed in
eta_utility.connectors.entso_e._ConnectionConfiguration._doc_types
Main bidding zone Bidding Zone
Description
DEU-LUX
Deutschland-Luxemburg
The other possible bidding zones are listed in
eta_utility.connectors.entso_e._ConnectionConfiguration._bidding_zones