0.1.2 • Published 6 years ago

iobroker.mhcclient v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

ioBroker.mhcclient

Logo

NPM version License Downloads Issues

NPM

This adapter is for receiving the XML push messages from MH-Collector, which is a Collector for M-Bus-, wM-Bus- ans S0-Sensors. You can get the MH-Collector and a lot of measurement equipment (Liquid Flow Meters, Heat Flow Meters, Heat Cost Allocators, Electric Power Meters, ...) from http://www.messhelden.de.

The hardware is produced by Solvimus and is also distributed as easy.muc from Solvimus directly or as AHV-Collector (AlterHausVerwalter.de). Since I don't have such available, I can not test against.

Usually the measurements are uploaded to a portal site and processed to calculate the rental expenses. But with the new EU-law, which is known as DSGVO in Germany, it creates many uncertainties to give out personal data of renters to 3rd parties, especially when the data is hosted in a cloud or in an unknown place.

Therefore, I created this adapter, to receive the measuments from the Collector, store it in a history database (e.g. influx.db, depending on your iobroker config) and extract the data to calculate the billing of heat, water and electricity.

To achieve this, the following settings need to be configured on the admin pages of the collector below the Server tab:

SettingValueNote
ModeXML TCPSSL/TLS not yet supported
Interval (min)5your choice
Addressbest to use a fixed IP
Port7890depends on adapter config your selected
Directory/Ignored by mhcclient... All POSTs are processed.

Requirements

There are some other requirements for the adapter to work correctly:

Since the order of the elements in the XML files sometimes changes, it was not possible to use this as an easy index for the channels. Therefore, the OBIS-ID is used in the first place to create a channel and the USER string of a sensor if no OBIS-ID is set. If none of these exists or if not unique, data could be messed/overwritten. Therefore, I suggest to set the OBIS-ID.

OBIS-IDs (not verified)

OBIS-IDUnitPeriodShort Description
General
a-b:c.d.e*f
------------
Abstract Objects
0-0:96.1.0*255--Serial Number / Fabrication
0-0:96.8.0*255hActual valueOperating Time
0-0:97.97.0*255(Bin)Actual valueError Flags
------------
Electricity(details for d)
1-0:1.7.0*255WActual valueElectrical Power (Total +)
1-0:1.8.0*255WhActual valueElectrical Energy (Total +)
1-0:2.7.0*255WActual valueElectrical Power (Total -)
1-0:2.8.0*255WhActual valueElectrical Energy (Total -)
1-0:3.7.0*255varActual valueReactive Power (Total +)
1-0:3.8.0*255varhActual valueReactive Energy (Total +)
1-0:4.7.0*255varActual valueReactive Power (Total -)
1-0:4.8.0*255varhActual valueReactive Energy (Total -)
1-0:5.7.0*255varActual valueReactive Power (Total Q I)
1-0:5.8.0*255varhActual valueReactive Energy (Total Q I)
1-0:6.7.0*255varActual valueReactive Power (Total Q II)
1-0:6.8.0*255varhActual valueReactive Energy (Total Q II)
1-0:7.7.0*255varActual valueReactive Power (Total Q III)
1-0:7.8.0*255varhActual valueReactive Energy (Total Q III)
1-0:8.7.0*255varActual valueReactive Power (Total Q IV)
1-0:8.8.0*255varhActual valueReactive Energy (Total Q IV)
1-0:9.7.0*255VAActual valueApparent Power (Total +)
1-0:9.8.0*255VAhActual valueApparent Energy (Total +)
1-0:10.7.0*255VAActual valueApparent Power (Total -)
1-0:10.8.0*255VAhActual valueApparent Energy (Total -)
1-0:11.6.0*255AActual valueCurrent
1-0:12.7.0*255VActual valueVoltage
1-0:13.7.0*255-Actual valuePower Factor
1-0:14.7.0*255HzActual valueFrequency
1-0:16.7.0*255WhActual valueTotal Active Power
1-0:21.7.0*255WhActual valueL1 Active Power (+)
1-0:22.7.0*255WhActual valueL1 Active Power (-)
1-0:23.7.0*255varhActual valueL1 Reactive Power (+)
1-0:24.7.0*255varhActual valueL1 Reactive Power (-)
1-0:25.7.0*255varhActual valueL1 Reactive Power (Q I)
1-0:26.7.0*255varhActual valueL1 Reactive Power (Q II)
1-0:27.7.0*255varhActual valueL1 Reactive Power (Q III)
1-0:28.7.0*255varhActual valueL1 Reactive Power (Q IV)
1-0:29.7.0*255VAhActual valueL1 Apparent Power (+)
1-0:30.7.0*255VAhActual valueL1 Apparent Power (-)
1-0:31.7.0*255AActual valueL1 Current
1-0:32.7.0*255VActual valueL1 Voltage
1-0:33.7.0*255-Actual valueL1 Power Factor
1-0:34.7.0*255VActual valueL1_L2 Voltage non-standard
1-0:41.7.0*255WhActual valueL2 Active Power (+)
1-0:42.7.0*255WhActual valueL2 Active Power (-)
1-0:43.7.0*255varhActual valueL2 Reactive Power (+)
1-0:44.7.0*255varhActual valueL2 Reactive Power (-)
1-0:45.7.0*255varhActual valueL2 Reactive Power (Q I)
1-0:46.7.0*255varhActual valueL2 Reactive Power (Q II)
1-0:47.7.0*255varhActual valueL2 Reactive Power (Q III)
1-0:48.7.0*255varhActual valueL2 Reactive Power (Q IV)
1-0:49.7.0*255VAhActual valueL2 Apparent Power (+)
1-0:50.7.0*255VAhActual valueL2 Apparent Power (-)
1-0:51.7.0*255AActual valueL2 Current
1-0:52.7.0*255VActual valueL2 Voltage
1-0:53.7.0*255-Actual valueL2 Power Factor
1-0:54.7.0*255VActual valueL2_L3 Voltage non-standard
1-0:61.7.0*255WhActual valueL3 Active Power (+)
1-0:62.7.0*255WhActual valueL3 Active Power (-)
1-0:63.7.0*255varhActual valueL3 Reactive Power (+)
1-0:64.7.0*255varhActual valueL3 Reactive Power (-)
1-0:65.7.0*255varhActual valueL3 Reactive Power (Q I)
1-0:66.7.0*255varhActual valueL3 Reactive Power (Q II)
1-0:67.7.0*255varhActual valueL3 Reactive Power (Q III)
1-0:68.7.0*255varhActual valueL3 Reactive Power (Q IV)
1-0:69.7.0*255VAhActual valueL3 Apparent Power (+)
1-0:70.7.0*255VAhActual valueL3 Apparent Power (-)
1-0:71.7.0*255AActual valueL3 Current
1-0:72.7.0*255VActual valueL3 Voltage
1-0:73.7.0*255-Actual valueL3 Power Factor
1-0:74.7.0*255VActual valueL3_L1 Voltage non-standard
1-0:81.7.0*255° ?Actual valueAngles
1-0:82.7.0*255-Actual valueUnitless Quantity
1-0:91.7.0*255AActual valueNeutral Current
1-0:92.7.0*255VActual valueNeutral Voltage
1-0:94.x.0*255-Actual valueCountry Specific Identifier
1-0:96.x.0*255(Bin)Actual valueService Entry
1-0:96.50.0*0(Bin)Actual value- Net Status
1-0:97.8.0*255(Bin)Actual valueError Message
1-0:98.8.0*255?Actual valueList
1-0:99.8.0*255?Actual valueData profiles, Load Profiles P.01/P.02, Operation Log P.98/P.99
------------
Thermal
4-1:1.0.0*255-Actual valueHeat Cost Allocator (Factor)
4-1:1.2.0*0-Billing Period 0 (last year)Heat Cost Allocator (Factor)
4-1:1.2.0*1-Billing Period 1 (2 years ago)Heat Cost Allocator (Factor)
------------
Cooling
5-b:c.d.e*f---
------------
Heating
6-0:1.0.0*255WhActual valueThermal Energy (Heat)
6-0:0.1.10*0sBilling period 0 (last month)Timestamp
6-0:0.1.10*1sBilling period 1 (2 months ago)Timestamp
6-0:70.0.0*255(Bin)Actual valueCondition
6-0:96.0.0*255(Bin)Actual valueService Entry
6-0:97.0.0*255(Bin)Actual valueError Flags
............
6-0:0.1.10*100sBilling period 100 (last year)Timestamp
6-0:0.1.10*101sBilling period 101 (2 years ago)Timestamp
6-0:1.2.0*0WhBilling period 0 (last month)Thermal Energy (Heat)
6-0:1.2.0*1WhBilling period 1 (2 months ago)Thermal Energy (Heat)
6-0:1.2.0*100WhBilling period 100 (last year)Thermal Energy (Heat)
6-0:1.2.0*101WhBilling period 101 (2 years ago)Thermal Energy (Heat)
6-0:2.0.0*255m^3Actual valueVolume
6-0:8.0.0*255WActual valuePower
6-0:9.0.0*255m^3/hActual valueVolume Flow
6-0:10.0.0*255°CActual valueForward/Flow Temperature
6-0:11.0.0*255°CActual valueReturn Temperature
6-0:12.0.0*255°C, KActual valueTemperature Difference
------------
Gas
7-b:c.d.e*f
7-10:c.d.e*fBalancing Caloric Value
7-20:c.d.e*fAccounting Caloric Value
7-b:70.d.e*fCondition
7-b:99.d.e*fProfile Values
------------
Cold Water
8-1:1.0.0*255m^3Actual valueVolume
8-1:1.2.0*0m^3Billing Period 0 (last month)Volume
8-1:1.2.0*1m^3Billing Period 1 (2 months ago)Volume
------------
Warm Water
9-b:c.d.e*f---
------------
Oil
16-b:c.d.e*f---
------------
Compressed Air
17-b:c.d.e*f---
------------
Nitrogen
18-b:c.d.e*f---
------------
Cooling
5-b:c.d.e*f---

Links zu OBIS-IDs:

Billing Periods

Billing periods (the number behind the * in the OBIS-ID) is of free choice. If there is a timestamp that belongs to a value, they should get the same period ID. In my case, I prefer 0,1,2,3,4,... for month and 100, 101, 102,... for years like:

0 = end of last month
1 = 2 month ago
2 = 3 month ago
...
100 = end last year
101 = 2 years ago
...

Testing

The adapter can be tested without a MH-Collector by using one of the example files with curl:

curl -X POST @<FILENAME> http://<HOST>:<PORT>/

curl -X POST @examples/testfile.xml http://localhost:7890/

Releases

0.1.2

  • (the78mole) OBIS-ID heavily extended in README

0.1.0 - 0.1.1

  • (the78mole) npm version fixes

0.0.2 - 0.0.5

  • (the78mole) some fixes in README.md and irgnores

0.0.1

  • (the78mole) initial release

License

The MIT License (MIT)

Copyright (c) 2018 Daniel Glaser the78mole@chaintronics.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.