Hallo zusammen,
ich probiere mich an mein erstes selbst kreiertes plugin, welches die Aufgabe hat meinen Wechselrichter auszulesen.
Nun scheitere ich aber tatsächlich bereits beim einlesen der Parameter zur Konfiguration des Plugins. Ich habe mir andere plugin Beispiele angeschaut und habe mich auch an diese Dokumentation gehalten https://www.smarthomeng.de/user/entw...n5minutes.html. Daher war ich der Meinung das dies mit
gehen sollte.
Leider erhalte ich aber beim neustarten folgende Fehlermeldung im log
https://knx-user-forum.de/core/image...EAAAICRAEAOw==
Weiss jemand von Euch warum ich eine leere Variable übergebe anstatt das konfigurierte string aus der etc/plugin.yaml Datei?
etc/plugin.yaml
e3dc/__init__.py
e3dc/plugin.yaml
ich probiere mich an mein erstes selbst kreiertes plugin, welches die Aufgabe hat meinen Wechselrichter auszulesen.
Nun scheitere ich aber tatsächlich bereits beim einlesen der Parameter zur Konfiguration des Plugins. Ich habe mir andere plugin Beispiele angeschaut und habe mich auch an diese Dokumentation gehalten https://www.smarthomeng.de/user/entw...n5minutes.html. Daher war ich der Meinung das dies mit
Code:
self.get_parameter_value('param')
Leider erhalte ich aber beim neustarten folgende Fehlermeldung im log
Weiss jemand von Euch warum ich eine leere Variable übergebe anstatt das konfigurierte string aus der etc/plugin.yaml Datei?
etc/plugin.yaml
Code:
e3dc: class_name: e3dc class_path: plugins.e3dc TCP_IP: xxx.xxx.x.xxx username: xxxxx.xxx@xxx.xx password: xxxxxx RSCP_key: xxxxxxxxxxxxx
Code:
import logging import json from lib.model.smartplugin import SmartPlugin from e3dc import E3DC from datetime import datetime class e3dc(SmartPlugin): PLUGIN_VERSION = "1.0.0" ALLOW_MULTIINSTANCE = False def __init__(self, sh): """ Initializes the plugin. The parameters describe for this method are pulled from the entry in plugin.conf. :param sh: The instance of the smarthome object, save it for later references :param TCP_IP: IP or host name of E3/DC Hauskraftwerk :param username: Login name of user to enter the E3/DC portal :param password: Password for the E3/DC portal :param RSCP_key: RSCP password to connect directly with the E3/DC device :param cycle: Update cycle in seconds """ self._sh = sh self.logger = logging.getLogger(__name__) USERID = self.get_parameter_value('username') PASSWORD = self.get_parameter_value('password') IP = self.get_parameter_value('TCP_IP') KEY = self.get_parameter_value('RSCP_key') with open(self.get_plugin_dir() + '/e3dc_config.json') as f: CONFIG = json.load(f) self.static_items = [] try: self._e3dc = E3DC(E3DC.CONNECT_LOCAL, username=USERID, password = PASSWORD, ipAddress = IP, key = KEY, configuration = CONFIG) self._e3dc_system_info = self._e3dc.get_system_info() except KeyError as e: self.logger.critical("Plugin {}: Coul not connect with your E3DC device, error: {} plugin".format(self.get_shortname(),e))
Code:
# meta data for the plugin plugin: # Global plugin attributes type: interface # plugin type (gateway, interface, protocol, system, web) description: de: 'Anbindung von E3/DC S10 Hauskraftwerk Geraeten' en: 'integration of E3/DC devices' maintainer: brunosa3 tester: unknown # Who tests this plugin? state: develop # change to ready when done with development keywords: E3DC hauskraftwerk geraete documentation: not yet # url of documentation (wiki) page support: https://knx-user-forum.de/forum/supportforen/not_set_yet version: 1.0.0 # Plugin version sh_minversion: 1.8 # minimum shNG version to use this plugin # sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest) multi_instance: False # plugin supports multi instance restartable: True classname: e3dc # class containing the plugin parameters: # Definition of parameters to be configured in etc/plugin.yaml TCP_IP: type: ip default: 127.0.0.1 description: de: 'e3dc Hostname oder IP Adresse' en: 'e3dc hostname or ip address' username: type: str default: '' description: de: 'Benutzername' en: 'username' password: type: str default: '' hide: True description: de: 'Passwort' en: 'password' RSCP_key: type: str default: 'abc123' description: de: 'Benutzername' en: 'username' cycle: type: int default: 300 description: de: '(optional) Zeit zwischen zwei Updateläufen. Default ist 300 Sekunden.' en: '(optional) Timeperiod between two update cycles. Default is 300 seconds.' item_attributes: # Definition of item attributes defined by this plugin e3dc_item: type: str description: de: > en: > e3dc_key: type: str description: de: > en: > e3dc_value: type: str description: de: > en: > item_structs: NONE logic_parameters: NONE plugin_functions: NONE
Kommentar