Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##################################################################
- #
- # $Id: 98_ModbusDHW300.pm 15385 2020-05-07 11:11:11Z Olu $
- #
- # Fhem Modul für die Abfrage/Steuerung von Warmwasser-Wärmepumpen Baureihe DHW 300.
- # Verwendet Modbus.pm als Basismodul für die eigentliche Implementation des Protokolls.
- #
- # Siehe 98_ModbusAttr.pm für ausführlichere Infos zur Verwendung des Moduls 98_Modbus.pm
- #
- ##################################################################
- #
- # This file is part of fhem.
- #
- # Fhem is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 2 of the License, or
- # (at your option) any later version.
- #
- # Fhem is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with fhem. If not, see <http://www.gnu.org/licenses/>.
- #
- ##############################################################################
- # Changelog
- # 2020-05-07 initial release, forked from 98_ModbusDHW300
- #
- ##############################################################################
- package main;
- use strict;
- use warnings;
- sub ModbusDHW300_Initialize($);
- my %DHW300ParseInfo = (
- # Warmwasser
- 'h14' => { reading => 'WW_Solltemperatur_C',
- name => 'Solltemperatur',
- # hint => '25...85',
- min => 25,
- max => 85,
- },
- 'h15' => { reading => 'WW_Absenktemperatur_C',
- name => 'Absenktemperatur',
- # hint => '15...40',
- min => 15,
- max => 40,
- },
- 'h16' => { reading => 'WW_Hysterese_K',
- name => 'Hysterese',
- # hint => '2...10',
- min => 2,
- max => 10,
- },
- 'h17' => { reading => 'WW_Modus',
- name => 'Modus',
- map => '0:ECO, 1:AUTO',
- },
- 'h18' => { reading => 'WW_Verzoegerung_h',
- name => 'Verzoegerung',
- # hint => '2...16',
- min => 2,
- max => 16,
- },
- 'h19' => { reading => 'WW_Boost_Dauer_h',
- name => 'Boost_Dauer',
- # hint => '1...8',
- min => 1,
- max => 8,
- },
- 'h20' => { reading => 'WW_Boost_Solltemp_C',
- name => 'Boost_Solltemp',
- # hint => '25...85',
- min => 25,
- max => 85,
- },
- # Betriebsstatus
- 'i8' => { reading => 'Speichertemperatur_oben_C',
- name => 'Speichertemperatur_oben',
- },
- 'i9' => { reading => 'Speichertemperatur_unten_C',
- name => 'Speichertemperatur_unten',
- },
- 'i10' => { reading => 'Lufteintritt_C',
- name => 'Lufteintritt',
- },
- 'i11' => { reading => 'Kollektrortemperatur_C',
- name => 'Kollektrortemperatur',
- },
- 'i12' => { reading => 'Sollwert_aktuell_C',
- name => 'Sollwert_aktuell',
- },
- 'i13' => { reading => 'Abtaufuehler_C',
- name => 'Abtaufuehler',
- },
- 'i14' => { reading => 'Ventilator',
- name => 'Ventilator',
- map => '0:AUS, 1:EIN',
- },
- 'i15' => { reading => 'Verdichter',
- name => 'Verdichter',
- map => '0:AUS, 1:EIN',
- },
- 'i16' => { reading => 'Elektroheizung',
- name => 'Elektroheizung',
- map => '0:AUS, 1:EIN',
- },
- 'i17' => { reading => 'Solar-/Ladepumpe',
- name => 'Solar-/Ladepumpe',
- map => '0:AUS, 1:EIN',
- },
- 'i18' => { reading => 'Leistung_W',
- name => 'Leistung',
- },
- 'i19' => { reading => 'Betriebsart',
- name => 'Betriebsart_Statuswert',
- map => '0:AUS, 1:EIN, 2:Abtauen, 3:Thermische_Desinfektion, 4:Elektroheizung, 5:Waermerzeuger2, 6:Lueftung, 7:Sensor_Fehler, 8:Idle, 9:Meldungen, 10:Frostschutz',
- },
- 'i20' => { reading => 'Meldungen',
- name => 'Meldungen_Stoerwert',
- map => '0:keine_Meldung, 1:Hochdruckpressostat, 2:Einsatzgrenze_oben_ueberschritten, 3:Einsatzgrenze_unten_ueberschritten, 4:Fuehlerfehler_R3, 5:Fuehlerfehler_R5, 6:Fuehlerfehler_R10, 7:Fuehlerfehler_R13',
- },
- # Laufzeiten
- 'i21' => { reading => 'Laufzeit_Geraet_h',
- name => 'Laufzeit_Geraet',
- },
- 'i22' => { reading => 'Laufzeit_Ventilator_h',
- name => 'Laufzeit_Ventilator',
- },
- 'i23' => { reading => 'Laufzeit_Verdichter_h',
- name => 'Laufzeit_Verdichter',
- },
- 'i24' => { reading => 'Laufzeit_Elektroheizung_h',
- name => 'Laufzeit_Elektroheizung',
- },
- );
- my %DHW300DeviceInfo = (
- "timing" => {
- timeout => 3, # value seconds timeout when waiting for a response
- commDelay => 1, # value seconds minimal delay between two communications e.g. a read a the next write,
- # can be overwritten with attribute commDelay if added to AttrList in _Initialize below
- sendDelay => 1, # value seconds minimal delay between two sends, can be overwritten with the attribute
- # sendDelay if added to AttrList in _Initialize function below
- },
- "i" => { # details for "input registers" if the device offers them
- read => 4, # use function code 4 to read discrete inputs. They can not be written by definition.
- defLen => 1, # default length (number of registers) per value ((e.g. 2 for a float of 4 bytes that spans 2 registers)
- # can be overwritten in parseInfo per reading by specifying the key "len"
- # combine => 10, # allow combined read of up to 10 adjacent registers during getUpdate
- combine => 1, # no combined read (read more than one registers with one read command) during getUpdate
- # defFormat => "%.1f", # default format string to use after reading a value in sprintf
- # can be overwritten in parseInfo per reading by specifying the key "format"
- defUnpack => "s>", # default pack / unpack code to convert raw values, e.g. "n" for a 16 bit integer oder
- # "f>" for a big endian float IEEE 754 floating-point numbers
- # can be overwritten in parseInfo per reading by specifying the key "unpack"
- defPoll => 1, # All defined Input Registers should be polled by default unless specified otherwise in parseInfo or by attributes
- defShowGet => 1, # default für showget Key in parseInfo
- },
- "h" => { # details for "holding registers" if the device offers them
- read => 3, # use function code 3 to read holding registers.
- write => 6, # use function code 6 to write holding registers (alternative could be 16)
- defLen => 1, # default length (number of registers) per value (e.g. 2 for a float of 4 bytes that spans 2 registers)
- # can be overwritten in parseInfo per reading by specifying the key "len"
- combine => 1, # allow combined read of up to 10 adjacent registers during getUpdate
- # defFormat => "%.1f", # default format string to use after reading a value in sprintf
- defUnpack => "s>", # default pack / unpack code to convert raw values, e.g. "n" for a 16 bit integer oder
- # "f>" for a big endian float IEEE 754 floating-point numbers
- # can be overwritten in parseInfo per reading by specifying the key "unpack"
- defPoll => 1, # All defined Input Registers should be polled by default unless specified otherwise in parseInfo or by attributes
- defShowGet => 1, # default für showget Key in parseInfo
- defSet => 1
- },
- );
- #####################################
- sub ModbusDHW300_Initialize($) {
- my ($hash) = @_;
- require "$attr{global}{modpath}/FHEM/98_Modbus.pm";
- $hash->{parseInfo} = \%DHW300ParseInfo; # defines registers, inputs, coils etc. for this Modbus Device
- $hash->{deviceInfo} = \%DHW300DeviceInfo; # defines properties of the device like defaults and supported function codes
- ModbusLD_Initialize($hash); # Generic function of the Modbus module does the rest
- $hash->{AttrList} .= ' '.$hash->{ObjAttrList}.' '.$hash->{DevAttrList}.' poll-.* polldelay-.*';
- }
- 1;
- =pod
- =item summary Module to work with hot water heat pump of type DHW300
- =item summary_DE Modul für Warmwasser-Wärmepumpen der Baureihe DHW300.
- =begin html
- <a name="ModbusDHW300"></a>
- <h3>ModbusDHW300</h3>
- <ul>
- ModbusDHW300 uses the low level Modbus module to provide a way to communicate with the hot water heat pump of type DHW3000.
- It defines the modbus registers for different values and reads them in a defined interval.
- <br /><br />
- <b>Prerequisites</b>
- <ul>
- <b>to be done</b>
- </ul><br />
- <b>Hardware Connection</b>
- <ul>
- <b>to be done</b>
- </ul><br />
- <b>Special meanings with Readings and the Heating Management System</b>
- <ul>
- <b>to be done</b>
- </ul><br />
- <a name="ModbusDHW300Define"></a>
- <b>Define</b>
- <ul>
- <code>define <name> ModbusDHW300 <ID> <Interval></code><br /><br />
- The module connects to the DHW300 with the Modbus Id <ID> through an already defined Modbus device and actively requests data from the system every <Interval> seconds.<br /><br />
- Example:<br>
- <code>define DHW300 ModbusDHW300 2 60</code>
- </ul><br />
- <a name="ModbusDHW300Set"></a>
- <b>Set-Commands</b>
- <ul>
- The following set options are available:
- <ul>
- <b>to be done</b>
- </ul><br />
- All other Readings (along with their Meanings) which can only be read:<br />
- <ul>
- <b>to be done</b>
- </ul>
- </ul><br />
- <a name="ModbusDHW300Get"></a>
- <b>Get-Commands</b>
- <ul>
- All readings are also available as Get commands. Internally a Get command triggers the corresponding request to the device and then interprets the data and returns the correct field value. This is a good way for getting a new current value from the Heating Management System.
- </ul><br />
- <a name="ModbusDHW300attr"></a>
- <b>Attribute</b>
- <ul>
- Only centralized Attributes are in use. Especially:
- <ul>
- <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
- </ul>
- </ul><br />
- </ul>
- =end html
- =begin html_DE
- <a name="ModbusDHW300"></a>
- <h3>ModbusDHW300</h3>
- <ul>
- ModbusDHW300 verwendet das Modul Modbus für die Kommunikation mit der Dimplex Warmwasser-Wärmepumpe DHW300.
- Hier wurden die wichtigsten Werte definiert und werden im angegebenen Intervall abgefragt und aktualisiert.
- <br /><br />
- <b>Vorraussetzungen</b>
- <ul>
- Dieses Modul benötigt das Basismodul <a href="#Modbus">Modbus</a> für die Kommunikation, welches wiederum das Perl-Modul Device::SerialPort oder Win32::SerialPort benötigt.
- </ul><br />
- <b>Physikalische Verbindung zur Heizungssteuerung</b>
- <ul>
- machen wir noch
- </ul><br />
- <b>Besonderheiten der Readings und des Reglers</b>
- <ul>
- machen wir noch
- </ul><br />
- <a name="ModbusDHW300Define"></a>
- <b>Define</b>
- <ul>
- <code>define <name> ModbusDHW300 <ID> <Interval></code><br /><br />
- Das Modul verbindet sich zur DHW300 Warmwasser-Wärmepumpe mit der angegebenen Modbus Id <ID> über ein bereits fertig definiertes Modbus-Device und fragt die gewünschten Werte im Abstand von <Interval> Sekunden ab.<br /><br />
- Beispiel:<br>
- <code>define DHW300 ModbusDHW300 2 60</code>
- </ul><br />
- <a name="ModbusDHW300Set"></a>
- <b>Set-Kommandos</b>
- <ul>
- Die folgenden Werte können gesetzt werden:
- <ul>
- machen wir noch
- </ul><br />
- <a name="ModbusDHW300Get"></a>
- <b>Get-Kommandos</b>
- <ul>
- Alle Readings sind auch als get-Kommando verfügbar. Intern führt ein get einen Request an die Steuerung aus, und aktualisiert den entsprechenden Readings-Wert (und gibt ihn als Ergebnis des Aufrufs zurück). Damit kann man eine zusätzliche Aktualisierung des Wertes erzwingen.
- </ul><br />
- <a name="ModbusDHW300attr"></a>
- <b>Attribute</b>
- <ul>
- Nur zentral definierte Attribute werden untstützt. Im speziellen:
- <ul>
- <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
- </ul>
- </ul><br />
- </ul>
- =end html_DE
- =cut
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement