Plugin ‚modbus_tcp‘ Konfiguration

plugin logo

Im folgenden sind etwaige Anforderungen und unterstützte Hardware beschrieben. Danach folgt die Beschreibung, wie das Plugin modbus_tcp konfiguriert wird. Außerdem ist im folgenden beschrieben, wie das Plugin in den Item Definitionen genutzt werden kann. [1]

Es handelt sich bei diesem Plugin um ein gateway Plugin.

Beschreibung

Plugin zur Geräte-Anbindung über ModBus an SmartHomeNG

Anforderungen

  • Minimum SmartHomeNG Version: 1.10

  • Minimum Python Version: 3.8

Konfiguration

Im folgenden ist beschrieben, wie das Plugin modbus_tcp konfiguriert wird. Außerdem ist im folgenden beschrieben, wie das Plugin in den Item Definitionen genutzt werden kann.

Parameter

Das Plugin verfügt über folgende Parameter, die in der Datei ../etc/plugin.yaml konfiguriert werden:

crontab

Update mit Festlegung via Crontab

  • Datentyp: str

cycle

Update Zyklus in Sekunden. Wenn der Wert 0 ist, wird keine Abfrage über cycle ausgeführt

  • Datentyp: int

  • Standardwert: 300

  • Minimalwert: 0

host

IP Adresse des Modbus-Geraetes

  • Datentyp: ipv4

pause_item

Item, um die Ausführung des Plugins zu steuern

  • Datentyp: str

port

modbus Port

  • Datentyp: int

  • Minimalwert: 0

  • Maximalwert: 65535

slaveUnit

Slave-Addresse der zu lesenden Modbus-Einheit

  • Datentyp: int

  • Standardwert: 1

Item Attribute

Das Plugin unterstützt folgende Item Attribute, die in den Dateien im Verzeichnis ../items verwendet werden:

modBusAddress

Register Adresse welche gelesen werden soll

  • Datentyp: num

modBusByteOrder

Endian.BIG oder Endian.LITTLE

  • Datentyp: str

  • Standardwert: Endian.BIG

  • Mögliche Werte:

    • Endian.BIG

    • Endian.LITTLE

modBusDataType

Datentyp vom zu lesenden Register (bit, int16 uint16 int32 uint32 float32 string16 stringNN)

  • Datentyp: str

  • Standardwert: uint16

modBusDirection

Datenrichtung

  • Datentyp: str

  • Standardwert: read

  • Mögliche Werte:

    • read

    • read_write

    • write

modBusFactor

Faktor mit dem der gelesene Register-Wert multipliziert wird

  • Datentyp: num

  • Standardwert: 1

modBusObjectType

Auswahl welcher Objekt-Type gelesen werden soll

  • Datentyp: str

  • Standardwert: HoldingRegister

  • Mögliche Werte:

    • Coil

    • DiscreteInput

    • InputRegister

    • HoldingRegister

modBusUnit

Slave-Addresse der zu lesenden Modbus-Einheit (Unit aus der plugin-Konfig wird überschrieben)

  • Datentyp: num

  • Standardwert: 1

modBusWordOrder

Endian.BIG oder Endian.LITTLE

  • Datentyp: str

  • Standardwert: Endian.BIG

  • Mögliche Werte:

    • Endian.BIG

    • Endian.LITTLE

Item-Structs

Das Plugin stellt die folgenden Item-Structs zur Verfügung. Diese Informationen sind aus der plugin.yaml entnommen und möglicherweise nicht vollständig.

huawei

  • huawei (foo, —)
    • smartlogger (foo, —)
      • system (foo, —)
        • date_time (num, —)

        • time_zone (num, —)

        • local_time (num, —)

      • pv (foo, —)
        • active_power (num, —)

        • reactive_power (num, —)

      • storage (foo, —)
        • active_power (num, —)

        • soc (num, —)

      • inverter (foo, —)
        • efficiency (num, —)

      • external_meter (foo, —)
        • voltage (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • current (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • power (foo, —)
          • active (num, —)

          • power_factor (num, —)

        • energy (foo, —)
          • total_active (num, —)

          • total_reactive (num, —)

    • sdongle (foo, —)
      • energy (foo, —)
        • input_power (num, —)

        • load_power (num, —)

        • grid_power (num, —)

        • battery_power (num, —)

        • active_power (num, —)

    • meter (OrderedDict([(‚meter‘, OrderedDict([(‚type‘, ‚num‘), (‚modBusAddress@instance‘, 37125), (‚modBusDataType@instance‘, ‚uint16‘), (‚modBusFactor@instance‘, 1), (‚modBusDirection@instance‘, ‚read‘)])), (‚check‘, OrderedDict([(‚type‘, ‚num‘), (‚modBusAddress@instance‘, 37138), (‚modBusDataType@instance‘, ‚uint16‘), (‚modBusFactor@instance‘, 1), (‚modBusDirection@instance‘, ‚read‘)]))]), —)
      • status (num, —)

      • frequency (num, —)

      • voltage (foo, —)
        • phase_a (num, —)

        • phase_b (num, —)

        • phase_c (num, —)

        • line_ab (num, —)

        • line_bc (num, —)

        • line_ca (num, —)

      • current (foo, —)
        • phase_a (num, —)

        • phase_b (num, —)

        • phase_c (num, —)

      • power (foo, —)
        • active (num, —)

        • reactive (num, —)

        • factor (num, —)

        • phase_a (num, —)

        • phase_b (num, —)

        • phase_c (num, —)

      • energy (foo, —)
        • exported (num, —)

        • accumulated (num, —)

        • reactive_accumulated (num, —)

      • type (foo, —)
        • meter (num, —)

        • check (num, —)

    • inverter (foo, —)
      • hardware (foo, —)
        • model_name (str, —)

        • serial_number (str, —)

        • part_number (str, —)

        • model_id (num, —)

        • product_sales_area (str, —)

        • grid_standard_code_protocol_version (num, —)

        • status (num, —)

        • capability (foo, —)
          • nb_pv_strings (num, —)

          • nb_mpp_tracks (num, —)

        • startup (num, —)

        • shutdown (num, —)

      • software (foo, —)
        • firmware_version (str, —)

        • software_version (str, —)

        • protocol_version_modbus (num, —)

      • limits (foo, —)
        • rated_power (num, —)

        • p_max (num, —)

        • s_max (num, —)

        • q_max_out (num, —)

        • q_max_in (num, —)

        • p_max_real (num, —)

        • s_max_real (num, —)

      • features (foo, —)
        • feature_mask_1 (num, —)

        • feature_mask_2 (num, —)

        • feature_mask_3 (num, —)

        • feature_mask_4 (num, —)

      • frequency (num, —)

      • efficiency (num, —)

      • temperature (num, —)

      • power (foo, —)
        • input (num, —)

        • active (num, —)

        • reactive (num, —)

        • factor (num, —)

    • storage (foo, —)
      • power (foo, —)
        • charge (foo, —)
          • max (num, —)

          • max_set (num, —)

          • forced (foo, —)
            • charge (num, —)

            • discharge (num, —)

        • discharge (foo, —)
          • max (num, —)

          • max_set (num, —)

        • grid_charge (foo, —)
          • current (num, —)

          • max (num, —)

      • capacity (foo, —)
        • rated (num, —)

        • state_of_charge (num, —)

        • cutoff (foo, —)
          • charge (num, —)

          • discharge (num, —)

        • forced_soc (num, —)

        • backup_soc (num, —)

        • grid_charge_cutoff (num, —)

      • energy (foo, —)
        • total (foo, —)
          • charge (num, —)

          • discharge (num, —)

        • daily (foo, —)
          • charge (num, —)

          • discharge (num, —)

      • electrical (foo, —)
        • bus (foo, —)
          • voltage (num, —)

          • current (num, —)

      • status (foo, —)
        • running (num, —)

        • forced_mode (num, —)

        • power_limit_grid (num, —)

        • working_mode_a (num, —)

        • working_mode_settings (num, —)

        • control_mode (num, —)

      • operation (foo, —)
        • charge_from_grid (bool, —)

        • excess_pv_use_tou (num, —)

      • pricing (foo, —)
        • time_of_use_price (num, —)

        • luna_price_periods (num, —)

        • lg_resu_price_periods (num, —)

        • fixed_charging_and_discharging_periods (num, —)

        • lcoe (num, —)

    • emma (foo, —)
      • general (foo, —)
        • system (foo, —)
          • software_version (str, —)

          • model (str, —)

          • number_of_inverters_found (num, —)

          • number_of_chargers_found (num, —)

          • backup_time_notification_threshold (num, —)

          • local_time_year (num, —)

        • energy (foo, —)
          • total (foo, —)
            • absorbed (num, —)

            • consumption (num, —)

            • grid_export (num, —)

            • grid_import (num, —)

            • inverter_yield (num, —)

            • pv_yield (num, —)

          • today (foo, —)
            • consumption (num, —)

            • grid_export (num, —)

            • grid_import (num, —)

            • inverter_yield (num, —)

            • pv_yield (num, —)

          • monthly (foo, —)
            • pv_yield (num, —)

            • consumption (num, —)

            • grid_export (num, —)

            • grid_import (num, —)

          • yearly (foo, —)
            • pv_yield (num, —)

            • consumption (num, —)

            • grid_export (num, —)

            • grid_import (num, —)

        • power (foo, —)
          • pv_output (num, —)

          • load (num, —)

          • feed_in (num, —)

          • inverter (foo, —)
            • active (num, —)

            • rated (num, —)

        • configuration (foo, —)
          • threephase_imbalance_control (bool, —)
            • register (num, —)

          • power_control_mode_at_grid_connection_point (str, —)
            • config (dict, —)

            • config_reverse (dict, —)

            • register (num, —)

          • power_supply_configuration (str, —)
            • config (dict, —)

            • config_reverse (dict, —)

            • register (num, —)

          • tou_preferred_surplus_pv_use (num, —)

          • tou_max_grid_charge_power (num, —)

          • limitation_mode (num, —)

          • max_feed_in_power_watt (num, —)

          • max_feed_in_power_percent (num, —)

      • storage (foo, —)
        • energy (foo, —)
          • chargeable (num, —)

          • dischargeable (num, —)

          • capacity (foo, —)
            • chargeable (num, —)

            • dischargeable (num, —)

            • rated (num, —)

          • charged (foo, —)
            • today (num, —)

            • monthly (num, —)

            • total (num, —)

          • discharged (foo, —)
            • today (num, —)

            • monthly (num, —)

            • total (num, —)

        • charge_discharge_power (num, —)

        • state_of_charge (foo, —)
          • primary (num, —)

          • backup (num, —)

        • ess_control_mode (str, —)
          • config (dict, —)

          • config_reverse (dict, —)

          • register (num, —)

      • built_in_energy_sensor (foo, —)
        • voltage (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

          • line_ab (num, —)

          • line_bc (num, —)

          • line_ca (num, —)

        • current (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • power (foo, —)
          • active (num, —)

          • factor (num, —)

          • apparent (num, —)

          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • energy (foo, —)
          • active (num, —)

          • negative (num, —)

          • positive (num, —)

      • external_energy_sensor (foo, —)
        • voltage (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

          • line_ab (num, —)

          • line_bc (num, —)

          • line_ca (num, —)

        • current (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • power (foo, —)
          • active (num, —)

          • factor (num, —)

          • apparent (num, —)

          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • energy (foo, —)
          • active (num, —)

          • negative (num, —)

          • positive (num, —)

      • external_meter (foo, —)
        • status (num, —)

        • voltage (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

          • line_ab (num, —)

          • line_bc (num, —)

          • line_ca (num, —)

        • current (foo, —)
          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • power (foo, —)
          • active (num, —)

          • apparent (num, —)

          • factor (num, —)

          • phase_a (num, —)

          • phase_b (num, —)

          • phase_c (num, —)

        • energy (foo, —)
          • total (num, —)

          • positive (num, —)

          • negative (num, —)

Logik Parameter

Das Plugin verfügt über folgende Parameter, die in der Datei ../etc/logic.yaml konfiguriert werden:

Keine Logik Parameter in den Metadaten beschrieben - Bitte in der README nachsehen (siehe Fußnote)

Plugin Functions

Das Plugin verfügt über folgende öffentliche Funktionen, die z.B. in Logiken aufgerufen werden können.

Keine