Porównaj commity

...

477 Commity

Autor SHA1 Wiadomość Data
Fredrik Öhrström 73dd60d67b Update xmq library. 2024-06-01 11:03:21 +02:00
Fredrik Öhrström b3771a9b8e Add another mvt combo for qwater. 2024-05-29 11:02:04 +02:00
Fredrik Öhrström 257a9c1ad2 Update documentation on how to create a new driver. 2024-05-28 17:10:56 +02:00
Fredrik Öhrström f954860d80 Add xmq drivers directory. 2024-05-28 17:01:21 +02:00
Fredrik Öhrström 251b575f68 Fix compiler warnings. 2024-05-28 15:46:30 +02:00
Fredrik Öhrström 7c117cc26c
Merge pull request #1292 from jetmcquack/patch-1
Update util.cc to fix const hex Ambiguity
2024-05-28 15:27:17 +02:00
jetmcquack 40229d81ff
Update util.cc to fix const hex Ambiguity 2024-05-28 11:21:48 +02:00
Fredrik Öhrström 8748a2d52f Add /opt/homebrew to build for macosx. 2024-05-28 00:27:27 +02:00
Fredrik Öhrström 1396fff5a0 Debug mac build. 2024-05-28 00:17:21 +02:00
Fredrik Öhrström 759160b415 Add new location for homebrews on arm macs. 2024-05-28 00:16:08 +02:00
Fredrik Öhrström 9684345cb6 Properly load tariff_nr and subunit_nr from xmq driver file.
Print error in frame if both mbus test and wmbus test fails.
2024-05-27 23:54:53 +02:00
Fredrik Öhrström 1a4169ed23
Merge pull request #1262 from PovilasID/patch-1
Documenting MQTT as telegram source
2024-04-29 23:19:23 +02:00
PovilasID aa4f1956e8
Documenting MQTT as telegram source 2024-04-29 19:49:52 +03:00
Fredrik Öhrström d90dbb196e Add another m,v,t combo for the lse_07_17 driver. 2024-04-15 08:44:14 +02:00
Fredrik Öhrström 14d021426a
Merge pull request #1245 from majonezz/patch-1
Avoid SIGSEGV in WMBusCUL::checkCULFrame
2024-04-14 16:13:26 +02:00
Michał Morański f32179a939
Avoid SIGSEGV in WMBusCUL::checkCULFrame
(cul) checkCULFrame "b2F4468506586269295620A17A2069F2"
(cul) no eol found yet, partial frame
(serial) received ascii "TMODE<0D><0A>b2F44685086625092957245C6A2069F2F6A06E0080000000000000000B9BF00000D0F0D11130512100F0F0F100F0F8E1F0F0E0D121310B241<0D><0A>b4E44B61065960200023732117A0E004005E4B5FD2A1E3DCCC84F38BDF21FD05D506BF685D50CB3AD9644F9FF7C893BF9DD0D2B64C85F703707B1965C69261E8CDF85046CDDC38F1336D67750E933854BA0C9A91240A18556E6064B<0D><0A>"
(cul) checkCULFrame "b2F4468506586269295620A17A2069F2TMODE<0D><0A>b2F44685086625092957245C6A2069F2F6A06E0080000000000000000B9BF00000D0F0D11130512100F0F0F100F0F8E1F0F0E0D121310B241<0D><0A>b4E44B61065960200023732117A0E004005E4B5FD2A1E3DCCC84F38BDF21FD05D506BF685D50CB3AD9644F9FF7C893BF9DD0D2B64C85F703707B1965C69261E8CDF85046CDDC38F1336D67750E933854BA0C9A91240A18556E6064B<0D><0A>"
(cul) bad hex for LQI and RSSI "MODE"
(cul) warning: the LQI and RSSI hex string is not properly formatted!

Thread 2 "wmbusmeters" received signal SIGSEGV, Segmentation fault.
0x571c718f in WMBusCUL::checkCULFrame (this=0xf0a03480, data=std::vector of length 339, capacity 339 = {...}, hex_frame_length=0xf07fe680,
    payload=std::vector of length 0, capacity 0, rssi_dbm=0xf07fe6c0) at src/wmbus_cul.cc:336
336         uint lqi = lqi_rssi[0]>>1;
(gdb)
2024-04-14 15:16:56 +02:00
Fredrik Öhrström a32fcfdf9a When generating IV for AES-CTR zero out H and R bit. 2024-04-13 13:42:25 +02:00
Fredrik Öhrström efcc41d107 Add support for GJ VIF. 2024-04-09 20:47:42 +02:00
Fredrik Öhrström a69e547a17 Update drivers with signedness. Fix tests. 2024-04-09 11:11:17 +02:00
Fredrik Öhrström 23f2279a64 Separate VIF scaling and DIF signedness. Default to signed DIF binary integers. 2024-04-09 10:41:30 +02:00
Fredrik Öhrström 05edab0882 Add help on intsalling jq. 2024-04-08 17:02:35 +02:00
Fredrik Öhrström ff72e1debc Add dynamic driver lookup bits translation to strings. 2024-04-04 20:59:03 +02:00
Fredrik Öhrström c1509f6139
Merge pull request #1218 from jsreynaud/better_message_for_vife
Adding a better description of combinable extension vife
2024-03-29 16:19:50 +01:00
Fredrik Öhrström 9facddf019 Add support for the same fully specified secondary address printed by libmbus after doing a bus scan. 2024-03-28 12:41:00 +01:00
Fredrik Öhrström 9a34a55abb Fail decoding if too many difes/vifes are found. 2024-03-28 12:41:00 +01:00
Fredrik Öhrström 465a450a8b
Merge pull request #1196 from avandorp/patch-1
topaseskr: Fix wording for date values
2024-03-22 20:23:08 +01:00
Jean-Samuel REYNAUD 9576550f85
Adding a better description of combinable extension vife 2024-03-22 16:25:49 +01:00
Fredrik Öhrström 1f2cd10160 Update README. 2024-03-03 19:40:06 +01:00
Fredrik Öhrström 8c09f7b2d8 The required field does not contribute to testing of the address expressions before. 2024-03-03 19:34:00 +01:00
Fredrik Öhrström 3247a4a576 Update README. 2024-03-03 15:44:59 +01:00
Fredrik Öhrström 23779cb9f7 Add option --identitymode=... 2024-03-03 12:57:40 +01:00
Fredrik Öhrström 5962e727ff Handle more address rules. 2024-03-02 22:46:50 +01:00
Arthur van Dorp 03d95e780e topaseskr: Fix wording for date values
Those are period end dates, not start dates. That was my bad, sorry.
2024-03-02 21:06:59 +01:00
Fredrik Öhrström 11c83c1f37 Remove unused code. 2024-03-02 15:42:39 +01:00
Fredrik Öhrström 7634b95438 New advanced addressing works. 2024-03-02 15:30:25 +01:00
Fredrik Öhrström 78e7c47503 Add filter_out to address expression. 2024-03-01 12:00:49 +01:00
Fredrik Öhrström 0c98b474bb Fix tests. 2024-02-27 11:52:45 +01:00
Fredrik Öhrström 9d27ab3fb3 New source file address.cc for mbus addressing. 2024-02-26 11:44:47 +01:00
Fredrik Öhrström c21efd1d69
Merge pull request #1187 from testuser7/docker-tag
Improve workflow syntax
2024-02-23 08:51:43 +01:00
testuser7 67230b4213 Improve workflow syntax 2024-02-22 18:52:59 +01:00
Fredrik Öhrström 569efa3af2 Version 1.16.1 2024-02-22 2024-02-22 18:46:05 +01:00
Fredrik Öhrström 58dd9d32ff
Merge pull request #1186 from testuser7/docker-tag
Fix docker tag creation
2024-02-22 18:45:13 +01:00
testuser7 7f7f7e4df4 Fix docker tag creation 2024-02-22 18:39:41 +01:00
Fredrik Öhrström af83f15ca9 Version 1.16.0 2024-02-22 2024-02-22 17:49:53 +01:00
Fredrik Öhrström 0587c6d1dd
Merge pull request #1185 from jsreynaud/patch-1
Update README.md
2024-02-22 17:46:34 +01:00
Jean-Samuel Reynaud dd45c14970
Update README.md
Fix an inconstancy between code that use --driverslib and doc that say --dirverlib...
2024-02-22 16:28:14 +01:00
Fredrik Öhrström 097f91fac0 Add dynaic driver add_combinable and storage_nr. 2024-02-15 11:40:30 +01:00
Fredrik Öhrström dbd99698b8 Version 1.15.0 2024-02-14 2024-02-14 17:52:32 +01:00
Fredrik Öhrström 40605ebb40 Version 1.15.0-RC2 2024-02-14 2024-02-14 16:56:39 +01:00
Fredrik Öhrström 74e6c89af1
Merge pull request #1178 from testuser7/rtl_reset
Do not install librtlsdr-dev and rtl-sdr packages
2024-02-14 14:04:50 +01:00
testuser7 4634431c59 Do not install librtlsdr-dev and rtl-sdr packages 2024-02-13 23:47:09 +01:00
Fredrik Öhrström c3d1b6f3c5
Merge pull request #1167 from testuser7/rtl_reset
Update docker image, add rtl_reset, rtl_sdr
2024-02-13 17:08:28 +01:00
Fredrik Öhrström 4b55407aa9 Version 1.15.0-RC1 2024-02-13 2024-02-13 15:26:07 +01:00
testuser7 97f2082dbc Add rtl_reset to docker image 2024-02-12 22:05:26 +01:00
testuser7 a5f4f43375 Build librtlsdr from source 2024-02-12 22:05:26 +01:00
testuser7 000e4f89ad Use latest docker alpine image 2024-02-12 22:05:26 +01:00
Fredrik Öhrström 14ca481c63 Fix rtl_wmbus -f detection. 2024-02-12 14:07:53 +01:00
Fredrik Öhrström 0d0338c9a4 Add on_time_h,battery_pct to q400 driver, not qualcosonic driver. 2024-02-12 10:06:09 +01:00
Fredrik Öhrström 4d3e306f30 Add on_time_h and batter_pct to qualcosonic driver. Add Percentage unit. Add 'keep open' tag and update workflow. 2024-02-12 09:34:59 +01:00
Fredrik Öhrström 378c367475 Fix typo. 2024-02-12 01:22:42 +01:00
Fredrik Öhrström 004d8b751f Do not try to load the builtin driver if --driver=<file> has been used already. 2024-02-12 01:16:34 +01:00
Fredrik Öhrström 72ecb86b91 Add use=<field> to use optional field from library. 2024-02-12 00:55:04 +01:00
Fredrik Öhrström 24b47fbd48 Temporarily avoid building xmq when testing after deb build. 2024-02-12 00:13:13 +01:00
Fredrik Öhrström 8efad28289 Remove xslt1 from docker since no tests are performed. 2024-02-11 23:40:41 +01:00
Fredrik Öhrström 46fc3995bd Remove xslt1 from docker run deps since it is only used for building. 2024-02-11 23:35:26 +01:00
Fredrik Öhrström 9b6c84d2f2 Remove xslt1 from stage package since it is only used for building. 2024-02-11 23:32:17 +01:00
Fredrik Öhrström 54a8930918 Add necessary libxslt deps. 2024-02-11 23:27:52 +01:00
Fredrik Öhrström f446efa11d Clone xmq from correct url. 2024-02-11 23:18:51 +01:00
Fredrik Öhrström 2610af43b8 Updated CHANGES 2024-02-11 23:12:53 +01:00
Fredrik Öhrström fefbf507fe Add elster,iperl text based drivers. 2024-02-11 23:06:59 +01:00
Fredrik Öhrström 04ed4d7628 Add --driverdir=<dir> and --driver=<file> for loading drivers from text files. 2024-02-11 00:12:31 +01:00
Fredrik Öhrström 440ea263b1 Use mktemp in a way that is supported by busybox. 2024-01-31 20:47:06 +01:00
Fredrik Öhrström 8aabcdaca0
Merge pull request #1156 from wmbusmeters/dependabot/github_actions/peter-evans/dockerhub-description-4
Bump peter-evans/dockerhub-description from 3 to 4
2024-01-31 20:43:49 +01:00
Fredrik Öhrström a9862be62c
Merge pull request #1157 from wmbusmeters/dependabot/github_actions/peter-evans/repository-dispatch-3
Bump peter-evans/repository-dispatch from 2 to 3
2024-01-31 20:43:35 +01:00
dependabot[bot] 4d89d119da
Bump peter-evans/repository-dispatch from 2 to 3
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 2 to 3.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3)

---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-25 21:19:15 +00:00
dependabot[bot] eea8307f22
Bump peter-evans/dockerhub-description from 3 to 4
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 3 to 4.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-25 21:19:09 +00:00
Fredrik Öhrström 03e03905ec Add missing cstdint since gcc 13 is more picky. 2024-01-24 12:33:59 +01:00
Fredrik Öhrström fe04152246
Merge pull request #1150 from wmbusmeters/BIBOLV-patch-2
Update Dockerfile
2024-01-24 11:51:00 +01:00
BIBO f33a676dee
Update Dockerfile
Rolling back to build rtl_433 from source as requested in https://github.com/wmbusmeters/wmbusmeters/issues/1149
2024-01-21 22:03:18 +02:00
Fredrik Öhrström 12cb6c9d17
Merge pull request #1146 from petr-svarc/patch-1
added missing closing bracket
2024-01-18 18:19:01 +01:00
Petr Švarc 6641def49f
added missing closing bracket 2024-01-18 18:05:12 +01:00
Fredrik Öhrström 3d1319bd78
Merge pull request #1121 from wmbusmeters/BIBOLV-patch-3
Update Dockerfile
2024-01-18 17:37:57 +01:00
Fredrik Öhrström 1ab3368b8c
Merge pull request #1119 from wmbusmeters/dependabot/github_actions/actions/stale-9
Bump actions/stale from 8 to 9
2024-01-18 15:50:53 +01:00
Fredrik Öhrström b6b6fe85d0
Merge pull request #1129 from Andi252/fb_fix_test_mkradio3
Added output for text_t1_meters.sh, when test failed
2024-01-18 15:49:57 +01:00
Fredrik Öhrström b49309bce3 Add missing && in docker file. 2024-01-18 15:47:03 +01:00
Fredrik Öhrström 42511190e7 Do not test rtl_wmbus for -f option if CMD is overridden. 2024-01-18 15:40:15 +01:00
Fredrik Öhrström 4f21c04804 Add warning when rtl_wmbus data flow freezes. Improve README. 2024-01-18 15:24:42 +01:00
Fredrik Öhrström 9a0a818fee Update CHANGES 2024-01-18 15:04:58 +01:00
Fredrik Öhrström abad0c8d74 Use new rtl_wmbus option -f to add flow control. If rtl_sdr stops sending samples to rtl_wmbus it will not exit with an error message. Wmbusmeters detects this and restarts the pipeline. Errors from rtl_sdr can be found in a /tmp/tmp....wmbusmeters_rtlsdr file. 2024-01-18 14:56:21 +01:00
Fredrik Öhrström 704e715582 Merge branch 'AddRTLWMBUSFlowCheck' 2024-01-18 11:00:35 +01:00
Fredrik Öhrström 866df740ad Add energy MWh VIF 7b00-7b01 and improve kamheat driver. 2024-01-15 15:29:43 +01:00
Andreas Horrer cbc422ac94 Merge remote-tracking branch 'origin/master' into fb_fix_test_mkradio3 2024-01-12 20:48:43 +01:00
Fredrik Öhrström 295053ebd6 Add more fields to the iem3000 driver. 2024-01-11 21:01:08 +01:00
Fredrik Öhrström b6878b503c Add iem3000 driver. 2024-01-11 20:36:10 +01:00
Fredrik Öhrström 7af4db244d Update test with new vif ranges: Medium Manufacturer. 2024-01-11 20:26:17 +01:00
Fredrik Öhrström fd0a4b6d63 Skip test for MacOS that does not use bash. 2024-01-11 20:24:40 +01:00
Fredrik Öhrström cddcc9ae26 Add iem3000 driver. 2024-01-11 18:34:46 +01:00
Fredrik Öhrström c08bf05521 Fix 2023-2024 in tests and update xmq.c 2024-01-09 23:31:41 +01:00
Andreas Horrer 757b56d2c8 change data for problem with year encoding in mkradio3 2024-01-01 20:40:41 +01:00
Andreas Horrer f69f9d6aa7 Changed test data due to problems with date encoding 2024-01-01 20:31:45 +01:00
Andreas Horrer dd2df53280 Added output for test_t1_meter.sh to see which test failed 2024-01-01 20:31:13 +01:00
BIBO dc783e1e87
Update Dockerfile
Changing alpine repo where latest version is available. 
With latest version also latest rtl-sdr is available (0.8.0-r0), also rtl_433 is available as package, so no need to build it from source. 
Tested raspi 32 and 64bit with rtl-sdr, HA tests are not done.
2023-12-09 22:15:49 +02:00
dependabot[bot] d22701f978
Bump actions/stale from 8 to 9
Bumps [actions/stale](https://github.com/actions/stale) from 8 to 9.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 21:53:47 +00:00
Fredrik Öhrström 331c5a4018 Correct test that expects a Repeater in the list of meter types. 2023-12-04 13:12:16 +01:00
Fredrik Öhrström 73bb7ef096 Test uses 'echo -n' which needs bash. 2023-12-04 13:03:36 +01:00
Fredrik Öhrström 10fbac056b Add test case to iwmtx5 driver. 2023-12-04 12:10:39 +01:00
Fredrik Öhrström aff37db2c1
Merge pull request #1095 from sunflowerenergias/master
Update driver_iwmtx5.cc
2023-12-04 12:01:24 +01:00
Fredrik Öhrström b011505d7b
Merge pull request #1047 from simonr-de/master
Update driver_sharky
2023-12-04 11:45:51 +01:00
Fredrik Öhrström b0cb4fa44b
Merge pull request #1114 from pimlie/fix-date-format
fix: date format should use semicolon as time separator
2023-12-04 11:44:31 +01:00
Fredrik Öhrström 044a522399 Update CHANGES. 2023-12-04 11:40:01 +01:00
Fredrik Öhrström 47f3256a50 Add test case to kamheat. 2023-12-04 11:39:25 +01:00
Fredrik Öhrström 0c3fa02d4f
Merge pull request #1109 from Jacman777/master
Update driver_kamheat.cc
2023-12-04 11:33:35 +01:00
Fredrik Öhrström 8077791846
Merge pull request #1115 from pimlie/feat-add-driver-lansen-repeater
feat: add driver for lansen repeater (0x0b)
2023-12-04 11:23:23 +01:00
Fredrik Öhrström 2605ff9cb3
Merge pull request #1113 from pimlie/feat-exec-shell-on-meter-add
feat: add support to run shell script when meter is first seen
2023-12-04 11:17:02 +01:00
pimlie 6a9cfcee21 test: add test for lansenrp driver 2023-11-29 20:34:24 +01:00
pimlie efea401f6a feat: add driver for lansen repeater (0x0b) 2023-11-29 19:32:02 +01:00
pimlie 4c194ba802 fix: date format should use semicolon as time separator 2023-11-29 11:17:21 +01:00
pimlie db37acbcdc feat: add support to run shell script when meter is first seen 2023-11-29 10:49:37 +01:00
Jacman777 92fb04e246
Update driver_kamheat.cc
Adding Kamstrup Multical 402 Heat Meter
2023-11-25 02:07:49 +01:00
Fredrik Öhrström b32236f600 Rename woot to target_m3 and target_datetime for hydrus driver. Where target is the total consumption at the end of the previous month. 2023-11-16 11:51:36 +01:00
Sergio Catalan 64602a079f Update driver_iwmtx5.cc
Update driver iwmtx5
2023-11-16 08:10:54 +01:00
Fredrik Öhrström 162658a29a
Merge pull request #1090 from Andi252/fb_add_itron_coldwatermeter_id
Added cold water meter type to itron driver
2023-11-12 19:37:40 +01:00
Fredrik Öhrström 9fbb49b0fc Change name of unknown field in hydrus to total_at_woot_m3 this will prevent overlap with total_at_date_m3. 2023-11-12 18:19:21 +01:00
Fredrik Öhrström 82234acd21 Add cmath for macosx. 2023-11-12 17:54:14 +01:00
Fredrik Öhrström c4b9f0d104 Always detect negative BCD values. Also detect BCD values with all F and treat them as missing data, ie. null in fields and not printed in json. 2023-11-12 15:29:30 +01:00
Fredrik Öhrström 9a99daf0ed You can now do: wmbusmeters --analyze=driver.xmq <hex> 2023-11-12 13:41:35 +01:00
Fredrik Öhrström 3696118db1 Add more loadable driver features. 2023-11-12 13:23:37 +01:00
Fredrik Öhrström 92090073cb Use macros for debug/verbose/trace to avoid calculation of args if debug/verbose/trace are not enabled. 2023-11-12 13:16:51 +01:00
Fredrik Öhrström c5dc2ada51 Add more loadable driver features. 2023-11-12 12:36:22 +01:00
Andreas Horrer f4299e2d6f Added itron cold water meter 2023-11-11 13:23:59 +01:00
Fredrik Öhrström a385737984 Better error messages when trying to load a driver file with errors. 2023-11-10 21:33:09 +01:00
Fredrik Öhrström 22d6880385 Add test for non-existant driver. 2023-11-06 21:04:40 +01:00
Fredrik Öhrström b9306be914 Only try loading driver from disk if the driver name ends with .xmq and is a valid file. 2023-11-06 20:41:30 +01:00
Fredrik Öhrström 3a097388f5 Update README.md with wmbusmeters usage of librtlsdr. 2023-10-31 10:17:41 +01:00
Fredrik Öhrström b2dd2801db
Merge pull request #1045 from geraldhuber/patch-1
Update README.md with paragraph about SDR naming (swradio0...255)
2023-10-31 10:12:04 +01:00
Fredrik Öhrström 6f0773ae7a Add missing include for int64_t etc. 2023-10-14 16:28:16 +02:00
Fredrik Öhrström 128aa77b78 Add libxml2 dependency. 2023-10-14 16:21:50 +02:00
Fredrik Öhrström 872bc53ace
Merge pull request #1052 from wmbusmeters/AddConfigFiles
Initial support for loadable drivers.
2023-10-14 16:10:57 +02:00
Fredrik Öhrström a1f0911a57 Add missing loadable driver files. 2023-10-14 15:58:29 +02:00
Fredrik Öhrström f017694d78 Initial support for loadable drivers. 2023-10-14 15:55:55 +02:00
Fredrik Öhrström 6e3bac97d4 Handle amb8465 dongle with command mode enabled for incoming telegrams. 2023-10-11 17:07:39 +02:00
simonr-de 7c5949d6b1
Update driver_sharky.cc
Changed VifScaling to AutoSigned to fix problem with negative values.
2023-10-09 16:12:35 +02:00
geraldhuber eb6311fec3
Update README.md with paragraph about SDR naming (swradio0...255) 2023-10-07 20:30:33 +02:00
Fredrik Öhrström ce6e2822e5
Merge pull request #1028 from wmbusmeters/dependabot/github_actions/docker/setup-qemu-action-3
Bump docker/setup-qemu-action from 2 to 3
2023-09-15 09:23:02 +02:00
Fredrik Öhrström eb9c90bd2d
Merge pull request #1029 from wmbusmeters/dependabot/github_actions/docker/login-action-3
Bump docker/login-action from 2 to 3
2023-09-15 09:22:41 +02:00
Fredrik Öhrström a8040e5eae
Merge pull request #1030 from wmbusmeters/dependabot/github_actions/docker/setup-buildx-action-3
Bump docker/setup-buildx-action from 2 to 3
2023-09-15 09:22:22 +02:00
Fredrik Öhrström 099fc1472c
Merge pull request #1031 from wmbusmeters/dependabot/github_actions/docker/metadata-action-5
Bump docker/metadata-action from 4 to 5
2023-09-15 09:22:00 +02:00
Fredrik Öhrström c6d0b79984
Merge pull request #1032 from wmbusmeters/dependabot/github_actions/docker/build-push-action-5
Bump docker/build-push-action from 4 to 5
2023-09-15 09:21:44 +02:00
dependabot[bot] 3c7b37a14b
Bump docker/build-push-action from 4 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:54:17 +00:00
dependabot[bot] 143f4f2ff0
Bump docker/metadata-action from 4 to 5
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:54:11 +00:00
dependabot[bot] bc90cf36d3
Bump docker/setup-buildx-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:54:01 +00:00
dependabot[bot] 108712be3b
Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:53:54 +00:00
dependabot[bot] c4a4d05e46
Bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 21:53:48 +00:00
Fredrik Öhrström 239a39de0e
Merge pull request #1025 from wmbusmeters/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-05 14:40:32 +02:00
dependabot[bot] be3c413664
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 21:48:53 +00:00
Fredrik Öhrström 0b852fb420 Generate proper names for string fields depending on eg tariff_counter etc. 2023-08-27 22:18:27 +02:00
Fredrik Öhrström 9084a0323f Update tests to accomodate new json ordering of keys. 2023-08-27 21:36:17 +02:00
Fredrik Öhrström e577c0b30c Update tests to accomodate new json ordering of keys. 2023-08-27 21:10:18 +02:00
Fredrik Öhrström 71fe4b4392 Store numeric values based on name+unit instead of name+quantity. 2023-08-27 17:33:32 +02:00
Fredrik Öhrström 94d4ddce16 Migrate from post-process-print to pre-process-store then print store. 2023-08-27 16:48:40 +02:00
Fredrik Öhrström 86ba358c7d Adding more fields to abbb23 driver. 2023-08-27 08:52:27 +02:00
Fredrik Öhrström 906c288298 Add more fields to abbb23. 2023-08-26 20:08:47 +02:00
Fredrik Öhrström a920e25d45 Add new units for phase angle: deg rad. Add more fields to abbb23. 2023-08-26 17:05:52 +02:00
Fredrik Öhrström 414e55a17a Adding more fields to abbb23 driver. 2023-08-26 09:21:22 +02:00
Fredrik Öhrström 1faabb7526 Adding more fields to abbb23 driver. 2023-08-22 22:28:04 +02:00
Fredrik Öhrström a41bce1145 Accept +1 and +0 in comparison to help test pass on slow machines. 2023-08-16 21:56:50 +02:00
Fredrik Öhrström d0f9ffc820 Added test case for hydrodigit driver. 2023-08-16 21:37:06 +02:00
Fredrik Öhrström b8ac245aeb
Merge pull request #1013 from PovilasID/master
Adding: 0x17 version to 0x06 to hydrodigit device
2023-08-16 21:33:19 +02:00
Fredrik Öhrström b368647c73 Reset rtlwmbus pipeline if rtl_wmbus reports loss of flow of data. 2023-08-16 19:56:23 +02:00
Fredrik Öhrström 81505354fc Add correct option to rtl_wmbus for flow checking. 2023-08-16 18:07:34 +02:00
Fredrik Öhrström bd0747eefe Enable stderr output from rtl_sdr in --debug log and enable data flow check in rtl_wmbus to abort if incoming data stops flowing. 2023-08-16 16:22:01 +02:00
PovilasID c43b8da2bf
Adding: 0x17 version to 0x06 device 2023-08-10 16:31:46 +03:00
Fredrik Öhrström 765f38cdc4
Merge pull request #1005 from bordeux/master
Add support to Makefile for Darwin/MacOS platform
2023-07-31 11:15:32 +02:00
Chris Bednarczyk 1c960475ca Add support to Makefile for Darwin/MacOS platform 2023-07-30 20:03:02 +02:00
Chris Bednarczyk 95a4e15baa Add support to Makefile for Darwin/MacOS platform 2023-07-30 19:53:58 +02:00
Chris Bednarczyk f7b70e4c64 Add support to Makefile for Darwin/MacOS platform 2023-07-30 19:44:41 +02:00
Fredrik Öhrström 217f0a25fe Add another Itron water meter version. 2023-07-21 10:41:24 +02:00
Fredrik Öhrström ab9d612b63 Version 1.14.0 2023-07-02 2023-07-02 11:43:08 +02:00
Fredrik Öhrström 2bc88ba1bf Version 1.14.0-RC1 2023-07-02 2023-07-02 10:16:53 +02:00
Fredrik Öhrström b9e6f3f028 Update CHANGES and README. 2023-07-02 10:16:09 +02:00
Fredrik Öhrström a13104125a Added test case for topaseskr with negative flow. 2023-06-28 12:26:15 +02:00
Fredrik Öhrström b64c3e7ccd
Merge pull request #973 from cguedel/patch-1
[Topas ES KR] Handle negative values for flow
2023-06-28 12:06:52 +02:00
Fredrik Öhrström 1611f12753
Merge pull request #971 from stigger/qds_walkby
QDS walk-by: check length before attempting to parse the proprietary …
2023-06-28 12:06:31 +02:00
Fredrik Öhrström 876b5ce0af Adjust install script to create dirs before realpath. 2023-06-28 10:46:50 +02:00
Fredrik Öhrström c1be4b6c34
Merge pull request #974 from travnick/master
Stop installation script on error
2023-06-28 09:49:59 +02:00
Mikołaj Milej 77ad8410eb
Break instalation script on error 2023-06-05 11:44:28 +02:00
Christian Güdel c63cb1ef01
Handle negative values for flow 2023-06-04 22:07:33 +02:00
Vyacheslav Karpukhin 13d18ef711 QDS walk-by: check length before attempting to parse the proprietary fields 2023-06-01 02:55:18 +02:00
Fredrik Öhrström 53c589ed11 Added more fields to em24 driver. 2023-05-29 08:27:52 +02:00
Fredrik Öhrström 17791e5fb2 Fix nc test to run on computers without dns hostname. 2023-05-27 12:08:23 +02:00
Fredrik Öhrström f377ade8c7 Improve defines checks for support for listing ttys. 2023-05-27 11:49:25 +02:00
Fredrik Öhrström c85fd3691c Added another mfct/type/version combo to em42 driver and the power_kw field. 2023-05-26 08:27:05 +02:00
Fredrik Öhrström ccac483b1e Update CHANGES and README. 2023-05-23 15:06:05 +02:00
Fredrik Öhrström c14b7dd8f9 Fix test. 2023-05-23 14:42:33 +02:00
Fredrik Öhrström 14aded94ca
Merge pull request #963 from stigger/qds_walkby
Add partial support for proprietary Q walk-by telegrams (qheat, qwate…
2023-05-23 14:30:49 +02:00
Fredrik Öhrström f174e98423 Fix test. 2023-05-23 13:10:04 +02:00
Fredrik Öhrström 572d8f3a27
Merge pull request #968 from pvagner/patch1
lansenth driver: parse temperature as AutoSigned in order to see negative values
2023-05-23 12:55:34 +02:00
Peter Vágner f11e72cfdf Also interpret average temperature values as signed integers + add telegram output for testing 2023-05-23 09:34:26 +02:00
Peter Vágner 86c39e5570 lansenth driver: parse temperature as AutoSigned in order to see negative values 2023-05-22 15:41:46 +02:00
Fredrik Öhrström f26b56caff Add more fields to ultraheat driver and a new test case. 2023-05-20 13:03:19 +02:00
Fredrik Öhrström 247829d9a6
Merge pull request #966 from demetz/patch-1
consider negative values for flow and power
2023-05-20 12:45:43 +02:00
demetz d9476f114e
consider negative values for flow and power
flow can be negative
power can also be negative, for example if return temperature > supply temperature or flow is reversed
2023-05-20 12:39:41 +02:00
Vyacheslav Karpukhin 0a7f8a8e2b Add partial support for proprietary Q walk-by telegrams (qheat, qwater drivers) 2023-05-19 03:46:29 +02:00
Fredrik Öhrström 6a14bb8c77 Add testdriver for wme5. 2023-05-13 08:58:57 +02:00
Fredrik Öhrström f5e4606778 Add range check to aldreadyDecryptedCBC. 2023-05-12 21:32:40 +02:00
Fredrik Öhrström 205b5593a8 Print warning if decode of zero length telegram is attempted. 2023-05-12 21:05:36 +02:00
Fredrik Öhrström 006c88239f Restore proper register sizes for apator162. 2023-05-12 20:19:56 +02:00
Fredrik Öhrström 6fcdaca8ad Log the correct expected length when the length byte is wrong. 2023-05-12 19:58:08 +02:00
Fredrik Öhrström 2983957e32 Add warning when a telegram with a bad length byte is used. 2023-05-12 19:42:32 +02:00
Fredrik Öhrström f1858c028f Add new driver iwmtx5. 2023-05-12 11:08:28 +02:00
Fredrik Öhrström 3dd7c0c2c1 Remove unnecessary flags in new driver. 2023-05-12 10:54:29 +02:00
Fredrik Öhrström 217ab96f98
Merge pull request #956 from BIBOLV/master
Add file - driver_hcae2.cc
2023-05-12 10:52:27 +02:00
Fredrik Öhrström 39ed3d2a52 Reduce risk of slow test computer failing test. 2023-05-12 10:02:38 +02:00
Fredrik Öhrström 54012a0f30 Improve error reporting for failed registers. 2023-05-12 09:45:25 +02:00
Fredrik Öhrström 15aba2318f Add three more register sizes in the apator162 driver. 2023-05-12 09:28:41 +02:00
BIBO 4ce0834ac6
Add files via upload 2023-05-09 14:09:21 +03:00
Fredrik Öhrström acaf159f33 Check if installed netcat is the right version. Skip nc tests if not. 2023-05-08 20:09:40 +02:00
Fredrik Öhrström 88a811d434 Correct spelling errors. 2023-05-08 14:38:39 +02:00
Fredrik Öhrström b0bca78c78 Update copyright file. 2023-05-08 12:56:20 +02:00
Fredrik Öhrström 3fdd0fb4fe
Merge pull request #954 from BIBOLV/master
Delete repository.json
2023-05-07 18:15:16 +02:00
BIBOLV fd1d8daff9 Delete repository.json
Remove residual ha-addon file.
2023-05-07 18:49:30 +03:00
Fredrik Öhrström 262c731aca Update config.guess and deb build. 2023-05-07 17:21:38 +02:00
Fredrik Öhrström 14bf9868cc Update deb build. 2023-05-07 17:12:57 +02:00
Fredrik Öhrström 9afc8c85fd Version 1.13.1 2023-05-07 2023-05-07 12:35:42 +02:00
Fredrik Öhrström 3d98997bdf Version 1.13.1-RC1 2023-05-07 2023-05-07 12:34:22 +02:00
Fredrik Öhrström e887a8847e Invoking make install will stop if binary not already built. 2023-05-07 12:26:04 +02:00
Fredrik Öhrström 6913d5e906 Version 1.13.0 2023-05-07 2023-05-07 09:34:36 +02:00
Fredrik Öhrström 159b2b6469 Version 1.13.0-RC1 2023-05-07 2023-05-07 09:24:32 +02:00
Fredrik Öhrström 891dd90a4e Fix fuzzing build. 2023-05-06 21:11:40 +02:00
Fredrik Öhrström 45b1a65b7f Remove ncurses dependencies. 2023-05-06 20:48:05 +02:00
Fredrik Öhrström 509a810764 Add --purge to uninstall script, remove wmbusmeters-admin and add deb_local build target. 2023-05-06 20:44:52 +02:00
Fredrik Öhrström 98ce7eae2c Work on deb generation. 2023-05-06 08:13:21 +02:00
Fredrik Öhrström 41540c869d Remove ha-addon directory which is now handled by a separate repository. 2023-05-06 08:09:40 +02:00
Fredrik Öhrström 4c59363641 Prepend isnan with :: to satisfy CentOS compiler. 2023-05-02 17:52:00 +02:00
Fredrik Öhrström d135ed98bd
Merge pull request #937 from DeDragonSlayer/master
amiplus - add maximum power consumption field. This is calculated as …
2023-04-18 20:37:14 +02:00
DeDragonSlayer 9c9bd409fe amiplus - reverted default field list to original state 2023-04-18 19:12:17 +02:00
Fredrik Öhrström 5e548ce3ab Properly handle m3 unit in calculations. 2023-04-18 16:47:42 +02:00
Fredrik Öhrström fa725020e3 Improve error message when formula constant number lacks a unit. 2023-04-18 13:56:23 +02:00
Fredrik Öhrström 7ccbaeb154 Update hydrocalm3 test case. 2023-04-18 13:13:12 +02:00
Fredrik Öhrström abd72dcdf7
Merge pull request #943 from wmbusmeters/BIBOLV-patch-1
Update driver_hydrocalm3.cc
2023-04-18 13:10:23 +02:00
Fredrik Öhrström 9b1a138f8e Add more fields to sharky driver. 2023-04-18 11:17:41 +02:00
BIBO 60c9fe7a18
Update driver_hydrocalm3.cc 2023-04-14 05:05:26 +03:00
BIBO 24c4fda371
Update driver_hydrocalm3.cc 2023-04-14 04:49:27 +03:00
BIBO 706ea1ca28
Update driver_hydrocalm3.cc
Adding HYDROCAL-M4 - https://github.com/wmbusmeters/wmbusmeters/issues/942
Judging from telegram and documentation all important fields in standard telegram are described. Manufacturer specific one could be battery percentage, judging from documentation.
2023-04-14 04:35:34 +03:00
Fredrik Öhrström f1c64230db
Merge pull request #938 from BIBOLV/master
Update kem import script
2023-04-11 09:21:49 +02:00
BIBOLV 499adec70f Update kem-extract.sh 2023-04-07 21:19:59 +03:00
BIBOLV 0603de6f72 Update kem-import.py 2023-04-06 23:04:41 +03:00
BIBOLV 009a51d6db Update kem import script
Switch pycrypto package to cryptography and add possibility to process also kem2 files
2023-04-06 22:27:20 +03:00
DeDragonSlayer 6729d46957 amiplus - add maximum power consumption field. This is calculated as the maximum value of 15-minute consumption averages, reset on 1st of each month. If the calculated max power consumption exceeds the value on the contract with power company, the end user will pay penalty fees. 2023-04-02 13:45:58 +02:00
BIBO c865e88ccf
Update snapcraft.yaml
Adding serial-port plug to snap to be able to work with mbus.
2023-03-28 15:52:51 +03:00
Fredrik Öhrström 3177c44c82
Merge pull request #925 from wmbusmeters/dependabot/github_actions/actions/stale-8
Bump actions/stale from 7 to 8
2023-03-24 08:30:50 +01:00
dependabot[bot] c49f834c0b
Bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-23 22:17:32 +00:00
Fredrik Öhrström 3a97c9a453 Fix bugs in kem-import script. 2023-03-22 11:03:57 +01:00
Fredrik Öhrström 0297e7c329 Add write permission to issues for close stale workflow. 2023-03-17 13:32:20 +01:00
Fredrik Öhrström 152e28427b Remove unnecessary repo token. 2023-03-16 20:06:29 +01:00
Fredrik Öhrström 5c9b1aaa0c Change default fields for aerius driver. 2023-03-16 18:39:21 +01:00
Fredrik Öhrström bd6bb193d0
Merge pull request #918 from BIBOLV/master
Create driver_aerius.cc
2023-03-16 18:30:51 +01:00
BIBOLV 14b242c48c Update driver_aerius.cc 2023-03-16 19:04:56 +02:00
BIBO 1ad75dac79
Update close_stale_issues.yml [no ci] 2023-03-16 15:15:19 +02:00
BIBOLV 93a966b5ee Create driver_aerius.cc
Add support for DIEHL AERIUS Gas Meter - https://github.com/wmbusmeters/wmbusmeters/issues/917
2023-03-16 01:08:18 +02:00
BIBO a1d55b33e6
Merge pull request #915 from BIBOLV/master
Update ha addon version and changelog
2023-03-13 20:48:29 +02:00
BIBOLV 86f26a372b Update ha addon version and changelog 2023-03-13 20:36:19 +02:00
Fredrik Öhrström a6180b7115 Add operating_time_h to kamheat driver. 2023-03-13 18:27:09 +01:00
Fredrik Öhrström 8e31caa015 Add new auto-detect combo to kamheat driver. 2023-03-13 18:06:04 +01:00
Fredrik Öhrström 5e0bcbe3f0 Fix bug where an mbus telegram was mistakenly detected as wmbus. 2023-03-13 17:58:51 +01:00
Fredrik Öhrström 5a2f3c22d1 Version 1.12.0 2023-03-12 2023-03-12 21:44:44 +01:00
Fredrik Öhrström 2abafde047 Version 1.12.0-RC1 2023-03-12 2023-03-12 20:50:50 +01:00
Fredrik Öhrström 1513dab184 Update CHANGES, README and release script. 2023-03-12 20:50:31 +01:00
Fredrik Öhrström 3dc36a88c2
Merge pull request #912 from BIBOLV/master
Changing links to new repo
2023-03-12 09:50:45 +01:00
BIBOLV d633ff9eaa Changing links to new repo
Changing in links weetmuts to wmbusmeters
2023-03-11 17:43:07 +02:00
BIBO a3ea9d28ad
Merge pull request #910 from thecem/patch-8
Change meters default to an array
2023-03-11 16:42:10 +02:00
thecem bb12515006
Change meters default to an array 2023-03-11 06:54:52 +01:00
Fredrik Öhrström e9e6c32383
Merge pull request #905 from petterreinholdtsen/deb-control-fixes
Corrected deb/control typos and misfeatures.
2023-03-06 21:38:16 +01:00
Fredrik Öhrström 688b073d24 Update to new docker location. 2023-03-06 21:27:41 +01:00
Fredrik Öhrström 960f24d261 Update dockerhub settings. 2023-03-06 11:16:24 +01:00
Petter Reinholdtsen a0cf8696b8 Corrected deb/control typos and misfeatures.
Moved runtime dependency adduser from source to binary dependency.

Added build dependency netcat-openbsd needed during testing.

Corrected Suggest->Suggests typo.

Fixes #903.
2023-03-05 22:24:31 +01:00
Fredrik Öhrström c84c4d3f15
Merge pull request #867 from weetmuts/BIBOLV-patch-1
Create trigger_ha_addon.yml
2023-03-05 20:13:05 +01:00
Fredrik Öhrström c24a57261f
Merge pull request #904 from petterreinholdtsen/deb-suggest-rtl-wmbus
Make binary deb package suggest rtl-wmbus.
2023-03-05 19:08:43 +01:00
Petter Reinholdtsen aac233d826 Make binary deb package suggest rtl-wmbus.
The package can be used to receive broadcasted radio messages.
2023-03-05 18:44:19 +01:00
Fredrik Öhrström 298124c51a Add test case to eurisii driver. 2023-03-05 18:23:24 +01:00
Fredrik Öhrström ceb80667c3
Merge pull request #899 from gepaecktraeger/patch-1
Update driver_eurisii.cc
2023-03-05 18:16:57 +01:00
Fredrik Öhrström 668013306f
Merge pull request #901 from petterreinholdtsen/github-workflow-debian
Added github workflow for building Debian package.
2023-03-05 18:16:41 +01:00
Fredrik Öhrström 75ef51d80d
Merge pull request #902 from petterreinholdtsen/github-workflow-ubuntu-quicker
Speed up Ubuntu github workflow using eatmydata.
2023-03-05 18:15:54 +01:00
Petter Reinholdtsen 64b3d4d57e Speed up Ubuntu github workflow using eatmydata. 2023-03-05 18:01:57 +01:00
Petter Reinholdtsen 309ec73b1d Added github workflow for building Debian package.
As github lack Debian workers, the latest ubuntu worker is used.
2023-03-05 17:58:14 +01:00
Fredrik Öhrström c4e943dfca
Merge pull request #900 from petterreinholdtsen/deb-build-depends
Added required jq build dependency and remove redundant comma.
2023-03-05 17:47:11 +01:00
Petter Reinholdtsen 8b17374955 Added required jq build dependency and remove redundant comma. 2023-03-05 17:17:49 +01:00
idl0r 73aadd8a96
Update driver_eurisii.cc
added (RAM) Rossweiner Armaturen und Messgeraete OHG, Germany (0x482d) type: Heat Cost Allocator (0x08) ver: 0x55 
for driver autodetection that use the same structure as INE HCA
2023-03-05 13:25:43 +01:00
Fredrik Öhrström 2afee8f009
Merge pull request #822 from Boldfor/patch-1
Included Techem vario 3 type 3.2.1 in Readme.md
2023-03-03 10:19:10 +01:00
Fredrik Öhrström 5add90f570
Merge pull request #853 from rhuss/add-hash-0x7c0e
Add 0x7c0e hash to list of known meter format signatures
2023-03-03 10:18:17 +01:00
BIBO 8cd7371dcb
Merge pull request #884 from weetmuts/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2023-03-01 22:09:06 +02:00
dependabot[bot] 143a44c776
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 14:34:58 +00:00
BIBO a10593c15c
Merge pull request #885 from weetmuts/dependabot/github_actions/docker/setup-qemu-action-2
Bump docker/setup-qemu-action from 1 to 2
2023-03-01 16:34:19 +02:00
BIBO 5068d33019
Merge pull request #891 from chpego/new-mqtt-discovery
New mqtt discovery
2023-02-28 20:54:32 +02:00
chpego e47a76a508
Create mkradio4.json 2023-02-28 07:52:41 +01:00
chpego f44eb36162
Create vario451.json 2023-02-28 07:37:51 +01:00
dependabot[bot] 2068825380
Bump docker/setup-qemu-action from 1 to 2
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-24 22:02:37 +00:00
Fredrik Öhrström 24153e2641 Add driver for electricity meter Nemo 2023-02-21 21:03:20 +01:00
BIBO 01f64541df
Create trigger_ha_addon.yml
Action for ha-addon container build trigger in wmbusmeters/wmbusmeters-ha-addon repo.
This should be accepted after secrets has been configured in all related repos.
Starting from now all ha-addon changes should go to wmbusmeters/wmbusmeters-ha-addon repo and should not be accepted here.
After next release I will make changelog changes to inform users to switch to new repo.
2023-02-16 23:03:28 +02:00
BIBO 231826ac22
Merge pull request #866 from thecem/patch-7
add description for meters config.
2023-02-16 22:14:06 +02:00
BIBO acd93f9bda
Merge pull request #865 from thecem/patch-6
bump to 1.11.0-2
2023-02-16 22:13:45 +02:00
thecem 81c5f67c97
add description for meters config. 2023-02-16 20:30:15 +01:00
thecem d58f982148
bump to 1.11.0-2
1.11.0-2
2023-02-16 20:11:11 +01:00
BIBO ba334e2891
Merge pull request #864 from thecem/patch-5
Changed meters to real optional.
2023-02-16 20:58:29 +02:00
thecem 426dbf2422
Changed meters to real optional.
@BIBOLV pls merge I will test asap.
2023-02-16 19:50:57 +01:00
BIBO 3f4040eddd
Merge pull request #863 from KrzysztofHajdamowicz/patch-1
[HA Addon] Make meters section optional
2023-02-16 20:21:27 +02:00
KrzysztofHajdamowicz 880285cd97
[HA Addon] Make meters section optional
Related to #859, current schema assumes only one meter is possible.
2023-02-16 18:17:03 +01:00
BIBO fe3b6ad9f6
Merge pull request #858 from convicte/patch-1
Update the link to the DOCS
2023-02-15 23:13:56 +02:00
convicte 2d226b9bd0
Update the link to the DOCS 2023-02-15 21:48:48 +01:00
BIBO 4c168999e9
Merge pull request #856 from thecem/patch-2
Fixed the repo is not showing the addon.
2023-02-15 20:43:01 +02:00
thecem 1619cb3403
fixed the config file
Fixed the lints and puter the example config to the right place.
2023-02-15 18:03:48 +01:00
Fredrik Öhrström 22d00f223c Update README with new dongle name Metis-II for amb8465, 2023-02-15 13:27:25 +01:00
BIBO 017a38df12
Merge pull request #838 from KrzysztofHajdamowicz/master
HA Addon config refactor
2023-02-14 14:13:33 +02:00
BIBO 68538bc658
Merge pull request #791 from convicte/patch-1
Add Diehl IZAR RC 868 I R4 PL water meter to MQTT auto-discovery
2023-02-14 13:02:10 +02:00
convicte d1f1d850c8
Update izar.json 2023-02-14 11:50:08 +01:00
BIBO 6f067b666e
Merge pull request #854 from weetmuts/BIBOLV-patch-1
Bibolv patch 1
2023-02-14 00:31:28 +02:00
BIBO b1b52da8a1
Update driver_qcaloric.cc 2023-02-14 00:23:10 +02:00
BIBO 5568ec591b
Update driver_sharky774.cc 2023-02-14 00:22:21 +02:00
BIBO 128764e130
Merge pull request #818 from chpego/chpego-mqtt-discovery-sharky774
mqtt discovery sharky774
2023-02-13 17:45:21 +02:00
Roland Huß 2007f18961
add 0x7c0e hash to list of known meter format signatures 2023-02-13 16:28:08 +01:00
BIBO 208a540535
Merge pull request #839 from KrzysztofHajdamowicz/feature/amiplus_autodiscovery
Add HA Autodiscovery for Apator Amiplus
2023-02-13 16:20:04 +02:00
Fredrik Öhrström a2925a9f6b
Merge pull request #833 from weetmuts/dependabot/github_actions/docker/build-push-action-4
Bump docker/build-push-action from 3 to 4
2023-02-12 09:30:52 +01:00
Fredrik Öhrström 89c5e93ea2
Merge pull request #850 from weetmuts/BIBOLV-patch-1
Bibolv patch 1
2023-02-12 09:30:25 +01:00
BIBO fb953e363a
Update driver_sharky774.cc
Adding new meter version - https://github.com/weetmuts/wmbusmeters/issues/845
2023-02-11 20:48:00 +02:00
BIBO 4f2f1ae02c
Update driver_qcaloric.cc
New meter version - https://github.com/weetmuts/wmbusmeters/issues/844
2023-02-11 20:46:06 +02:00
KrzysztofHajdamowicz 0f6014260a
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:55:16 +01:00
KrzysztofHajdamowicz 9f8a21d6c7
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:55:11 +01:00
KrzysztofHajdamowicz 2d4b4c2b0e
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:55:04 +01:00
KrzysztofHajdamowicz efc7aa8ff5
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:54:54 +01:00
KrzysztofHajdamowicz f6d788a096
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:54:48 +01:00
KrzysztofHajdamowicz 959d8ce9ba
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:53:06 +01:00
KrzysztofHajdamowicz 6938ba58be
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:52:56 +01:00
KrzysztofHajdamowicz 3dfbaacf6d
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:52:50 +01:00
KrzysztofHajdamowicz 8cea8a8c09
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:52:41 +01:00
KrzysztofHajdamowicz d6ec3ece25
Update ha-addon/mqtt_discovery/amiplus.json
Co-authored-by: chpego <38792705+chpego@users.noreply.github.com>
2023-02-07 08:52:30 +01:00
chpego 79e9a2c869
Update sharky774.json 2023-02-06 21:54:33 +00:00
KrzysztofHajdamowicz c3e3754aa1
[HA Addon] Prefill `meters` config with example data 2023-02-05 12:18:30 +01:00
KrzysztofHajdamowicz bf5e555533
[HA Addon] make "donotprobe" configuration optional 2023-02-05 12:16:36 +01:00
KrzysztofHajdamowicz bacd4f3f49
Clarify version since when new config format is used
Relates to #838
2023-02-05 12:15:18 +01:00
KrzysztofHajdamowicz 0ca6414a6e
Bump version in config.json to 1.11.0-1
Related to #838
2023-02-05 12:13:49 +01:00
KrzysztofHajdamowicz b3f4607031
Mention breaking change in HA Addon configuration 2023-02-04 19:49:25 +01:00
Krzysztof Hajdamowicz 3fd7abd9a5 Add Apator amiplus autodiscovery 2023-02-03 16:59:58 +01:00
Krzysztof Hajdamowicz 260aa7cfd8 refactor addon config 2023-02-03 16:54:19 +01:00
dependabot[bot] 4be1704171
Bump docker/build-push-action from 3 to 4
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 20:18:33 +00:00
Fredrik Öhrström 7f0ff31890
Merge pull request #832 from weetmuts/BIBOLV-patch-1
Update driver_qualcosonic.cc
2023-02-01 21:11:09 +01:00
BIBO 6af4eaa333
Update close_stale_issues.yml
Fixing error in label specification
2023-02-01 21:42:37 +02:00
BIBO 8b0ab99d11
Update driver_qualcosonic.cc
Adding new meter version to driver - https://github.com/weetmuts/wmbusmeters/issues/831
2023-02-01 21:36:48 +02:00
chpego 4112367954
remove inappropriate attribute
https://www.home-assistant.io/integrations/sensor.mqtt/#sw_version
2023-01-23 22:10:17 +00:00
convicte 555ac90e42
Update izar.json 2023-01-22 23:23:38 +01:00
Daedalus f1f5d7e28d
Included Techem vario 3 type 3.2.1 2023-01-22 11:39:33 +01:00
Fredrik Öhrström ed8440c322
Merge pull request #819 from BIBOLV/patch-5
Update close_stale_issues.yml
2023-01-21 23:00:22 +01:00
BIBOLV 9faa02cda6 Update close_stale_issues.yml
Add labels to be excluded from stale tagging
2023-01-21 22:46:14 +02:00
chpego 2d07f71b0c
add power sensor 2023-01-21 10:17:51 +00:00
chpego 01b1027852
fix model name 2023-01-21 10:16:30 +00:00
chpego dc56f649ac
fix manufacturer 2023-01-21 10:15:01 +00:00
Fredrik Öhrström 4849cb411c Add kem extract helper script. 2023-01-21 10:29:13 +01:00
Fredrik Öhrström b6c0675e09 Add kem extract helper script. 2023-01-21 10:26:38 +01:00
Fredrik Öhrström 89c42ab27d
Merge pull request #806 from cukoun/master
Add support for sharky774 (DIEHL) heat meter for MQTT auto-discovery
2023-01-21 10:07:44 +01:00
Fredrik Öhrström 05fbb0a5e7
Merge pull request #817 from BIBOLV/patch-5
Update driver_kamheat.cc
2023-01-21 08:03:48 +01:00
BIBOLV c7bd8573f3 Update driver_kamheat.cc
Adding new meter version to driver - https://github.com/weetmuts/wmbusmeters/issues/808
2023-01-20 23:43:54 +02:00
Fredrik Öhrström a49ff9b07f
Merge pull request #815 from BIBOLV/patch-5
Update driver_minomess.cc
2023-01-20 20:15:02 +01:00
BIBOLV 1082d03bc6 Update driver_minomess.cc
Fixing minomess driver test case
2023-01-20 20:04:16 +02:00
Fredrik Öhrström 866e6af8fa
Merge pull request #814 from BIBOLV/patch-5
Update driver_minomess.cc
2023-01-19 21:15:13 +01:00
BIBOLV dc0631a701 Update driver_minomess.cc
Adding test cases
2023-01-19 21:43:02 +02:00
BIBOLV f9092b4911 Update driver_minomess.cc
Adding two new meters to minomess driver as agreed in https://github.com/weetmuts/wmbusmeters/issues/810
2023-01-19 21:10:17 +02:00
Fredrik Öhrström 5ffe98f75d
Merge pull request #812 from weetmuts/BIBOLV-patch-1
Update close_stale_issues.yml
2023-01-19 11:14:31 +01:00
BIBO cbcb7cfa52
Update close_stale_issues.yml
Increase processed items per run
2023-01-19 11:17:39 +02:00
Fredrik Öhrström d1598742ef
Merge pull request #804 from BIBOLV/patch-5
Docker fix
2023-01-18 17:03:35 +01:00
Fredrik Öhrström eac9d372af
Merge pull request #805 from BIBOLV/patch-6
Issue templates and close stale issue action
2023-01-18 16:49:49 +01:00
Fredrik Öhrström a603b650f6 Add watertech driver. 2023-01-18 16:45:16 +01:00
cukoun 8e8d7609b0
Create sharky774.json 2023-01-16 13:25:31 +01:00
BIBOLV ef0042df4e Issue templates and close stale issue action
New issue templates and action to close stale issues.
Please review texts and parameters before accepting PR.
2023-01-16 00:16:17 +02:00
BIBOLV abcecb73e2 Docker fix
Fix tags for armhf docker image reported in https://github.com/weetmuts/wmbusmeters/issues/762
2023-01-16 00:09:46 +02:00
Fredrik Öhrström c54c5b3fe5 Do not expect memory full of FF for RC1180 dongles. 2023-01-14 13:25:26 +01:00
Fredrik Öhrström 850d70a635 Update README and man page. 2023-01-14 10:37:46 +01:00
Fredrik Öhrström bc97fc2f8c Update README. 2023-01-14 10:30:52 +01:00
Fredrik Öhrström 28f1a34c08
Merge pull request #800 from shevu/develop
Update for registers size and description
2023-01-14 10:06:08 +01:00
Fredrik Öhrström eb1ccc2e30 Update README and CHANGES. 2023-01-14 09:01:51 +01:00
Fredrik Öhrström ce74424154 Update README. 2023-01-14 08:46:10 +01:00
Fredrik Öhrström 72a4f4fc4a Update README. 2023-01-14 08:43:38 +01:00
Fredrik Öhrström c0c511c5c8 Update README. 2023-01-14 08:35:37 +01:00
Fredrik Öhrström 17df376331 Update README. 2023-01-14 08:29:09 +01:00
Mariusz edadce2d71
Update for registers size and description 2023-01-13 14:03:33 +01:00
Fredrik Öhrström 03b633b983 Add another mfct/version/type combo to qcaloric. 2023-01-13 09:52:40 +01:00
Fredrik Öhrström 43c846aaad
Merge pull request #799 from gizmocuz/fix-ell_type-parameter
Added ell_type parameter to log function
2023-01-13 09:20:49 +01:00
Rob Peters 397268c23f Added ell_type parameter to log function 2023-01-13 08:29:10 +01:00
Fredrik Öhrström cf074a147a Restore functionality so that ANYID works with auto driver. 2023-01-10 22:08:14 +01:00
Fredrik Öhrström 554b91bc6b Correct date in gwfwater. 2023-01-10 21:20:42 +01:00
Fredrik Öhrström e7d723f5c7 Added gwfwater. Require di.usesProcessContent() to setup for mftc specific decoding. 2023-01-10 20:52:14 +01:00
Fredrik Öhrström ab9e4b3c1d Fix test. 2023-01-10 15:38:12 +01:00
Fredrik Öhrström 5688401ca6 Add another mfct/version/type combo for sharky driver. 2023-01-10 15:36:27 +01:00
Fredrik Öhrström e674d2ef4d Use AnyEnergyVIF instead of EnergyWh or EnergyMJ. 2023-01-10 14:54:27 +01:00
convicte 0f325310a6
Add Diehl IZAR RC 868 I R4 PL water meter to MQTT auto-discovery
Hi all,

I've made an attempt to create an auto-discovery file for the relatively popular IZAR driver.
Since it's my first commit every, please excuse any obvious issues or breaches of coding etiquette. 

I am awaiting some assistance with an MQTT auto-discovery error (https://github.com/weetmuts/wmbusmeters/issues/550), so the above has not been tested yet, but if someone would like to try it out, it's as simple as creating a .json file in your mqtt_discovery folder.

Thank you!
2023-01-08 01:31:03 +01:00
Fredrik Öhrström f6345e4c46
Merge pull request #784 from bb-froggy/addmeterdetection-qheatus
Detect another media/version as qheat_55_us
2023-01-04 21:07:40 +01:00
bb-froggy d9a849e5a1 Detect another media/version as qheat_55_us 2023-01-03 20:49:35 +01:00
Fredrik Öhrström fce935ea47
Merge pull request #781 from george-hopkins/rtlwmbus-timestamp
Propagate timestamps from rtlwmbus
2023-01-03 12:04:48 +01:00
Fredrik Öhrström d90ed63c5c Fix test. 2023-01-03 12:04:29 +01:00
Fredrik Öhrström 46a5246c77
Merge pull request #783 from george-hopkins/fhkvdataiii-year-infer
Infer current year in fhkvdataiii
2023-01-03 11:57:46 +01:00
George Hopkins d338de8101 Propagate timestamps from rtlwmbus 2023-01-03 11:46:00 +01:00
George Hopkins 9ace588433 Infer current year in fhkvdataiii 2023-01-03 10:43:00 +01:00
Fredrik Öhrström 114b82d4c5 Improve weh_07 driver. 2023-01-03 00:38:43 +01:00
Fredrik Öhrström ea982b7d2d Zleba contributed more detection values and test cases for qwater. 2023-01-03 00:08:25 +01:00
Fredrik Öhrström 8030e8ed9c Fix test. 2023-01-02 23:59:16 +01:00
Fredrik Öhrström 8a457d945b Temporarily fix adding of a conversion, ie --calculate_total_l=total_m3 2023-01-02 23:33:05 +01:00
Fredrik Öhrström 952489c7e0 Rewrite remaining drivers using ancient code for printing values. 2023-01-02 22:39:39 +01:00
Fredrik Öhrström d7d1cda149 All fields are by default OPTIONAL. Remove other unnecessary PrintProperty fields. 2023-01-01 20:51:20 +01:00
Fredrik Öhrström c6bf8a114e Cleanup aventieshca, aventieswm, microclima and qwater. 2022-12-31 16:02:46 +01:00
Fredrik Öhrström c2e1127caa Add utc format to formula parser. Test date conversions to from utc. 2022-12-31 11:38:28 +01:00
Fredrik Öhrström 08ca21e7b9 When analyzing/simulating telegrams adjust a wrong length byte. 2022-12-30 22:57:48 +01:00
Fredrik Öhrström 8110c900d2 Option --logfile=syslog now works as expected. 2022-12-30 10:07:20 +01:00
Fredrik Öhrström cf8b03586d Remove broken supercom587 tests. 2022-12-30 01:30:36 +01:00
Fredrik Öhrström cceef03efb Cleanup supercom587. 2022-12-30 00:57:46 +01:00
Fredrik Öhrström dd2ec40173 Cleanup vario451mid. 2022-12-30 00:29:27 +01:00
Fredrik Öhrström 26db03ffaa Fix bugs in sharky774 and add cooling version of meter. 2022-12-29 23:48:58 +01:00
Fredrik Öhrström 3a775977b1 Fix waterstarm and hydrocalm3. 2022-12-29 22:04:51 +01:00
Fredrik Öhrström aa0b492af2
Merge pull request #742 from bb-froggy/lorenz-correcthistory
Calculate correct history dates for Lorenz water meters
2022-12-29 21:00:05 +01:00
Fredrik Öhrström 3787adc71b Version 1.11.0 2022-12-29 2022-12-29 20:49:04 +01:00
Fredrik Öhrström 558e6aba75 Version 1.11.0-RC2 2022-12-29 2022-12-29 19:16:06 +01:00
Fredrik Öhrström 37e2ea8331 Work on release process. 2022-12-29 19:15:42 +01:00
Fredrik Öhrström e26ada4957 Work on release process. 2022-12-29 19:04:54 +01:00
Fredrik Öhrström ad7ace4918 Version 1.11.0-RC1 2022-12-29 2022-12-29 17:04:57 +01:00
Fredrik Öhrström 0e2355e17b Work on release process. 2022-12-29 17:04:34 +01:00
Fredrik Öhrström 45a68ba26d Work on release process. 2022-12-29 16:45:13 +01:00
Fredrik Öhrström 554a669599 Work on release process. 2022-12-29 16:21:18 +01:00
Fredrik Öhrström 29ef3f6501 Work on release process. 2022-12-29 16:15:21 +01:00
Fredrik Öhrström 7cea1c5646 Update CHANGES. 2022-12-29 16:05:57 +01:00
Fredrik Öhrström 26423949cd Work on release process. 2022-12-29 16:00:39 +01:00
Fredrik Öhrström 0439a45e20 Only run the netcat tests if nc is installed. 2022-12-29 15:49:14 +01:00
Fredrik Öhrström 3d296ac262 Update CHANGES. 2022-12-29 15:32:06 +01:00
Fredrik Öhrström 10edc1bf6f Update munia test. 2022-12-29 14:33:03 +01:00
Fredrik Öhrström 7e527463b8
Merge pull request #771 from jacek27/master
Added Robin device designator
2022-12-29 14:22:55 +01:00
Fredrik Öhrström 292139324c Add LATEST_RELEASE file. 2022-12-29 14:03:03 +01:00
Jacek Leonhard 77ff716852 Added example frame for Robin 2022-12-29 14:00:04 +01:00
Jacek Leonhard 645488cca5 Added sim for Robin 2022-12-29 13:04:04 +01:00
Fredrik Öhrström a1596331db
Merge pull request #768 from ranma/pollucomf
New driver: Sensus Pollucom F
2022-12-29 10:49:49 +01:00
Jacek Leonhard e16f07ba51 Updated README.md to reflect Robin driver update 2022-12-29 09:32:47 +01:00
Jacek Leonhard 0c4325c0d1 Added designator for Robin device 2022-12-29 08:48:53 +01:00
Tobias Diedrich 44e1e5c797 New driver: Sensus Pollucom F
Manufacture page: https://sensus.com/emea/de/products/pollucom-f/

Resolves https://github.com/weetmuts/wmbusmeters/issues/765
2022-12-27 22:45:48 +01:00
Fredrik Öhrström ae2f6780e0
Merge pull request #761 from chpego/ha_improvement
HA-addon improvement
2022-12-25 21:17:53 +01:00
Fredrik Öhrström c53367aca3 Add missing rawtty command code. 2022-12-25 20:57:28 +01:00
Fredrik Öhrström 97e64ae4b1 Add second test. 2022-12-25 20:52:19 +01:00
Fredrik Öhrström 45b06ead75 Add more netcat tests for hex and rawtty. Disable test for apple. 2022-12-25 20:48:27 +01:00
Fredrik Öhrström 405d005cb5 Add test of netcat feeding wmbusmeters. 2022-12-25 20:23:41 +01:00
Fredrik Öhrström 4fb2bf7b49
Merge pull request #752 from SzczepanLeon/master
Add ports to forward for netcat to ha-addon. User can use rtlwmbus:CMD as device
2022-12-25 16:49:19 +01:00
Fredrik Öhrström 16eb9144e8
Merge pull request #751 from chpego/patch-2
Update DOCS.md
2022-12-25 16:47:16 +01:00
chpego ca09e97e15
using bashio fs.directory_exists 2022-12-21 22:29:19 +00:00
chpego e71d9b06d3
using bashio::jq instead of jq 2022-12-21 22:17:37 +00:00
chpego a549754d65
switch echo to bashio::log.info 2022-12-21 22:06:56 +00:00
Szczepan 70b4527459 Add ports to forward for netcat to ha-addon 2022-12-16 09:54:46 +01:00
chpego bfcd97d7f4
Update DOCS.md
Since HA 2022.12, it is necessary to declare the sensors in mqtt in yaml (see [here](https://www.home-assistant.io/blog/2022/12/07/release-202212/#breaking-changes))

Change the unit_of_measurement (available [here](https://developers.home-assistant.io/docs/core/entity/sensor/) )
2022-12-16 08:31:59 +01:00
Fredrik Öhrström f992c9f810
Merge pull request #745 from oandry72/master
Fix meters name (MQTT Topic) with whitespaces
2022-12-14 11:30:48 +01:00
Andrei a874c51da9 Fix meters name (MQTT Topic) with whitespaces
Add MQTT discovery for apator162, apatoreitn
2022-12-14 10:38:29 +01:00
Fredrik Öhrström b5c4f3b657
Merge pull request #736 from thecem/patch-6
Update links to changes and releases (tags)
2022-12-13 08:55:19 +01:00
bb-froggy a1a4b7ff92 waterstarm: calculate almost correct history dates 2022-12-12 22:28:20 +01:00
bb-froggy faeb6cb29d calculate set_date and consumption_at_set_date 2022-12-12 22:28:20 +01:00
Fredrik Öhrström 8bc2ac9635 Show in analyze when ci-field is not understood. 2022-12-12 21:32:16 +01:00
Fredrik Öhrström 0bbe99a9a9 Missing test added. 2022-12-12 21:15:44 +01:00
Fredrik Öhrström b9f756e5e9 Add m3ch unit for power based on m3c. 2022-12-12 17:41:22 +01:00
Fredrik Öhrström 802ed2fe96 Rename defaultUnit to displayUnit in field info. 2022-12-12 15:49:10 +01:00
Fredrik Öhrström 28c96e1d76 Treat mfct specific vif as an extension vif. 2022-12-12 13:51:27 +01:00
thecem c16b28504d
Update links to changes and releases (tags) 2022-12-12 10:40:05 +01:00
Fredrik Öhrström 601b28332b Move mfct specific bits from driverinfo into meter constructor. 2022-12-11 19:11:54 +01:00
Fredrik Öhrström bda349bcd2 Clean up tpl status reporting. 2022-12-11 15:20:23 +01:00
Fredrik Öhrström 07754197fc Release 1.10.2 2022-12-09 20:15:00 +01:00
Fredrik Öhrström 36ab6b5404 Update Makefile. 2022-12-09 20:03:15 +01:00
Fredrik Öhrström c0c9e368ea Update Makefile. 2022-12-09 19:37:43 +01:00
Fredrik Öhrström 33fe1a7f59
Merge pull request #726 from kroimon/mqtt_discovery
MQTT discovery improvements
2022-12-09 19:35:46 +01:00
Fredrik Öhrström 7b2f82753a
Merge pull request #730 from chpego/patch-1
Update DOCS.md
2022-12-09 19:35:03 +01:00
Fredrik Öhrström 22b584158d
Merge pull request #729 from BIBOLV/master
Snap update
2022-12-09 19:32:09 +01:00
Fredrik Öhrström 262e907a69 Update README. 2022-12-09 19:31:14 +01:00
chpego b569f0e41e
Update DOCS.md 2022-12-09 11:13:53 +01:00
BIBOLV d5ed47ebf0 Snap update
Snap has been upgraded from core18 to core22.
Build process moved from snapcraft to github actions - now built snaps are being pushed to appropriate channels automatically.
Tested on amd64 and arm64 with imst and rtl_sdr.
Webhook should be removed in order to prevent parallel builds in github and snapcraft.
If login to snapcraft fails during build then store login token should be regenerated.
2022-12-08 23:44:51 +02:00
kroimon b10d79cd80 Fix Home Assistant MQTT discovery for multikal/kamheat driver 2022-12-07 12:52:31 +01:00
kroimon 43df03afbf Add missing device_class properties to Home Assistant MQTT discovery files 2022-12-07 12:35:51 +01:00
Fredrik Öhrström 535005a879 Add another register to apator162. 2022-12-06 08:29:21 +01:00
Fredrik Öhrström b3315db122 Release 1.10.1 2022-12-05 22:49:46 +01:00
Fredrik Öhrström 236371657a Fix bug that prevented direct tty name like /dev/ttyUSB0:device:t1 to work. 2022-12-05 22:49:31 +01:00
279 zmienionych plików z 32344 dodań i 12601 usunięć

Wyświetl plik

@ -0,0 +1,39 @@
name: Ticket concerning docker container
description: This is the ticket to create for anything related to docker container
labels: ["docker"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this request!
- type: dropdown
id: topic
attributes:
label: Type of request
description: Pick the type of request
options:
- Enhancement
- Question
- Bug
validations:
required: true
- type: input
id: os-version
attributes:
label: OS version
description: Specify OS version where docker container is running on
validations:
required: true
- type: input
id: wmbusmeters-version
attributes:
label: wmbusmeters version
description: Specify wmbusmeters version that you are running as docker container
validations:
required: true
- type: textarea
id: descriptiom
attributes:
label: Your message goes here
description: Provide as detailed description as possible. In case of bug - add logs with relevant information as attachment.
validations:
required: true

Wyświetl plik

@ -0,0 +1,34 @@
name: Ticket concerning device support
description: This is the ticket to create for anything related to meter drivers
labels: ["device support"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this request!
- type: dropdown
id: topic
attributes:
label: Type of request
description: Pick the type of request
options:
- New device support
- Existing device improvement
validations:
required: true
- type: textarea
id: descriptiom
attributes:
label: Meter description
description: Please describe in details meter - manuafacturer, model name, link to descripton, etc. If available also add as much details about wmbus message format and fields.
placeholder: Detailed meter description
validations:
required: true
- type: textarea
id: telegrams
attributes:
label: Logged telegrams from meter in decrypted format
description: In order to log telegrams, set `logtelegrams=true` in configuration and gather at least 10 telegrams from meter. Check that telegrams are not encrypted, it can be verified in logs or by pasting them [here](https://wmbusmeters.org/). If telegram is encrypted you need to get encryption key, decrypt messages and them post them as we can not do anything with encrypted ones.
placeholder: Logged telegrams
render: shell
validations:
required: true

Wyświetl plik

@ -0,0 +1,39 @@
name: Ticket concerning Home Assistant addon
description: This is the ticket to create for anything related to ha-addon
labels: ["ha-addon"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this request!
- type: dropdown
id: topic
attributes:
label: Type of request
description: Pick the type of request
options:
- Enhancement
- Question
- Bug
validations:
required: true
- type: input
id: haos-version
attributes:
label: HAOS version
description: Specify Home Assistant Operating System that you are running
validations:
required: true
- type: input
id: wmbusmeters-version
attributes:
label: wmbusmeters version
description: Specify wmbusmeters version that you are running as addon
validations:
required: true
- type: textarea
id: descriptiom
attributes:
label: Your message goes here
description: Provide as detailed description as possible. In case of bug - add logs with relevant information as attachment.
validations:
required: true

Wyświetl plik

@ -0,0 +1,32 @@
name: Ticket concerning snap package
description: This is the ticket to create for anything related to snap package
labels: ["snap"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this request!
- type: dropdown
id: topic
attributes:
label: Type of request
description: Pick the type of request
options:
- Enhancement
- Question
- Bug
validations:
required: true
- type: input
id: wmbusmeters-version
attributes:
label: wmbusmeters version
description: Specify wmbusmeters version that you are running as snap package
validations:
required: true
- type: textarea
id: descriptiom
attributes:
label: Your message goes here
description: Provide as detailed description as possible. In case of bug - add logs with relevant information as attachment.
validations:
required: true

Wyświetl plik

@ -0,0 +1,39 @@
name: Ticket concerning wmbusmeters
description: This is the ticket to create for anything related to wmbusmeters itself
labels: ["wmbusmeters"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this request!
- type: dropdown
id: topic
attributes:
label: Type of request
description: Pick the type of request
options:
- Enhancement
- Question
- Bug
validations:
required: true
- type: input
id: os-version
attributes:
label: OS version
description: Specify OS version that you are running
validations:
required: true
- type: input
id: wmbusmeters-version
attributes:
label: wmbusmeters version
description: Specify wmbusmeters version that you are running
validations:
required: true
- type: textarea
id: descriptiom
attributes:
label: Your message goes here
description: Please provide as detailed description as possible. In case of bug - add logs with relevant information as attachment.
validations:
required: true

Wyświetl plik

@ -0,0 +1,21 @@
name: Build Debian package
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: INSTALL_ADDITIONAL_BUILD_DEPENDENCIES
run: |
sudo apt install -y eatmydata
sudo eatmydata apt install -y devscripts debhelper
sudo eatmydata apt build-dep -y . || sudo eatmydata apt install -y librtlsdr-dev libxml2-dev libxslt1-dev adduser
- id: PREPARE_SOURCE
run: |
ln -s deb debian
echo 1.0 > debian/source/format
- id: BUILD_DEB
run: yes y | eatmydata debuild --no-sign

Wyświetl plik

@ -5,49 +5,114 @@ on:
branches:
- 'master'
tags:
- '*.*.*'
- '[0-9]+\.[0-9]+\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+-RC[0-9]+'
env:
DOCKERHUB_IMAGE: ${{ github.repository }}
IMAGE_TAG: |
${{ github.ref_type == 'tag' && format('{0}-{1}', (contains(github.ref_name, '-RC') &&
'candidate' || 'release'), github.ref_name) || 'latest' }}
jobs:
docker:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v7
- linux/arm64
steps:
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: weetmuts/wmbusmeters
tags: type=ref,event=tag
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
tags: |
${{ env.IMAGE_TAG }}
images: |
${{ env.DOCKERHUB_IMAGE }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
password: ${{ secrets.DOCKERHUB_PAT }}
-
name: Build and push not tagged release
if: ${{ !steps.meta.outputs.tags }}
uses: docker/build-push-action@v3
name: Build and push
uses: docker/build-push-action@v5
id: docker_build
with:
context: docker/
platforms: linux/amd64,linux/arm64,linux/armv7
push: true
tags: weetmuts/wmbusmeters:latest
platforms: ${{ matrix.platform }}
provenance: false
outputs: |
type=image,name=${{ env.DOCKERHUB_IMAGE }},push-by-digest=true,name-canonical=true,push=true
-
name: Build and push tagged release
if: ${{ steps.meta.outputs.tags }}
uses: docker/build-push-action@v3
name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.docker_build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
-
name: Upload digest
uses: actions/upload-artifact@v4
with:
context: docker/
platforms: linux/amd64,linux/arm64,linux/armv7
push: true
tags: weetmuts/wmbusmeters:release-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
-
name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
tags: |
${{ env.IMAGE_TAG }}
images: |
${{ env.DOCKERHUB_IMAGE }}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
-
name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.DOCKERHUB_IMAGE }}@sha256:%s ' *)
-
name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.DOCKERHUB_IMAGE }}:${{ steps.meta.outputs.version }}

Wyświetl plik

@ -3,11 +3,12 @@ on:
push:
branches:
- master
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: INSTALL_ADDITIONAL_BUILD_DEPENDENCIES
run: brew install librtlsdr libusb
- id: CONFIGURE

Wyświetl plik

@ -0,0 +1,66 @@
name: Build Snap
on:
push:
branches:
- 'master'
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+-RC[0-9]+'
jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
- amd64
- armhf
- arm64
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: wmbusmeters/wmbusmeters
tags: type=ref,event=tag
-
name: Build
id: build
uses: diddlesnaps/snapcraft-multiarch-action@v1
with:
architecture: ${{ matrix.architecture }}
-
name: Publish release to Stable
uses: snapcore/action-publish@v1
if: ${{ steps.meta.outputs.tags && !contains(steps.meta.outputs.tags, '-RC') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
with:
snap: ${{ steps.build.outputs.snap }}
release: stable
-
name: Publish RC to Candidate
uses: snapcore/action-publish@v1
if: ${{ steps.meta.outputs.tags && contains(steps.meta.outputs.tags, '-RC') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
with:
snap: ${{ steps.build.outputs.snap }}
release: candidate
-
name: Publish latest to Edge
uses: snapcore/action-publish@v1
if: ${{ !steps.meta.outputs.tags }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge

Wyświetl plik

@ -7,12 +7,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: INSTALL_ADDITIONAL_BUILD_DEPENDENCIES
run: sudo apt-get install librtlsdr-dev libusb-dev ncurses-dev
run: |
sudo apt install -y eatmydata
sudo eatmydata apt-get install librtlsdr-dev libusb-dev libxml2-dev libxslt1-dev
- id: CONFIGURE
run: ./configure
run: eatmydata ./configure
- id: MAKE
run: make
run: eatmydata make
- id: TEST
run: make test
run: eatmydata make test

Wyświetl plik

@ -0,0 +1,22 @@
name: 'Close stale issues'
on:
schedule:
- cron: '30 1 * * *'
permissions:
issues: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open for 2 month with no activity. Remove stale label or comment or this will be closed in 1 month.'
close-issue-message: 'This issue was closed because it has been stalled for 1 month with no activity.'
days-before-stale: 60
days-before-close: 30
operations-per-run: 1000
exempt-issue-labels: 'enhancement, work in progress, planned, keep open'
days-before-pr-stale: -1
days-before-pr-close: -1

Wyświetl plik

@ -10,11 +10,11 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v4
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: weetmuts/wmbusmeters
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PAT }}
DOCKERHUB_REPOSITORY: wmbusmeters/wmbusmeters
README_FILEPATH: ./docker/README.md

Wyświetl plik

@ -1,45 +0,0 @@
#!/bin/bash
SNAP_NAME="wmbusmeters"
ARCH_LIST="arm64 armhf amd64"
if [ -n "$(git describe --tags | grep -)" ]; then
GIT_REV="$(git describe --tags | cut -f1,2 -d'-')"
echo "$GIT_REV is branch not tag release, exiting.."
exit 1
else
GIT_VER="$(git describe --tags)"
echo "This is release - $GIT_VER"
fi
if $(timeout 5 snapcraft status $SNAP_NAME >/dev/null); then
echo "snapcraft login sucessfull, continuing"
else
echo "Looks like snapcraft login is not sucessfull, exiting...."
exit 1
fi
for arch in $ARCH_LIST
do
snap_build_version="$(snapcraft status --arch $arch $SNAP_NAME | grep edge | awk '{print $2}')"
c=0
while [[ "$GIT_VER" != "$snap_build_version" && $c -lt 30 ]]; do
echo "GIT release version "$GIT_VER" != snap latest edge version at snapcraft for $arch "$snap_build_version", iter : $c";
((c = $c + 1));
sleep 300;
snap_build_version="$(snapcraft status --arch $arch $SNAP_NAME | grep edge | awk '{print $2}')"
done
if [[ "$GIT_VER" != "$snap_build_version" ]]; then
echo "GIT release version "$GIT_VER" != snap latest edge version on snapcraft for $arch "$snap_build_version", exiting..";
exit 1
fi
done
for arch in $ARCH_LIST
do
snap_build_id="$(snapcraft status --arch $arch $SNAP_NAME | grep edge | awk '{print $3}')"
echo "Snap build id for arch $arch - $snap_build_id, promoting to stable release"
snapcraft release $SNAP_NAME $snap_build_id stable
done

Wyświetl plik

@ -1,26 +0,0 @@
name: Promote snap from edge to stable channel
on:
push:
tags:
- '*'
jobs:
initial_sleep:
runs-on: ubuntu-latest
steps:
- name: Sleep for 30 minutes
uses: jakejarvis/wait-action@master
with:
time: '30m'
promote:
needs: initial_sleep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.snapcraft_token }}
- name: Run promote script
run: bash .github/workflows/promote_snap.sh

Wyświetl plik

@ -0,0 +1,45 @@
name: Trigger HA add-on build
on:
push:
branches:
- master
tags:
- '*.*.*'
jobs:
trigger_ha_addon_build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Get wmbusmeters version
id: version
run: |
if [ -n "$(git describe --tags | grep -)" ]; then
GIT_VER="$(git describe --tags | cut -f1,2 -d'-')"
echo "id=${GIT_VER}" >> $GITHUB_OUTPUT
else
GIT_VER="$(git describe --tags)"
echo "id=${GIT_VER}" >> $GITHUB_OUTPUT
fi
- name: Trigger build for edge release
if: ${{ github.ref_name == 'master' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.HA_PAT }}
repository: wmbusmeters/wmbusmeters-ha-addon
event-type: build_ha_edge
client-payload: '{"ver": "${{ steps.version.outputs.id }}"}'
- name: Trigger build for stable release
if: ${{ github.ref_name != 'master' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.HA_PAT }}
repository: wmbusmeters/wmbusmeters-ha-addon
event-type: build_ha_stable
client-payload: '{"ver": "${{ steps.version.outputs.id }}"}'

1
.gitignore vendored
Wyświetl plik

@ -6,6 +6,7 @@ packaging/
testaes/
testoutput/
tests_tmp/
3rdparty/
*~
config.log
autom4te.cache/

370
CHANGES
Wyświetl plik

@ -1,5 +1,245 @@
Version: 1.10.0 2022-12-05
Fixed long standing confusion wether the DIF binary values are by
default signed or unsigned. It turns out that they are signed!
Thank you Mathias (Zeppelin500) and KaVauA for sorting this out!
For unknown VIFS and non-compliant meters the signedness
can be overriden to unsigned.
New improved address specification. E.g. use 12345678.M=KAM.V=1b.T=16
to listen to exactly the telegrams with id 12345678 manufacturer KAM,
version 0x1b and type 0x16. You if you do not specify any M,V or T, they
become wildcards which will be the old default behaviour.
If you receive multiple telegram versions from the same id, and you want to
filter out some versions, do: 12345678,!12345678.V=77
You can now specify p0 to p250, to read from an mbus using the primary address.
E.g. wmbusmeters --pollinterval=5s /dev/ttyUSB1:mbus:2400 TEMP piigth:mbus p0 NOKEY
Added option --identitymode=(id|id-mfct|full|none) to specify how
wmbusmeters groups meter state when receiving telegrams.
The default (which is the same as before) is to map state based only on id.
This usually works ok, however if you have two meters with the same id, but
from different manufacturers, you must separate their state with --identitymode=id-mfct
Full takes into account version and type as well. None means do not separate state
at all, used with wildcards and meters that do not need to keep state, ie all info
is in every telegram.
Version 1.16.1 2024-02-22
Fix docker file generation.
Version 1.16.0 2024-02-22
New build to trigger proper docker versioning.
Version 1.15.0 2024-02-14
Version 1.15.0-RC2 2024-02-14
Update wmbusmeters-ha-addon with new dockerfile.
Version 1.15.0-RC1 2024-02-13
For the daemon you can now drop a driver file (such as iperl.xmq) in /etc/wmbusmeters.driver.d
and it will automatically be used (overriding any builtin iperl driver).
From the command line you can also load a driver file with --driver=file.xmq
or load a whole directory with --driverdir=/drivers or in a tuple just use
a file name ending with xmq. E.g. "Water driver.xmq 12345678 NOKEY"
The two first builtin text drivers are elster and iperl.
ATTENTION! Wmbusmeters now use new -f option when starting rtl_wmbus. There is a
warning if rtl_wmbus does not support the -f option and an upgrade is recommended.
This option will cause rtl_wmbus to exit with an error if the rtl_sdr dongle stops sending data.
This in turn will cause wmbusmeters to restart the pipeline.
Up till now, the stderr from rtl_sdr has been sent to /dev/null. This is a problem
since we cannot see any errors from rtl_sdr that could have caused it to stall.
However the reason for /dev/null was this bug in rtl_sdr.
https://github.com/osmocom/rtl-sdr/commit/142325a93c6ad70f851f43434acfdf75e12dfe03
which prevented us from sending the rtl_sdr stderr to wmbusmeters.
If we did, rtl_sdr went into a 100% cpu hang when we restarted a wmbusmeters daemon.
A temporary workaround has been found that both sends the stderr output to wmbusmeters
and permits the restart of the daemon. Stderr from rtl_sdr is now sent to
/tmp/tmp.XXXXXXX_wmbusmeters_rtlsdr and then tailed into wmbusmeters.
This is a temporary solution until the real rtl_sdr bugfix has propagated into enough distributions.
Add second extension energy MWh VIF 7b00-7b01.
Sunflowerenergias improved the iwmtx5 driver! Thanks Sunflowerenergias!
Jacman777 improved the kamheat driver! Thanks Jacman777!
Pim added a --metershell setting which will invoke a shell command line
when a meter is seen for the first time. This can be used to trigger extra
commands in HA and other systems, to add the new meter. Thanks Pim!
Pim added support for the Lansen repeater which sends its own status messages!
Pim also fixed a small typo in the human readable date timestamp format!
Thanks Pim!
ATTENTION! The hydrus driver could report the wrong value for total_at_date_m3
if an at_date had not been reached yet. This is fixed.
Added initial support for drivers that can be loaded from config files.
Properly receive telegrams from amb8465 which is in command mode.
Chris Bednarczyk improved the build process for Darwin/MacOS platform. Thanks Chris!
PovilasID added another Hydrodigit version. Thanks PovilasID!
Added new units for phase angle: deg rad.
Added more fields to the abbb23.
Version 1.14.0 2023-07-02
Version 1.14.0-RC1 2023-07-02
Added more fields to em24 driver.
Added another mfct/type/version combo to em42 driver and the power_kw field.
Mikołaj Milej imporved the installation script! Thanks Mikołaj!
Christian Güdel improved the topaseskr driver to consider negative flows. Thanks Christian!
Peter Vágner improved the lansenth driver to consider negative temperatures. Thanks Peter!
Dennis Metz improved the ultraheat driver to consider negative flow and temperatures. Thanks Dennis!
Bibo added support for the hcae2 driver. Thanks Bibo!
Improve error messages when telegrams with bad length byte are read.
Improve the apator162 driver.
Added the iwmtx5 driver.
Vyacheslav Karpukhin improved the qheat driver to decode proprietary format telegrams. Thanks Vyacheslav!
pvagner improved the lansenth driver to handle negative values. Thanks pvagner!
demetz imporproved ultraheat driver to handle negative values. Thanks demetz!
Version 1.13.1 2023-05-07
Version 1.13.1-RC1 2023-05-07
Fix make install to not trigger a new build.
Version 1.13.0 2023-05-07
Version 1.13.0-RC1 2023-05-07
The ha-addon has been moved to https://github.com/wmbusmeters/wmbusmeters-ha-addon
Bug fixed where an mbus telegram was mistakenly detected as wmbus.
The snap package can now use the serial port so that it works with mbus.
DeDragonSlayer improved the amiplus with the maximum power consumption field. Thanks DeDragonSlayer!
The calculator was improved to properly handle the m3 unit and give a better
error message when a constant number lacks unit.
The sharky driver was improved.
The kamheat driver was updated with operating_time_h and a new auto-detect combo.
Bibo added support for the hydrocal m4 meter,
improved the kem-import and kem-extract scripts and
added support for the Aerius gas meter. Thanks Bibo!
The wmbusmeters-admin tool has been removed since it was never really useful.
It will probably be replaced with something better and http based.
This drops the need for the ncurses dependency.
Version 1.12.0 2023-03-12
Version 1.12.0-RC1 2023-03-12
WMbusmeters has moved to its new github organization: github.com/wmbusmeters
Bibo significantly improved the experience for installing the ha-addon
by downloading a prepared docker image instead of building from scratch!
Use the new ha-addon location: github.com/wmbusmeters/wmbusmeters-ha-addon
Thanks Bibo!
Bibo contributed many github workflow improvements! Thanks Bibo!
Thecem,Krzysztof Hajdamowicz, chpego and convicte contributed several improvements to the ha-addon. Thanks!
idl0r updated the eurosii driver with more telegrams. Thank you idl0r!
Roland Huß contributed compressed telegram format for the multical21. Thanks Roland!
Petter Reinholdtsen contributed several fixes to the deb building process and a speedup
of the build workflow. Thanks Petter!
Added the watertech meter.
Christoph Hannebauer contributed another auto-detect combo for the qheat driver. Thanks Christoph!
Gizmocuz added missing logging for the ell_type. Thanks Gizmocuz!
George Hopkins improved the fhkvdataiii driver to infer the current year and
the rtlwmbus driver to propagate the timestamp from rtlwmbus input into the final
json timestamp. Thanks George!
Rob Peters fixed a missing log output for ell_type. Thanks Rob!
Added the GWF water meter.
Zleba improved the qwater driver! Thanks Zleba!
The option --logfile=syslog now works.
ATTENTION! The hydrus driver has been rewritten from scratch! current_date is now meter_datetime
Several fields were printed with value 0 even if the telegram did not contain the actual zero,
such fields are no longer printed. Also the third text field has changed from max_flow_m3h
to total_at_date_m3. Use --selectfields=... if you are affected.
ATTENTION! The microclima driver has been refactored. The field device_date_time has been renamed
to meter_datetime. Also two fields related to tariffs do not occur in the actual telegrams so these
fields have been removed. The fields output has therefore been drastically changed. Use --selectfields=
to reset your setup. Historical data is now decoded and added to the json.
ATTENTION! The qwater driver has been refactored. The field device_date_time has been renamed
to meter_datetime also the due 17 date fields have been renamed. The error_code field has
disappeared since it was broken anyway and replaced with status.
ATTENTION! The sharky774 driver had a bug that triggered when the meter used Joules instead of kWh.
Also the calculated temperature difference had to be removed. You can re-add the temperature difference
by using --calculate_temperature_difference_c=flow_temperature_c-return_temperature_c
Since a field disappeared the default fields were disrupted and a shorter list of fields
have now been picked for the default fields. Please use --selectedfields=... to recreate
your previous fields.
Also the field operating_time_h now prints the proper operating time and
the new field operating_time_in_error_h prints the time when in error.
ATTENTION! A bug in the hydrocalm3 driver was found. When total_cooling_kwh
and other similar values were used as text fields (not a json fields)
they were replaced with dates instead. This was due to a bug in the new
code handling Quantity::PointInTime.
Version 1.11.0 2022-12-29
Version 1.11.0-RC2 2022-12-29
Improve release process.
Version 1.11.0-RC1 2022-12-29
Chpego and SzczepanLeon improved the HA-addon. Thanks!
Ranma added support for the pollucomf 55 driver. Thanks Ranma!
Jacek27 added another Munia temp/hygrometer version. Thanks Jacek27!
Version 1.10.2 2022-12-05
Stefan Rado improved the mqtt discovery for HA. Thanks Stefan!
Bibo improved the snap build process. Thanks Bibo!
Version 1.10.1 2022-12-05
Fix bug that prevented a direct tty link: /dev/ttyUSB0:device:t1 to work.
Version 1.10.0 2022-12-05
╭─────────────────────────────────────────────────────────────────╮
│ │
@ -7,7 +247,7 @@ Version: 1.10.0 2022-12-05
│ of writing drivers is now gone! BUT BUT BUT │
│ the final set of drivers to be converted were │
│ the multical 302/303/403/602/603/803 meters that │
│ were merged into a single hamheat driver. It was not │
│ were merged into a single kamheat driver. It was not │
│ possible to keep all of them backwards compatible! │
│ │
│ Note that the default fields for these meters are changed! │
@ -127,7 +367,7 @@ in the json whenever there is a value stored in the meter object.
I.e. an OPTIONAL field that has never received a value will not be printed.
A NON-OPTIONAL field that has never received a value will be printed with the value null.
Version: 1.9.0 2022-09-04
Version 1.9.0 2022-09-04
ATTENTION! The multical21 and flowiq drivers have been refactored to the new driver style.
@ -146,7 +386,7 @@ Added Enercal F2 heat meter.
Paulo Rossi added support for the AMB3665-M wmbus dongle for N-mode 169 MHz telegrams. Thanks Paulo!
Version 1.8.0: 2022-06-25
Version 1.8.0 2022-06-25
ATTENTION! Counter suffix _int is changed to _counter.
New fields are added to lansendw, lansenpu, qsmoke drivers.
@ -181,7 +421,7 @@ Added --ppjson to pretty print json, ie add newlines and indentation.
Alexander Streit added support for the Zenner Zelsius C5 ISF heat meter. Thanks Alexander!
Version 1.7.0: 2022-03-28
Version 1.7.0 2022-03-28
Added verio451mid heat meter.
@ -228,7 +468,7 @@ Refactor driver source code structure. It is now much easier to add a new driver
DomAtHome added support for the heat meter sharky774. Thanks DomAtHome!
Version 1.6.0: 2022-01-01
Version 1.6.0 2022-01-01
New year triggered a change to the apator162 telegram. This is now fixed.
@ -246,7 +486,7 @@ probably causing a bad parse later on.
Added multical602 heat meter.
Version 1.5.0: 2021-11-06
Version 1.5.0 2021-11-06
Close a security hole where you could trivially spoof an encrypted meter
by sending an unencrypted telegram with the same id.
@ -281,7 +521,7 @@ known to work for apators are 9,12,20,23. This is useful as a final
resort to get your apator162 readout working. You have to test different
offsets until it works. Thanks Tomasz!
Version 1.4.0: 2021-08-09
Version 1.4.0 2021-08-09
Fixed a race that sometimes caused wmbusmeters to crash when resetting the dongles,
which happens by default every 23 hours.
@ -318,7 +558,7 @@ Mblnk added support for Qundis QWater5.5. Thanks Mblnk!
Support added for the water meter Diehl IZAR RC I G4.
Version 1.3.0: 2021-04-09
Version 1.3.0 2021-04-09
You can now use "auto" as a meter driver.
Wmbusmeters will then pick the right driver when
@ -338,7 +578,7 @@ Added support for firmware version 0x14 for im871a dongle.
you run with --verbose.) The new version of the im871a firmware
supports listening to c1 and t1 at the same time.
Version 1.2.0: 2021-03-07
Version 1.2.0 2021-03-07
IMPORTANT CHANGES THAT MIGHT AFFECT YOU!vvvvvvvvvvvvvvvvvvvvvv
@ -365,7 +605,7 @@ is created only when the first telegram arrives that matches the wildcard.
Thus each meter will have its own C++ object, in which the correct state
is maintained.
Version 1.1.0: 2021-02-20
Version 1.1.0 2021-02-20
Vincent Privat added code for properly decoding several types of izar meter.
He also added full support for the heat meter sharky 775!
@ -403,7 +643,7 @@ then you might get a different id.
Added support for the Apator Elf heat meter.
Version 1.0.5: 2021-01-30
Version 1.0.5 2021-01-30
Xael South added support for the Gran-System-S electricity meters!
Thanks Xael!
@ -416,7 +656,7 @@ and another type/version detection combo! Thanks Marc!
Janus Bo Andersen fixed the omnipower driver! Thanks Janus!
Version 1.0.4: 2020-12-05
Version 1.0.4 2020-12-05
Nikodem added support for Multical803! Thanks Nikodem!
@ -429,11 +669,11 @@ Thanks Cinemarene!
Mira added support for Elster V200H water meter and the Elster Merlin 868 addon.
Thanks Mira!
Version 1.0.3: 2020-11-11
Version 1.0.3 2020-11-11
Add missing files and update man page for --nodeviceexit
Version 1.0.2: 2020-11-11
Version 1.0.2 2020-11-11
Fixed bug that prevented rtlwmbus[1234] from working.
Fixed a race that in one out of 100 runs, ignored a telegram
@ -464,7 +704,7 @@ Thanks Jacek27!
psxde added support for the Sensostar 2 heat meter.
Thanks psxde!
Version 1.0.1: 2020-10-26
Version 1.0.1 2020-10-26
Fix bug that prevented /dev/ttyUSB0:im871a:c1 to work.
Fix bug in install.sh that did not add wmbusmeters to the plugdev group.
@ -479,7 +719,7 @@ Add proper support for FlowIQ2200 water meter.
Decode two vendor values in multical603 as energy forward and returned.
Accept t1 and c1 as linkmodes for multical21 meters.
Version 1.0.0: 2020-10-25
Version 1.0.0 2020-10-25
IMPORTANT CHANGES THAT MIGHT AFFECT YOU!
@ -537,7 +777,7 @@ To search for a meter do --listmeters=water or --listmeters=multi
The wmbus device used to received the telegram and the rssi level
is part of the json, eg: "device":"rtlwmbus[1234]","rssi_dbm":-47
Version 0.9.36: 2020-09-08
Version 0.9.36 2020-09-08
Added support for detection of the proper driver
based on the manufacturer, media and version fields in the telegram.
@ -552,7 +792,7 @@ Thanks IzeCube! Though we still need an example telegram for
testing this meter to prevent regressions. So it is currently
not as well supported as the other meters.
Version 0.9.35: 2020-08-23
Version 0.9.35 2020-08-23
Added support for alarms (shell command triggered)
and resetting of dongle when no telegrams have been received
@ -568,7 +808,7 @@ Eric added support for the Multical 403. Thanks Eric!
Bibo made snapcraft fixes. The snap now builds properly! Thanks Bibo!
Version 0.9.34: 2020-07-09
Version 0.9.34 2020-07-09
Wmbusmeters should now properly handle
partially encrypted telegrams in mode 5 and 7.
@ -578,19 +818,19 @@ fork.
Bibo supplied code to auto-update the Docker hub README.
Version 0.9.33: 2020-07-01
Version 0.9.33 2020-07-01
Bibo made docker fixes. Now rtl_sdr, rtl_wmbus
and rtl_433 are part of the docker image. Thanks Bibo!
Version 0.9.32: 2020-06-30
Version 0.9.32 2020-06-30
Added support for the Lansen Smoke detector, Door/Window sensor
and Pulse counter.
The tool wmbusmeters-admin can now factory reset your amb8465 dongle.
Version 0.9.31: 2020-05-09
Version 0.9.31 2020-05-09
You can add comments in the conf and meter files.
A comment is a line that starts with #.
@ -603,23 +843,23 @@ Improvements in the izar driver. Thanks Erwan!
Bug fixes in the amd8465 driver. Thanks Henry N.!
Version 0.9.30: 2020-04-22
Version 0.9.30 2020-04-22
Erwan added support for building on FreeBSD. Thanks Erwan!
Version 0.9.29: 2020-04-03
Version 0.9.29 2020-04-03
Re-add the wmbusmeters.service file so
that the daemon can be easily started without
udev rules. Check the README.
Version 0.9.28: 2020-03-08
Version 0.9.28 2020-03-08
Improved docker work, thanks Bibo!
Better shell scripts for installing and daemon mode,
in preparation for rpm packaging. Thanks Damian!
Version 0.9.27: 2020-02-26
Version 0.9.27 2020-02-26
Added support for the apator08 meter.
Fixed important bug that caused rtl_sdr to hang
@ -628,24 +868,24 @@ Added support for both T1 and S1 modes for the CUL-dongle.
Added helpful messages when startup of daemon using rtl_wmbus
fails because /usr/bin/rtl_sdr or /usr/bin/rtl_wmbus are missing.
Version 0.9.26: 2020-02-07
Version 0.9.26 2020-02-07
Cinemarene added support for the Techem
FHKV Data III heat cost allocator. Thanks cinemarene!
Version 0.9.25: 2020-02-07
Version 0.9.25 2020-02-07
Fix bug i esyswm and ebzwmbe that printed zero values
for phase 2 and 3.
Version 0.9.24: 2020-02-06
Version 0.9.24 2020-02-06
Added the electricity meter eBZ wMB-E01 (ebzwmbe)
Fixed bugs with detecting the wmbus dongles.
Fixed bug in im871a driver that could
get out of sync and never receive any more telegrams.
Version 0.9.23: 2020-02-02
Version 0.9.23 2020-02-02
Added the electricity meters:
ESysWM-20 (esyswm) from EasyMeter
@ -657,12 +897,12 @@ Q400 (q400) from Axis Industries.
Fixed a bug in the auto-start from udev that
prevented rtlsdr/rtlwmbus to work properly.
Version 0.9.22: 2020-01-19
Version 0.9.22 2020-01-19
Bibo added docker support. Thanks Bibo!
Checkout https://hub.docker.com/repository/docker/weetmuts/wmbusmeters
Version 0.9.21: 2020-01-19
Version 0.9.21 2020-01-19
Michal Bursa helped improve detection of a failing USB device
and added support for automatically starting multiple wmbusmeters
@ -674,23 +914,23 @@ and the contents of the udev file is changed. The install script
will properly install the new files and copy the old ones to ~/old.xxxx.backup files,
and tell the user how to reload the systemd and udev daemons.
Version 0.9.20: 2019-12-11
Version 0.9.20 2019-12-11
Added support for meterfilestimestamp
to get the effect of log rotation of the meter files.
Version 0.9.19: 2019-11-26
Version 0.9.19 2019-11-26
Chester4444 added support for the nanoCUL usb stick. Thanks chester4444!
Michal added a utility program (kem-import.py) to import KEM files. Thanks Michal!
Added support for the Diehl HYDRUS watermeter.
Added proper support for Multical302.
Version 0.9.18: 2019-11-10
Version 0.9.18 2019-11-10
Jacek added support for the Sappel/IZAR 868 meter. Thanks Jacek!
Version 0.9.17: 2019-11-03
Version 0.9.17 2019-11-03
Thanks to afl-fuzz I found and added
some (in retrospect pretty obvious)
@ -702,7 +942,7 @@ Now afl-fuzz does not trigger any crash
after running for a couple of minutes.
Lets fuzz more....
Version 0.9.16: 2019-11-03
Version 0.9.16 2019-11-03
Significant rewrite of serial.cc.
WMBusmeters can now specify stdin as <device>
@ -711,7 +951,7 @@ Either raw, or rtlwmbus formatted if stdin:rtlwmbus
is supplied as the <device>. Check the README for
more additions.
Version 0.9.15: 2019-10-20
Version 0.9.15 2019-10-20
Added Bmeter (rfmamb) and Lansen room sensors (lansenth).
Added support for the rfmrx2 dongle.
@ -719,7 +959,7 @@ Added rawtty (eg /dev/ttyUSB0:38400) support for dongles
that only transmit raw telegrams on the serial port.
Added the ability to add static json data tailored for the meter.
Version 0.9.14: 2019-09-16
Version 0.9.14 2019-09-16
Added negative match rule for ids. You can now write:
id=78*,!7812345*,!78222222
@ -729,16 +969,16 @@ nor the meter with the exact id 78222222.
The order of the match rules does not matter.
Version 0.9.13: 2019-08-14
Version 0.9.13 2019-08-14
Fix bug that prevented rtl_wmbus to run inside daemon.
Version 0.9.12: 2019-08-12
Version 0.9.12 2019-08-12
Added experimental detection for apator162 where the total water consumption
is located within the proprietary data.
Version 0.9.11: 2019-06-20
Version 0.9.11 2019-06-20
Added --meterfilesnaming=(name|id|name-id)
to choose the file name written meter file.
@ -747,7 +987,7 @@ Naming using id or name-id is necessary when a meter
specification listens to many different meters using id
wildcards.
Version 0.9.10: 2019-06-13
Version 0.9.10 2019-06-13
Update logrotate to trigger HUP when rotating log files.
This will re-initialize the serial connection to the usb dongle
@ -755,7 +995,7 @@ and reload the config files as well.
Added reload command to systemctl.
Version 0.9.9: 2019-06-11
Version 0.9.9 2019-06-11
Added support for the signal HUP to trigger wmbusmeters(d)
to reload config files.
@ -774,11 +1014,11 @@ If you do not do this, then wmbusmeters will assume that it must
listen to both c1 and t1 at the same time. Which might
be fine for amd8465 and rtlwmbus dongles, but not for imst871a.
Version 0.9.8: 2019-05-22
Version 0.9.8 2019-05-22
Added support for the EurisII heat cost allocator from Innotas.
Version 0.9.7: 2019-05-04
Version 0.9.7 2019-05-04
FeatureExpert added support for the Vario 451 heat meter. Thanks FeatureExpert!
@ -800,17 +1040,17 @@ Some untyped json field names, like "flow_temperature":10 had to
change name to "flow_temperature_c":0 (so that if --addconversions=F
is used, then "flow_temperature_f":32 will be added.)
Version 0.9.6: 2019-04-27
Version 0.9.6 2019-04-27
Added support for the MK Radio 3 water meter. Thanks FeatureExpert!
Version 0.9.5: 2019-04-26
Version 0.9.5 2019-04-26
Improved install/uninstall scripts. Thanks Bibo!
Fixed wrong default sample frequency for rtl_wmbus. Thanks inc90!
Version 0.9.4: 2019-04-03
Version 0.9.4 2019-04-03
The device auto can now detect an rtlsdr dongle and start
rtl_sdr|rtl_wmbus properly. It can only detecht the rtlsdr
@ -821,7 +1061,7 @@ Added the meter vendor Echelon to the generic amiplus meter type.
(The Echelon meter seems to be a standard electricity meter with a
wmbus addon sourced from Develco.)
Version 0.9.3: 2019-03-20
Version 0.9.3 2019-03-20
Added initial support for the generic Tauron Amiplus electricity meter type (amiplus).
This is actually a generic meter type, that will match the meter vendors
@ -834,7 +1074,7 @@ that is merely wrapped inside a wmbus telegram. Lets hope
the offset to the consumption is stable between
meters of this type.
Verison 0.9.2: 2019-03-12
Verison 0.9.2 2019-03-12
Add max_flow to the iperl meter. This is based
on a guess that the flow value is actually the max
@ -845,7 +1085,7 @@ column in the human output and --format=fields output.
There is also "max_flow_m3h"="123" in the json output, but that does not
affect existing code depending on json.
Verison 0.9.1: 2019-03-05
Verison 0.9.1 2019-03-05
Added support for listening to multiple meters
with the same key (or no key). Simple use '*'
@ -854,7 +1094,7 @@ as meter id, or make a comma separated list.
Added experimental support for listening to
--n1a to --n1f and an imst dongle. Might not work.
Version 0.9.0: 2019-02-26
Version 0.9.0 2019-02-26
Reading the meter settings from config files
in /etc is now supported.
@ -866,15 +1106,15 @@ Updated some command line options robot is now format.
Listening to qcaloric now seems to work.
Added support for MacOSX.
Version 0.8.4: 2019-02-23
Version 0.8.4 2019-02-23
Add config files support and daemon mode.
Version 0.8.3: 2019-02-17
Version 0.8.3 2019-02-17
Add experimental support for qcaloric.
Version 0.8.2: 2019-01-27
Version 0.8.2 2019-01-27
Properly supports short C1 frames after it has received a long frame.
(Ie the format signature hash is properly calculated and used.)
@ -886,7 +1126,7 @@ column in the human output and --format=fields output.
There is also "max_flow_m3h"="123" in the json output, but that does not
affect existing code depending on json.
Version 0.8.1: 2019-01-04
Version 0.8.1 2019-01-04
Fixed memory leak in shell invocation.
Improved dvparser to properly handle the supercom587 telegrams.
@ -894,15 +1134,15 @@ Improved dvparser to properly handle the supercom587 telegrams.
Added address sanitizer to debug build.
Added static analysis check.sh.
Version 0.8: 2018-11-29
Version 0.8 2018-11-29
Multical21 now reports flow temperature and external temperature.
Version 0.7: 2018-11-23
Version 0.7 2018-11-23
David Mallon contributed the iPerl water meter! Thanks David!
Version 0.6: 2018-11-02
Version 0.6 2018-11-02
Added --shell command to invoke for example: mosquitto to send an MQTT message
or psql to insert received data into a database.
@ -911,14 +1151,14 @@ Added proper T1 telegram support. First meter to use T1 is supercom587.
A large part of the supercom587 message is not yet properly decoded.
However the important part, the total consumption, is correct.
Version 0.5:
Version 0.5 2018-04-01
Added difvif parser to extract as much as possible automatically
from the the telegram.
Added initial support for Omnipower electricity meter.
Version 0.4:
Version 0.4 2018-03-05
Added initial support for heat energy meter Multical302.
Restructured to source to more easily support multiple meters.
@ -927,10 +1167,10 @@ ATTENTION! There is a difference in the command line interface.
You must now proved the meter type. Thus for each meter you
supply quadruplets instead of triplets.
Version 0.3:
Version 0.3 2018-02-28
Added support for wmbus USB receiver Amber AMB8465.
Version 0.2:
Version 0.2 2017-08-09
Initial working release supporting wmbus USB receiver IMST im871a and the meter Multical21.

Wyświetl plik

@ -1,4 +1,4 @@
# Copyright (C) 2017-2022 Fredrik Öhrström (gpl-3.0-or-later)
# Copyright (C) 2017-2024 Fredrik Öhrström (gpl-3.0-or-later)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -64,7 +64,6 @@ else
# Release build
DEBUG_FLAGS=-Os -g
STRIP_BINARY=cp $(BUILD)/wmbusmeters $(BUILD)/wmbusmeters.g; $(STRIP) $(BUILD)/wmbusmeters
STRIP_ADMIN=cp $(BUILD)/wmbusmeters-admin $(BUILD)/wmbusmeters-admin.g; $(STRIP) $(BUILD)/wmbusmeters-admin
GCOV=To_run_gcov_add_DEBUG=true
endif
endif
@ -99,14 +98,13 @@ else
endif
VERSION:=$(BRANCH)$(TAG)
DEBVERSION:=$(BRANCH)$(TAG)
LOCALDEBVERSION:=$(BRANCH)$(TAG)
LOCALCHANGES:=
ifneq ($(strip $(CHANGES)),)
# There are local un-committed changes.
VERSION:=$(VERSION) with local changes
COMMIT_HASH:=$(COMMIT_HASH) with local changes
DEBVERSION:=$(DEBVERSION)l
COMMIT_HASH:=$(COMMIT_HASH)+
LOCALCHANGES:=true
endif
@ -140,16 +138,27 @@ ifeq ($(shell uname -s),FreeBSD)
USBLIB = -lusb
endif
ifeq ($(shell uname -s),Darwin)
CXXFLAGS += -I$(shell brew --prefix)/include
LDFLAGS += -L$(shell brew --prefix)/lib
endif
$(BUILD)/%.o: src/%.cc $(wildcard src/%.h)
$(CXX) $(CXXFLAGS) $< -c -E > $@.src
$(CXX) $(CXXFLAGS) $< -MMD -c -o $@
$(BUILD)/%.o: src/%.c $(wildcard src/%.h)
$(CXX) -I/usr/include/libxml2 $(CXXFLAGS) $< -c -E > $@.src
$(CXX) -I/usr/include/libxml2 -fpermissive $(CXXFLAGS) $< -MMD -c -o $@
PROG_OBJS:=\
$(BUILD)/address.o \
$(BUILD)/aes.o \
$(BUILD)/aescmac.o \
$(BUILD)/bus.o \
$(BUILD)/cmdline.o \
$(BUILD)/config.o \
$(BUILD)/drivers.o \
$(BUILD)/dvparser.o \
$(BUILD)/formula.o \
$(BUILD)/mbus_rawtty.o \
@ -175,6 +184,7 @@ PROG_OBJS:=\
$(BUILD)/wmbus_rawtty.o \
$(BUILD)/wmbus_rc1180.o \
$(BUILD)/wmbus_utils.o \
$(BUILD)/xmq.o \
$(BUILD)/lora_iu880b.o \
# If you run: "make DRIVER=minomess" then only driver_minomess.cc will be compiled into wmbusmeters.
@ -184,28 +194,37 @@ ifeq ($(DRIVER),)
DRIVER_OBJS:=$(wildcard src/meter_*.cc) $(wildcard src/driver_*.cc)
else
$(info Building a single driver $(DRIVER))
DRIVER_OBJS:=src/driver_auto.cc src/driver_unknown.cc $(wildcard src/meter_*.cc) src/driver_$(DRIVER).cc
DRIVER_OBJS:=src/driver_auto.cc src/driver_unknown.cc src/driver_dynamic.cc $(wildcard src/meter_*.cc) src/driver_$(DRIVER).cc
endif
DRIVER_OBJS:=$(patsubst src/%.cc,$(BUILD)/%.o,$(DRIVER_OBJS))
all: $(BUILD)/wmbusmeters $(BUILD)/wmbusmetersd $(BUILD)/wmbusmeters.g $(BUILD)/wmbusmeters-admin $(BUILD)/testinternals
all: $(BUILD)/wmbusmeters $(BUILD)/wmbusmetersd $(BUILD)/wmbusmeters.g $(BUILD)/testinternals
deb:
@if [ "$(RELEASE)" = "" ] ; then echo "Usage: make deb TAG=1.9.0" ; exit 1 ; fi
# Create a local binary only package.
deb_local:
@rm -rf packaging
@mkdir -p packaging
@echo "Checking out tag $(RELEASE)..."
@(cd packaging ; git clone $(PWD) wmbusmeters-$(RELEASE) ; cd wmbusmeters-$(RELEASE) ; git -c advice.detachedHead=false checkout tags/$(RELEASE) )
@(cd packaging/wmbusmeters-$(RELEASE) ; git show -s --format=%ct > ../release_date )
@echo "Using latest commit..."
@(cd packaging ; git clone $(PWD) wmbusmeters-$(LOCALDEBVERSION) ; cd wmbusmeters-$(LOCALDEBVERSION) )
@echo "Applying local changes..."
@(git diff > packaging/local_patch_$(LOCALDEBVERSION) ; \
cd packaging/wmbusmeters-$(LOCALDEBVERSION) ; \
patch -p 1 < ../local_patch_$(LOCALDEBVERSION) )
@(cd packaging/wmbusmeters-$(LOCALDEBVERSION) ; git show -s --format=%ct > ../release_date )
@echo "Removing git history..."
@(cd packaging ; rm -rf wmbusmeters-$(RELEASE)/.git )
@(cd packaging ; rm -rf wmbusmeters-$(LOCALDEBVERSION)/.git )
@echo "Setting file timestamps to commit date..."
@(cd packaging ; export UT=$$(cat ./release_date) ; find . -exec touch -d "@$$UT" \{\} \; )
@echo "Creating orig archive..."
@(cd packaging ; tar czf ./wmbusmeters_$(RELEASE).orig.tar.gz wmbusmeters-$(RELEASE) )
@(cd packaging ; tar czf ./wmbusmeters_$(LOCALDEBVERSION).orig.tar.gz wmbusmeters-$(LOCALDEBVERSION) )
@echo "Installing debian directory..."
@(cd packaging/wmbusmeters-$(LOCALDEBVERSION) ; cp -a deb debian )
@echo "Creating local dummy changelog..."
@echo "wmbusmeters ($(LOCALDEBVERSION)-99) unstable; urgency=low\n\n" \
" * Local build of deb current sources $(VERSION) $(COMMIT_HASH)\n\n" \
" -- No User <nouser@nowhere> $(shell LANG=C date -R)\n" > packaging/wmbusmeters-$(LOCALDEBVERSION)/debian/changelog
@echo "Running debbuild..."
@(cd packaging/wmbusmeters-$(RELEASE) ; cp -a deb debian; debuild )
@(cd packaging/wmbusmeters-$(LOCALDEBVERSION) ; debuild -i -us -uc -b )
# Check docs verifies that all options in the source have been mentioned in the README and in the man page.
# Also any option not in the source but mentioned in the docs is warned for as well.
@ -220,13 +239,19 @@ check_docs:
@diff /tmp/options_in_code /tmp/options_in_binary || echo CODE_VS_BINARY
@echo "OK docs"
install: $(BUILD)/wmbusmeters check_docs
echo "Installing $(BUILD)/wmbusmeters"
install:
@if [ ! -f $(BUILD)/wmbusmeters ] ; then echo "Cannot find the binary to install! You have to run just \"make\" first!" ; exit 1 ; fi
@echo "Installing $(BUILD)/wmbusmeters"
@./install.sh $(BUILD)/wmbusmeters $(DESTDIR) $(EXTRA_INSTALL_OPTIONS)
# Uninstall binaries and manpages. But keep configuration data and wmbusmeters user/group.
uninstall:
@./uninstall.sh /
# Uninstall everything including configuration and wmbusmeters user/group.
uninstall_purge:
@./uninstall.sh / --purge
snapcraft:
snapcraft
@ -237,7 +262,7 @@ $(BUILD)/authors.h:
# Build binary with debug information. ~15M size binary.
$(BUILD)/wmbusmeters.g: $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/main.o $(BUILD)/short_manual.h
$(CXX) -o $(BUILD)/wmbusmeters.g $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lrtlsdr $(USBLIB) -lpthread
$(CXX) -o $(BUILD)/wmbusmeters.g $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lrtlsdr -lxml2 $(USBLIB) -lpthread
# Production build will have debug information stripped. ~1.5M size binary.
# DEBUG=true builds, which has address sanitizer code, will always keep the debug information.
@ -248,15 +273,6 @@ $(BUILD)/wmbusmeters: $(BUILD)/wmbusmeters.g
$(BUILD)/wmbusmetersd: $(BUILD)/wmbusmeters
cp $(BUILD)/wmbusmeters $(BUILD)/wmbusmetersd
ifeq ($(shell uname -s),Darwin)
$(BUILD)/wmbusmeters-admin:
touch $(BUILD)/wmbusmeters-admin
else
$(BUILD)/wmbusmeters-admin: $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(BUILD)/short_manual.h
$(CXX) -o $(BUILD)/wmbusmeters-admin $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(LDFLAGS) -lmenu -lform -lncurses -lrtlsdr $(USBLIB) -lpthread
$(STRIP_ADMIN)
endif
$(BUILD)/short_manual.h: README.md
echo 'R"MANUAL(' > $(BUILD)/short_manual.h
sed -n '/wmbusmeters version/,/```/p' README.md \
@ -269,10 +285,10 @@ testinternals: $(BUILD)/testinternals
$(BUILD)/testinternals.o: $(PROG_OBJS) $(DRIVER_OBJS) $(wildcard src/*.h)
$(BUILD)/testinternals: $(BUILD)/testinternals.o
$(CXX) -o $(BUILD)/testinternals $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lrtlsdr $(USBLIB) -lpthread
$(CXX) -o $(BUILD)/testinternals $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lrtlsdr -lxml2 $(USBLIB) -lpthread
$(BUILD)/fuzz: $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/fuzz.o
$(CXX) -o $(BUILD)/fuzz $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lrtlsdr -lpthread
$(CXX) -o $(BUILD)/fuzz $(PROG_OBJS) $(DRIVER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lrtlsdr -lxml2 -lpthread
clean_executables:
rm -rf build/wmbusmeters* build_arm/wmbusmeters* build_debug/wmbusmeters* build_arm_debug/wmbusmeters* *~
@ -309,16 +325,16 @@ lcov:
(cd build_debug; genhtml lcov.info)
xdg-open build_debug/src/index.html
test:
test: build/xmq
@./test.sh build/wmbusmeters
testd:
testd: build/xmq
@./test.sh build_debug/wmbusmeters
testdriver:
testdriver: build/xmq
@./tests/test_drivers.sh build/wmbusmeters driver_${DRIVER}.cc
testdriverd:
testdriverd: build/xmq
@./tests/test_drivers.sh build_debug/wmbusmeters driver_${DRIVER}.cc
update_manufacturers:
@ -384,12 +400,12 @@ update_manufacturers:
rm *.flags manufacturers.txt
GCC_MAJOR_VERSION:=$(shell gcc --version | head -n 1 | sed 's/.* \([0-9]\)\.[0-9]\.[0-9]$$/\1/')
GCC_MAJOR_VERSION:=$(shell cc --version | head -n 1 | sed 's/.* \([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*$$/\1/')
AFL_HOME:=AFLplusplus
$(AFL_HOME)/src/afl-cc.c:
mkdir -p AFLplusplus
if ! dpkg -s gcc-$(GCC_MAJOR_VERSION)-plugin-dev 2>/dev/null >/dev/null ; then echo "Please run: sudo apt install gcc-$(GCC_MAJOR_VERSION)-plugin-dev"; exit 1; fi
@if ! dpkg -s gcc-$(GCC_MAJOR_VERSION)-plugin-dev 2>/dev/null >/dev/null ; then echo "Please run: sudo apt install gcc-$(GCC_MAJOR_VERSION)-plugin-dev"; exit 1; fi
git clone https://github.com/AFLplusplus/AFLplusplus.git
afl_prepared: AFLplusplus/src/afl-cc.c
@ -437,6 +453,15 @@ deploy:
collect_copyrights:
./scripts/collect_copyrights.sh deb/copyright
3rdparty/xmq/build/default/release/xmq: $(wildcard 3rdparty/xmq/src/main/c/* 3rdparty/xmq/src/main/c/parts/*)
@mkdir -p 3rdparty
@(cd 3rdparty; git clone --depth 1 https://github.com/libxmq/xmq.git; cd xmq; ./configure)
@cat 3rdparty/xmq/build/default/spec.mk
@if [ "$$(cat 3rdparty/xmq/build/default/spec.mk | grep CC)" = "CC:=gcc" ]; then (cd 3rdparty/xmq; make VERBOSE=) ; else rm -f $@ ; mkdir -p $$(dirname $@); touch $@ ; echo "Could not build xmq." ; fi
build/xmq: 3rdparty/xmq/build/default/release/xmq
@cp $< $@
# Include dependency information generated by gcc in a previous compile.
include $(wildcard $(patsubst %.o,%.d,$(PROG_OBJS) $(DRIVER_OBJS)))

317
README.md
Wyświetl plik

@ -1,21 +1,48 @@
# wmbusmeters
The program receives and decodes C1,T1 or S1 telegrams
(using the wireless mbus protocol or the wired mbus protocol) to acquire
utility meter readings. The readings can then be published using
MQTT, curled to a REST api, inserted into a database or stored in a log file.
The program acquires utility meter readings from wired m-bus or
wireless wm-bus meters. The readings can then be published using
MQTT, curled to a REST api, inserted into a database or stored in a
log file.
[FAQ/WIKI/MANUAL pages](https://weetmuts.github.io/wmbusmeterswiki/)
# What does it do?
Wmbusmeters converts incoming telegrams from (w)mbus/OMS compatible meters like:
`1844AE4C4455223368077A55000000_041389E20100023B0000`
into human readable:
`MyTapWater 33225544 123.529 m³ 0 m³/h 2024-03-03 19:36:22`
or into csv:
`MyTapWater;33225544;123.529;0;2024-03-03 19:36:45`
or into json:
```json
{
"media":"water",
"meter":"iperl",
"name":"MyTapWater",
"id":"33225544",
"max_flow_m3h":0,
"total_m3":123.529,
"timestamp":"2024-03-03T18:37:00Z"
}
```
Wmbusmeters can collect telegrams from radio using hardware dongles or rtl-sdr software radio dongles,
or from m-bus meters using serial ports, or from files/pipes.
[FAQ/WIKI/MANUAL pages](https://wmbusmeters.github.io/wmbusmeters-wiki/)
The program runs on GNU/Linux, MacOSX, FreeBSD, and Raspberry Pi.
| System | Status |
| ------------ |:-------------:|
| Ubuntu | [![Build Ubuntu Status](https://github.com/weetmuts/wmbusmeters/workflows/Build%20Ubuntu/badge.svg)](https://github.com/weetmuts/wmbusmeters/actions)|
| MacOSX | [![Build MacOSX Status](https://github.com/weetmuts/wmbusmeters/workflows/Build%20MacOSX/badge.svg)](https://github.com/weetmuts/wmbusmeters/actions)|
| Docker | [![Build Docker Status](https://github.com/weetmuts/wmbusmeters/workflows/Build%20docker/badge.svg)](https://hub.docker.com/r/weetmuts/wmbusmeters/)|
| Snap | [![wmbusmeters](https://snapcraft.io//wmbusmeters/badge.svg)](https://snapcraft.io/wmbusmeters)|
| Ubuntu | [![Build Ubuntu Status](https://github.com/wmbusmeters/wmbusmeters/workflows/Build%20Ubuntu/badge.svg)](https://github.com/wmbusmeters/wmbusmeters/actions)|
| MacOSX | [![Build MacOSX Status](https://github.com/wmbusmeters/wmbusmeters/workflows/Build%20MacOSX/badge.svg)](https://github.com/wmbusmeters/wmbusmeters/actions)|
| Docker | [![Build Docker Status](https://github.com/wmbusmeters/wmbusmeters/workflows/Build%20docker/badge.svg)](https://hub.docker.com/r/wmbusmeters/wmbusmeters/)|
| Snap | [![Build Snap Status](https://github.com/wmbusmeters/wmbusmeters/workflows/Build%20Snap/badge.svg)](https://snapcraft.io/wmbusmeters)|
# Distributions
@ -29,18 +56,18 @@ Availability of **wmbusmeters** for other Linux distributions can be checked on
# Docker
Experimental docker containers are available here: https://hub.docker.com/r/weetmuts/wmbusmeters
Experimental docker containers are available here: https://hub.docker.com/r/wmbusmeters/wmbusmeters
# Snap
Experimental snaps are available here: https://snapcraft.io/wmbusmeters
Read the wiki for more info on how to use the snap: https://weetmuts.github.io/wmbusmeterswiki/SNAP.html
Read the wiki for more info on how to use the snap: https://wmbusmeters.github.io/wmbusmeters-wiki/SNAP.html
# Build from source and run as a daemon
Building and installing from source is easy and recommended since the
development progresses quickly. First remove the wmbus dongle
(im871a,amb8465,amb3665,cul,rc1180) or the generic rtlsdr dongle (RTL2832U)
(im871a,amb8465(metis),amb3665,cul,rc1180) or the generic rtlsdr dongle (RTL2832U)
from your computer. Then do:
`./configure; make; sudo make install` will install wmbusmeters as a daemon.
@ -48,7 +75,7 @@ from your computer. Then do:
# Usage
Check the contents of your `/etc/wmbusmeters.conf` file, assuming it
has `device=auto:t1` and you are using a im871a,amb8465,amb3665,rc1180,cul or rtlsdr device,
has `device=auto:t1` and you are using a im871a,amb8465(metis),amb3665,rc1180,cul or rtlsdr device,
then you can now start the daemon with `sudo systemctl start wmbusmeters`
or you can try it from the command line `wmbusmeters auto:t1`
@ -64,6 +91,11 @@ wmbus dongles when wmbusmeters startup.
If the serial device (ttyUSB0) might change you can also use `device=im871a:c1,t1`
which will probe all serial devices but only scans for im871a which also speeds it up.
Note that the rtl-sdr devices are not found under the tty devices (e.g. `/dev/tty...`).
Instead the rtl-sdr devices are accessed through character device special files named `/dev/swradio0` to `/dev/swradio255`[^kernel_docs_sdr]. Wmbusmeters uses librtsldr to probe these devices.
[^kernel_docs_sdr]: https://docs.kernel.org/userspace-api/media/v4l/dev-sdr.html?highlight=sdr#software-defined-radio-interface-sdr
If you have to scan serial devices, then remember that some Raspberry PIs are upset when
random data is sent to `/dev/ttyAMA0` when it is configured in bluetooth mode.
To solve this, add `donotprobe=/dev/ttyAMA0`
@ -96,7 +128,7 @@ you can add `donotprobe=/dev/ttyUSB0` or `donotprobe=all`.
You can specify combinations like: `device=rc1180:t1` `device=auto:c1`
to set the rc1180 dongle to t1 but any other auto-detected dongle to c1.
Some dongles have identifiers (im871a,amb8465,amb3665 and rtlsdrs) (for example: rtlsdr can be set with `rtl_eeprom -s myname`)
Some dongles have identifiers (im871a,amb8465(metis),amb3665 and rtlsdrs) (for example: rtlsdr can be set with `rtl_eeprom -s myname`)
You might have two rtlsdr dongles, one attached to an antenna tuned to 433MHz and the other
attached to an antenna tuned for 868.95MHz, then a more complicated setup could look like this:
@ -125,9 +157,11 @@ bus the mbus poll request should be sent to.
wmbusmeters --pollinterval=60s MAIN=/dev/ttyUSB0:mbus:2400 MyTempMeter piigth:MAIN:mbus 12001932 NOKEY
```
If you want to poll an mbus meter using the primary address, just use
a number between 0 and 250 instead of the full 8 digit secondary
address.
If you want to poll an mbus meter using the primary address, use p0 to p250 (deciman numbers)
instead of the full 8 digit secondary address.
```
wmbusmeters --pollinterval=60s MAIN=/dev/ttyUSB0:mbus:2400 MyTempMeter piigth:MAIN:mbus p0 NOKEY
```
# Example wmbusmeter.conf file
@ -168,7 +202,7 @@ And an mbus meter file in /etc/wmbusmeters.d/MyTempHygro
```ini
name=MyTempHygro
id=11223344
driver=piigth:mbus
driver=piigth:MAIN:mbus
pollinterval=60s
```
@ -212,9 +246,19 @@ The latest reading of the meter can also be found here: `/var/lib/wmbusmeters/me
You can use several ids using `id=1111111,2222222,3333333` or you can listen to all
meters of a certain type `id=*` or you can suffix with star `id=8765*` to match
all meters with a given prefix. If you supply at least one positive match rule, then you
can add negative match rules as well. For example `id=*,!2222*`
can add filter out rules as well. For example `id=*,!2222*`
which will match all meter ids, except those that begin with 2222.
You can also specify the exact manufacturer, version and type: `id=11111111.M=KAM.V=1b.T=16`
or a subset: `id=11111111.T=16` or all telegrams from 22222222 except those with version 77:
`id=22222222,!22222222.V=77` You can also use the fully specified secondary address that is
printed by libmbus after doing a bus scan, ie `100002842941011B` which is equivalent to
`10000284.M=PII.V=01.T=1B`
When matching all meters from the command line you can use `ANYID` instead of `*` to avoid shell quotes.
# Add static and calculated fields to the output
You can add the static json data `"address":"RoadenRd 456","city":"Stockholm"` to every json message with the
wmbusmeters.conf setting:
@ -225,8 +269,113 @@ field_city=Stockholm
If you add `field_floor=5` to the meter file `MyTapWater`, then you can have the meter tailored static json `"floor":"5"` added to telegrams handled by that particular meter. (The old prefix json_ still works.)
If you are running on a Raspberry PI with flash storage and you relay the data to
another computer using a shell command (`mosquitto_pub` or `curl` or similar) then you might want to remove `meterfiles` and `meterfilesaction` to minimize the writes to the local flash file system.
You can add unit conversions and calculated values to the meter files using
`calculate_...`. The formulas track units. If the unit do not match
up, then the formula will generate a null value. When two units are compatible
it will automatically convert the value between two units.
The formula
```ini
calculate_sum_mj=5 kwh + 8 gj + (7 kw * 3 h)
```
will add the field:
```json
"sum_mj":8093.6
```
Units inside the formula calculation are tracked as arbitrary SI unit
exponents (ie Volt is `1kgm²s⁻³a⁻¹`) however the final result must be
a named unit (ie the calculated field must end with `_v`). The
existing named units can be found with `wmbusmeters --listunits`.
If you make a mistake in the formula you will get a warning:
```
Warning! Ignoring calculated field sum because parse failed:
Cannot add [kw|Power|1000kgm²s⁻³] to [gj|Energy|1×10⁹kgm²s⁻²]!
5 kw + 8 gj + (7 kw * 3 h)
^~~~~
```
You need parentheses in the formulas since operator precedence is not yet implemented.
```ini
calculate_total_l=total_m3
calculate_approx_power_m3ch=(t1_temperature_c-t2_temperature_c)*volume_flow_m3h
calculate_total_mj=total_energy_consumption_kwh
```
```
wmbusmeters --format=json --ppjson
--field_collector=cm57829
--calculate_total_l=total_volume_m3
--calculate_approx_power_m3ch='(t1_temperature_c-t2_temperature_c)*volume_flow_m3h'
--calculate_total_mj=total_energy_consumption_kwh
5e442d2c1155775540047a7d0050252f2f0406c50e000004147B86000004ff074254000004ff086047000002594117025d9a14023Bed0302ff220000026cca2c4406750B00004414ad680000426cc12c2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
Heato kamheat 55775511 NOKEY
```
which will output:
```json
{
"media":"heat",
"meter":"kamheat",
"name":"Heato",
"id":"55775511",
"status":"OK",
"total_energy_consumption_kwh":3781,
"total_volume_m3":344.27,
"volume_flow_m3h":1.005,
"t1_temperature_c":59.53,
"t2_temperature_c":52.74,
"forward_energy_m3c":21570,
"return_energy_m3c":18272,
"meter_date":"2022-12-10",
"target_energy_kwh":2933,
"target_volume_m3":267.97,
"target_date":"2022-12-01",
"total_l":344270,
"approx_power_m3ch":6.82395,
"total_mj":13611.6,
"timestamp":"2023-01-14T07:20:22Z",
"collector":"cm57829"
}
```
If you have connected your Lansen pulse counting meter to an
electricity meter triggering a pulse per 0.1 kwh, then you can
directly calculate a value based on the counters:
```
wmbusmeters --format=json --ppjson
--calculate_total_kwh='1000 kwh + (a_counter * 0.1 kwh)'
234433300602010014007a8e0400002f2f0efd3a1147000000008e40fd3a341200000000
Electricity lansenpu 00010206 NOKEY
```
```json
{
"media":"other",
"meter":"lansenpu",
"name":"Electricity",
"id":"00010206",
"status":"POWER_LOW",
"a_counter":4711,
"b_counter":1234,
"total_kwh":1471.1,
"timestamp":"2023-01-14T07:25:34Z"
}
```
# Miscellaneous
If you are running on a Raspberry PI with flash storage and you relay
the data to another computer using a shell command (`mosquitto_pub` or
`curl` or similar) then you might want to remove `meterfiles` and
`meterfilesaction` to minimize the writes to the local flash file
system.
Also when using the Raspberry PI it can get confused by the serial ports, in particular the bluetooth port might come and
go as a serial tty depending on the config. Therefore it can be advantageous to use the auto device to find the proper tty
@ -281,14 +430,13 @@ depending on if you are running as a daemon or not.
# Running without config files, good for experimentation and test.
```
wmbusmeters version: 1.10.0
wmbusmeters version: 1.15.0
Usage: wmbusmeters {options} [device] { [meter_name] [meter_driver] [meter_id] [meter_key] }*
wmbusmeters {options} [hex] { [meter_name] [meter_driver] [meter_id] [meter_key] }*
wmbusmetersd {options} [pid_file]
As {options} you can use:
--addconversions=<unit>+ add conversion to these units to json and meter env variables (GJ)
--alarmexpectedactivity=mon-fri(08-17),sat-sun(09-12) Specify when the timeout is tested, default is mon-sun(00-23)
--alarmshell=<cmdline> invokes cmdline when an alarm triggers
--alarmtimeout=<time> Expect a telegram to arrive within <time> seconds, eg 60s, 60m, 24h during expected activity.
@ -301,9 +449,12 @@ As {options} you can use:
--calculate_flow_f=flow_temperature_c
--debug for a lot of information
--donotprobe=<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys.
--driver=<file> load a driver
--driversdir=<dir> load all drivers in dir
--exitafter=<time> exit program after time, eg 20h, 10m 5s
--format=<hr/json/fields> for human readable, json or semicolon separated fields
--help list all options
--identitymode=(id|id-mfct|full|none) group meter state based on the identity mode. Default is id.
--ignoreduplicates=<bool> ignore duplicate telegrams, remember the last 10 telegrams
--field_xxx=yyy always add "xxx"="yyy" to the json output and add shell env METER_xxx=yyy (--json_xxx=yyy also works)
--license print GPLv3+ license
@ -314,7 +465,7 @@ As {options} you can use:
--listmeters list all meter drivers
--listmeters=<search> list all meter drivers containing the text <search>
--listunits list all unit suffixes that can be used for typing values
--logfile=<file> use this file for logging
--logfile=<file> use this file for logging or --logfile=syslog
--logtelegrams log the contents of the telegrams for easy replay
--logtimestamps=<when> add log timestamps: always never important
--meterfiles=<dir> store meter readings in dir
@ -322,6 +473,7 @@ As {options} you can use:
--meterfilesnaming=(name|id|name-id) the meter file is the meter's: name, id or name-id
--meterfilestimestamp=(never|day|hour|minute|micros) the meter file is suffixed with a
timestamp (localtime) with the given resolution.
--metershell=<cmdline> invokes cmdline with env variables the first time a meter is seen since startup
--nodeviceexit if no wmbus devices are found, then exit immediately
--normal for normal logging
--oneshot wait for an update from each meter, then quit
@ -343,7 +495,7 @@ As {options} you can use:
As device you can use:
`auto:c1`, to have wmbusmeters probe for devices: im871a, amb8465, amb3665, cul, rc1180 or rtlsdr (spawns rtlwmbus).
`auto:c1`, to have wmbusmeters probe for devices: im871a, amb8465(metis), amb3665, cul, rc1180 or rtlsdr (spawns rtlwmbus).
`im871a:c1` to start all connected *im871a* devices in *c1* mode, ignore all other devices.
@ -356,7 +508,7 @@ You can also specify rtlwmbus and if you set the serial in the rtlsdr
dongle using `rtl_eeprom -s 1234` you can also refer to a specific
rtlsdr dongle like this `rtlwmbus[1234]`.
`/dev/ttyUSB0:amb8465`, if you have an amb8465 dongle assigned to ttyUSB0. Other suffixes are im871a,cul.
`/dev/ttyUSB0:amb8465`, if you have an amb8465(metis) dongle assigned to ttyUSB0. Other suffixes are im871a,cul.
(Note that a plain `/dev/ttyUSB0` no longer works, you have to specify the device expected on the device.)
@ -365,10 +517,24 @@ These telegrams are expected to have the data link layer crc bytes removed alrea
`MAIN=/dev/ttyUSB0:mbus:2400`, assume ttyUSB0 is an serial to mbus-master converter. The speed is set to 2400 bps.
`rtlwmbus`, to spawn the background process: `rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -s`
`rtlwmbus`, to spawn the background process: `rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -f -s`
for each attached rtlsdr dongle. This will listen to S1,T1 and C1 meters in parallel.
Note that this uses a noticeable amount of CPU time by rtl_wmbus.
For the moment, it is necessary to send the stderr to a file (/dev/null) because of a bug:
https://github.com/osmocom/rtl-sdr/commit/142325a93c6ad70f851f43434acfdf75e12dfe03
Until this bug fix has propagated into Debian/Fedora etc, wmbusmeters uses a tmp file
to see the stderr output from rtl_sdr. This tmp file is created in /tmp and will
generate 420 bytes of data once ever 23 hours.
The current command line used by wmbusmeters to start the rtl_wmbus pipeline is therefore a bit longer:
```
ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ;
echo ERRFILE=$ERRFILE ; date -Iseconds > $ERRFILE ;
tail -f $ERRFILE & /usr/bin/rtl_sdr -d 0 -f 868.625M -s 1.6e6 - 2>>$ERRFILE | /usr/bin/rtl_wmbus -s -f
```
Note that the standard -s option uses a noticeable amount of CPU time by rtl_wmbus.
You can therefore use a tailored rtl_wmbus command that is more suitable for your needs.
`rtlwmbus:CMD(<command line>)`, to specify the entire background
@ -378,9 +544,10 @@ The command line cannot contain parentheses.
Likewise for rtl433.
Here is an example command line that reduces the rtl_wmbus CPU usage if you only need T1/C1 telegrams.
It disable S1 decoding (`-p s`) and trades lower cpu usage for reception performance (`-a`):
It disable S1 decoding (`-p s`) and trades lower cpu usage for reception performance (`-a`).
You should always add the `-f` option to enable detection if rtl_sdr has stalled:
`rtlwmbus:CMD(rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -p s -a)`
`rtlwmbus:CMD(rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -p s -a -f)`
`rtlwmbus(ppm=17)`, to tune your rtlsdr dongle accordingly.
Use this to tune your dongle and at the same time listen to S1,T1 and C1.
@ -394,10 +561,10 @@ This will listen to exactly to what is on this frequency.
`rtl433:433M`, to tune to this fq instead.
`stdin`, to read raw binary telegrams from stdin.
`stdin:rawtty`, to read raw binary telegrams from stdin.
These telegrams are expected to have the data link layer crc bytes removed already!
`telegrams.bin`, to read raw wmbus telegrams from this file.
`telegrams.bin:rawtty`, to read raw wmbus telegrams from this file.
These telegrams are expected to have the data link layer crc bytes removed already!
`stdin:hex`, to read hex characters wmbus telegrams from stdin.
@ -425,10 +592,10 @@ As meter quadruples you specify:
```
Supported wmbus dongles:
IMST 871a (im871a)
Amber 8465/8665/8665-M (amb8465) 868MHz
Amber 3665-M (amb3665) 169MHz
Amber 8465-M/8665-M/8626-M/Metis-II (amb8465) 868MHz
Amber 3665-M (amb3665) 169MHz
CUL family (cul)
Radiocraft (RC1180)
Radiocraft (rc1180)
rtl_wmbus (rtlwmbus)
rtl_433 (rtl433)
@ -444,11 +611,13 @@ Apator Ultrimis (ultrimis)
Aquametro/Integra Topas Es Kr (topaseskr)
Axioma W1 (q400)
Bmeters Hydrodigit (hydrodigit) (partly non-standard protocol)
Bmeters GSD8-I with IWM-TX5 module (iwmtx5)
Diehl/Sappel IZAR RC 868 I R4 PL and R3 (izar) (non-standard protocol)
Diehl HYDRUS (hydrus)
Diehl IZAR RC I G4 (dme_07)
Elster Merlin 868 (emerlin868)
Elster V200H (ev200)
GWF Water (gwfwater)
Maddalena EVO 868 (evo868)
Honeywell Q400 (q400)
Itron (itron)
@ -460,10 +629,12 @@ Sontex Supercom 587 (supercom587)
Sensus iPERL (iperl)
Techem MK Radio 3 and 4 (mkradio3,mkradio4) (non-standard protocols)
Waterstar M (waterstarm)
Watertech (watertech)
Zenner Minomess (minomess)
Supported heat cost allocators:
Apator E-ITN 30.51 (apatoreitn)
Engelmann HCA e2 (hcae2)
Innotas EurisII (eurisii)
Qundis Q caloric (qcaloric)
Sontex 868 (sontex868)
@ -474,12 +645,9 @@ BFW 240 (bfw240radio)
Supported heat meters:
Heat meter Techem Compact V / Compact Ve (compact5) (non-standard protocol)
Heat meter Techem Vario 4 (vario451) (non-standard protocol)
Heat meter Kamstrup Multical 302 (multical302) (in C1 mode, please open issue for T1 mode)
Heat and Cooling meter Kamstrup Multical 403 (multical403) (in C1 mode)
Heat and Cooling meter Kamstrup Multical 602 (multical602) (in C1 mode)
Heat and Cooling meter Kamstrup Multical 603 (multical603) (in C1 mode)
Heat and Cooling meter Kamstrup Multical 803 (multical803) (in C1 mode)
Heat meter Techem vario 3 type 3.2.1 (mkradio3) (see here: https://github.com/weetmuts/wmbusmeters/issues/333)
Heat meter Techem vario 4 (vario451) (non-standard protocol)
Heat and Cooling meters Kamstrup Multical 302,403,602,603,803 (kamheat)
Heat meter Apator Elf (elf)
Heat meter Enercal F2 (enercal)
Heat meter Diehl Sharky 775 (sharky)
@ -488,12 +656,13 @@ Heat meter Maddelena microClima (microclima)
Heat and Cooling meter BMeters Hydrocal-M3 (hydrocalm3)
Heat and Cooling meter Axioma Qualcosonic E3 (qualcosonic)
Heat meter Qundis Q heat 5.5 (qheat)
Heat meter Sensus Pollucom F (pollucomf)
Supported room sensors:
Bmeters RFM-AMB Thermometer/Hygrometer (rfmamb)
Elvaco CMa12w Thermometer (cma12w)
Lansen Thermometer/Hygrometer (lansenth)
Weptech Munia Thermometer/Hygrometer (munia)
Weptech Munia / Robin Thermometer/Hygrometer (munia)
PiiGAB Thermometer/Hygrometer (piigth) wired
Supported smoke detectors:
@ -525,22 +694,23 @@ Kamstrup Pressure Sensor (kampress)
```
The wmbus dongle im871a can listen to either s1, c1 or t1.
However with the latest firmware version (0x15) im871a can
With the latest firmware version (0x15) im871a can
also listen to c1 and t1 telegrams at the same time.
(Use `--verbose` to see your dongles firmware version.)
If you have the older firmware you can download the upgrader here:
https://wireless-solutions.de/downloadfile/wireless-m-bus-software/
The amb8465 dongle can listen to either s1, c1 or t1. However it
can also listen to c1 and t1 at the same time.
The amb8465 dongle (new model name is Metis-II) can listen to either
s1, c1 or t1. It can also listen to c1 and t1 at the same time.
With the latest rtlwmbus you can listen to s1, c1 and t1 at
the same time.
the same time. But you might want to disable some if you want
to save cpu usage.
The cul dongle can listen to c1 and t1 at the same time, but only
if you specify c1! If you specify t1 or s1, then it will only listen to t1 or s1.
Imporant!!!! Note that the cul dongle is limited to shorter
Important!!!! Note that the cul dongle is limited to shorter
telegrams. There is a firmware fix that allows somewhat longer,
but still not full length telegrams. This can be a serious blocker
if you want to receive long telegrams from advanced meters.
@ -594,7 +764,7 @@ wmbusmeters --format=json /dev/ttyUSB0:im871a MyTapWater multical21:c1 12345678
```
```json
{"media":"heat","meter":"multical302","name":"MyHeater","id":"22222222","total_kwh":0.000,"total_volume_m3":0.000,"current_kw":"0.000","timestamp":"2018-02-08T09:07:22Z"}
{"media":"heat","meter":"kamheat","name":"MyHeater","id":"22222222","total_kwh":0.000,"total_volume_m3":0.000,"current_kw":"0.000","timestamp":"2018-02-08T09:07:22Z"}
```
Example format fields output and use tuned rtlsdr dongle with rtlwmbus.
@ -680,12 +850,12 @@ wmbusmeters --format=json --meterfiles /dev/ttyUSB0:im871a:c1 MyTapWater multica
# Using wmbusmeters in a pipe
```shell
rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -s | wmbusmeters --format=json stdin:rtlwmbus MyMeter auto 12345678 NOKEY | ...more processing...
rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -f -s | wmbusmeters --format=json stdin:rtlwmbus MyMeter auto 12345678 NOKEY | ...more processing...
```
Or you can send rtl_wmbus formatted telegrams using nc over UDP to wmbusmeters.
```shell
rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -p s -a | nc -u localhost 4444
rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -f -p s -a | nc -u localhost 4444
```
And receive the telegrams with nc spawned by wmbusmeters.
@ -698,6 +868,12 @@ Or start nc explicitly in a pipe.
nc -lku 4444 | wmbusmeters stdin:rtlwmbus
```
Telegrams can also be pulled in by listening on MQTT topics if they were captured by other tools like [rtl_433](https://github.com/merbanan/rtl_433)
```shell
wmbusmeters 'hex:CMD(/usr/bin/mosquitto_sub -h 192.168.x.x -t rtl_433/device/devices/6/Wireless-MBus/+/data | tr -d "\n" )'
```
`+` is a wild card that listens to all the captured telegrams but can be replaced with a specific meter's ID
# Decoding hex string telegrams
If you have a single telegram as hex, which you want decoded, you do not need to create a simulation file,
@ -841,33 +1017,11 @@ If the daemon has started then the wmbus device will be taken and you cannot sta
To run manually, first make sure the daemon is stopped `sudo systemctl stop wmbusmeters`
if this hangs, then do `sudo killall -9 wmbusmetersd` and/or `sudo killall -9 wmbusmeters`.
## How to receive telegrams over longer distances
I only have personal experience of the im871a,amb8465 and an rtlsdr
compatible dongle. The commercial dongles (im871a,amb8464) receive
well despite having tiny antennas inside the dongle. However the
reception range is limited by walls and you must definitely get quite
close to the meter if it is mounted underground in a concrete tube.
The rtlsdr/rtl-wmbus solution seems to work for a lot of users, but it
does use more cpu-power since it decodes the radio traffic in
software. Range seems to be similar to the other dongles, despite the
antenna being much larger.
At least one professional collector use the same commercial dongles,
but the versions with an external antenna connector, into which they
attach a radio amplifier for the proper frequency, and then a larger
antennna. This makes it possible to receive telegrams from meters
underground and over larger distances.
## Non-standard baud rate set for AMB8465 USB stick
Wmbusmeters expects the serial baud rate for the AMB8465 USB stick to be 9600 8n1.
If you have used another tool and changed the baud rate to something else
you need to restore the baud rate to 9600 8n1. You can do that with that other tool,
or you can try wmbusmeters-admin and select `Reset wmbus receives`
this command try all potential baud rates and send the factory reset command.
Then you have to unplug and reinsert the dongle.
you need to restore the baud rate to 9600 8n1.
If you like to send the bytes manually, the correct bytes are:
@ -876,10 +1030,21 @@ If you like to send the bytes manually, the correct bytes are:
# How to add a new driver
Drivers are self contained source code files named `src/driver_xyz.cc`
They register themselves at startup. The source file also contains the necessary tests for that driver.
Drivers for OMS-compliant meters are text files `drivers/src/*.xmq`
First collect an unecrypted telegram as a hex string <hex> using --logtelegrams and any other driver.
Then run `wmbusmeters --analyze <hex>` to see the best match.
Read more here: [doc/CreateDriver.md](doc/CreateDriver.md)
Copy that meters aaa,xmq file to a new filename bbb.xmq and change the name field from aaa to bbb in the driver source.
Now run the new driver with `wmbusmeters --analyze=drivers/src/bbb.xmq <hex>`
and start modifying the driver until it produces the desired json output.
You can now run `make; make install` from within the drivers directory
and then rebuild from the wmbusmeters directory `make`. The new driver is now
compiled into the binary.
You can also put the new driver file bbb.xmq into /etc/wmbusmeters.drivers.d and it will immediately
be available to the wmbusmeters program without recompiling.
# Caveat

Wyświetl plik

@ -1,122 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_with_curses.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_WITH_CURSES
#
# DESCRIPTION
#
# Detect SysV compatible curses, such as ncurses.
#
# Defines HAVE_CURSES_H or HAVE_NCURSES_H if curses is found. CURSES_LIB
# is also set with the required library, but is not appended to LIBS
# automatically. If no working curses library is found CURSES_LIB will be
# left blank. If CURSES_LIB is set in the environment, the supplied value
# will be used.
#
# There are two options: --with-ncurses forces the use of ncurses, and
# --with-ncursesw forces the use of ncursesw (wide character ncurses). The
# corresponding options --without-ncurses and --without-ncursesw force
# those libraries not to be used. By default, ncursesw is preferred to
# ncurses, which is preferred to plain curses.
#
# ax_cv_curses is set to "yes" if any curses is found (including
# ncurses!); ax_cv_ncurses is set to "yes" if any ncurses is found, and
# ax_cv_ncursesw is set to "yes" if ncursesw is found.
#
# LICENSE
#
# Copyright (c) 2009 Mark Pulford <mark@kyne.com.au>
# Copyright (c) 2009 Damian Pietras <daper@daper.net>
# Copyright (c) 2009 Reuben Thomas <rrt@sc3d.org>
#
# This program 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 3 of the License, or (at your
# option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 6
AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
AC_DEFUN([AX_WITH_CURSES],
[AC_ARG_WITH(ncurses, [AS_HELP_STRING([--with-ncurses],
[Force the use of ncurses over curses])],,)
ax_save_LIBS="$LIBS"
AC_ARG_WITH(ncursesw, [AS_HELP_STRING([--without-ncursesw],
[Don't use ncursesw (wide character support)])],,)
if test ! "$CURSES_LIB" -a "$with_ncurses" != no -a "$with_ncursesw" != "no"
then
AC_CACHE_CHECK([for working ncursesw], ax_cv_ncursesw,
[LIBS="$ax_save_LIBS -lncursesw"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
ax_cv_ncursesw=yes, ax_cv_ncursesw=no)])
if test "$ax_cv_ncursesw" = yes
then
AC_CHECK_HEADER([ncursesw/curses.h], AC_DEFINE(HAVE_NCURSESW_H, 1,
[Define if you have ncursesw.h]))
AC_DEFINE(HAVE_NCURSES_H, 1, [Define if you have ncursesw/curses.h])
AC_DEFINE(HAVE_NCURSESW, 1, [Define if you have libncursesw])
CURSES_LIB="-lncursesw"
ax_cv_ncurses=yes
ax_cv_curses=yes
fi
fi
if test ! "$CURSES_LIB" -a "$with_ncurses" != no -a "$with_ncursesw" != yes
then
AC_CACHE_CHECK([for working ncurses], ax_cv_ncurses,
[LIBS="$ax_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
ax_cv_ncurses=yes, ax_cv_ncurses=no)])
if test "$ax_cv_ncurses" = yes
then
AC_DEFINE([HAVE_NCURSES_H],[1],[Define if you have ncurses.h])
CURSES_LIB="-lncurses"
ax_cv_curses=yes
fi
fi
if test "$ax_cv_curses" != yes -a "$with_ncurses" != yes -a "$with_ncursesw" != yes
then
if test ! "$CURSES_LIB"
then
CURSES_LIB="-lcurses"
fi
AC_CACHE_CHECK([for working curses], ax_cv_curses,
[LIBS="$ax_save_LIBS $CURSES_LIB"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
ax_cv_curses=yes, ax_cv_curses=no)])
if test "$ax_cv_curses" = yes
then
AC_DEFINE([HAVE_CURSES_H],[1],[Define if you have curses.h])
fi
fi
LIBS="$ax_save_LIBS"
])dnl

1500
autoconf/config.guess vendored

Plik diff jest za duży Load Diff

2855
autoconf/config.sub vendored

Plik diff jest za duży Load Diff

2392
configure vendored

Plik diff jest za duży Load Diff

Wyświetl plik

@ -15,14 +15,13 @@
#
AC_PREREQ([2.69])
AC_INIT(wmbusmeters, wmbusmeters, oehrstroem@gmail.com,,https://github.com/weetmuts/wmbusmeters)
AC_INIT(wmbusmeters, wmbusmeters, oehrstroem@gmail.com,,https://github.com/wmbusmeters/wmbusmeters)
AC_CONFIG_AUX_DIR([autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
m4_include([autoconf/pkg.m4])
m4_include([autoconf/ax_with_curses.m4])
PKG_PREREQ(0.29)
@ -41,6 +40,11 @@ freebsd*)
CFLAGS="$CFLAGS -I/usr/local/include"
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
darwin*)
CFLAGS="$CFLAGS -I/usr/local/include -I/opt/homebrew/include"
CXXFLAGS="$CXXFLAGS -I/usr/local/include -I/opt/homebrew/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/homebrew/lib"
;;
esac
@ -54,13 +58,10 @@ AC_CHECK_LIB(rtlsdr, rtlsdr_get_device_count, [],
AC_MSG_ERROR([Could not find rtlsdr library. Try: sudo apt install librtlsdr-dev])
])
AX_WITH_CURSES
if test ! "$ax_cv_curses" = "yes"
then
echo "Could not find ncurses library. Try: sudo apt install libncurses-dev"
exit 1
fi
AC_CHECK_LIB(xml2, xmlFreeDoc, [],
[
AC_MSG_ERROR([Could not find libxml2 library. Try: sudo apt install libxml2-dev])
])
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$SRC_ROOT/autoconf/spec.gmk.in])
AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$SRC_ROOT/autoconf/Makefile.in])

Wyświetl plik

@ -1,6 +1,5 @@
wmbusmeters (1.10.0-1) unstable; urgency=medium
wmbusmeters (0.0.0-1) unstable; urgency=medium
* First package upload (Closes: #998721).
* Upload sponsored by Petter Reinholdtsen.
* Test build
-- Fredrik Öhrström <oehrstroem@gmail.com> Sat, 26 Jun 2021 12:39:00 +0100
-- No User <nouser@nowhere.zzz> Sat, 26 Jun 2021 12:39:00 +0100

Wyświetl plik

@ -4,17 +4,19 @@ Priority: optional
Maintainer: Fredrik Öhrström <oehrstroem@gmail.com>
Build-Depends: debhelper-compat (= 13)
, librtlsdr-dev
, libncurses-dev,
, adduser
, jq
, netcat-openbsd
Standards-Version: 4.5.1
Homepage: https://github.com/weetmuts/wmbusmeters
Vcs-Browser: https://github.com/weetmuts/wmbusmeters
Vcs-Git: https://github.com/weetmuts/wmbusmeters.git
Homepage: https://github.com/wmbusmeters/wmbusmeters
Vcs-Browser: https://github.com/wmbusmeters/wmbusmeters
Vcs-Git: https://github.com/wmbusmeters/wmbusmeters.git
Rules-Requires-Root: no
Package: wmbusmeters
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
, adduser
Suggests: rtl-wmbus
Description: read wireless and wired M-BUS telegrams from utility meters
Receives and decodes C1,T1 or S1 telegrams (using
the wireless or wired mbus protocol) to acquire utility meter

Wyświetl plik

@ -1,6 +1,6 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: wmbusmeters
Source: https://github.com/weetmuts/wmbusmeters
Source: https://github.com/wmbusmeters/wmbusmeters
Upstream-Contact: Fredrik Öhrström <oehrstroem@gmail.com>
Files: *
@ -15,6 +15,11 @@ Files: src/aes.h
Copyright: 2019 kokke
License: CC0
Files: src/driver_apatoreitn.cc
Copyright: 2023 Fredrik Öhrström
2022 Kajetan Krykwiński
License: GPL-3+
Files: src/driver_emerlin868.cc
Copyright: 2022 Fredrik Öhrström
2018 David Mallon
@ -25,25 +30,26 @@ Copyright: 2022 Fredrik Öhrström
2018 David Mallon
License: GPL-3+
Files: src/driver_iperl.cc
Files: src/driver_hydrus.cc
Copyright: 2023 Fredrik Öhrström
2021 Vincent Privat
License: GPL-3+
Files: src/driver_izar.cc
Copyright: 2019 Jacek Tomasiak
2023 Fredrik Öhrström
2021 Vincent Privat
License: GPL-3+
Files: src/driver_kamheat.cc
Copyright: 2022 Fredrik Öhrström
2018 David Mallon
2020 Eric Bus
2022 thecem
License: GPL-3+
Files: src/driver_minomess.cc
Copyright: 2021 Olli Salonen
2022 Fredrik Öhrström
License: GPL-3+
Files: src/driver_multical303.cc
Copyright: 2022 thecem
2022 Fredrik Öhrström
License: GPL-3+
Files: src/driver_multical603.cc
Copyright: 2022 Fredrik Öhrström
2020 Eric Bus
2022 thecem
2023 Fredrik Öhrström
License: GPL-3+
Files: src/driver_sensostar.cc
@ -61,6 +67,11 @@ Copyright: 2021 Vincent Privat
2022 Fredrik Öhrström
License: GPL-3+
Files: src/driver_topaseskr.cc
Copyright: 2022 Fredrik Öhrström
2020 Avandorp
License: GPL-3+
Files: src/manufacturer_specificities.cc
Copyright: 2019 Jacek Tomasiak
2021 Vincent Privat
@ -71,38 +82,6 @@ Copyright: 2019 Jacek Tomasiak
2021 Vincent Privat
License: GPL-3+
Files: src/meter_hydrus.cc
Copyright: 2020 Fredrik Öhrström
2021 Vincent Privat
License: GPL-3+
Files: src/meter_izar.cc
Copyright: 2019 Jacek Tomasiak
2020 Fredrik Öhrström
2021 Vincent Privat
License: GPL-3+
Files: src/meter_multical403.cc
Copyright: 2020 Fredrik Öhrström
2020 Eric Bus
License: GPL-3+
Files: src/meter_multical602.cc
Copyright: 2021 Fredrik Öhrström
2020 Eric Bus
License: GPL-3+
Files: src/meter_multical803.cc
Copyright: 2020 Fredrik Öhrström
2020 Eric Bus
2020 Nikodem Jędrzejczak
License: GPL-3+
Files: src/meter_topaseskr.cc
Copyright: 2020 Fredrik Öhrström
2020 Avandorp
License: GPL-3+
Files: src/sha256.cc
Copyright: 2013 Tom St Denis <tomstdenis@gmail.com>
2013 WaterJuice <waterjuice.org>
@ -122,6 +101,25 @@ License: GPL-3+
On Debian systems, the complete text of the GNU General Public License
version 3 can be found in file "/usr/share/common-licenses/GPL-3".
License: MIT
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.
License: CC0
The authors, and therefore would be copyright holders, have as much
as possible relinguished their copyright to the public domain.

Wyświetl plik

@ -15,3 +15,10 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
LPAR=(
RPAR=)
CHANGELOG_RELEASE=$(shell cat debian/changelog | head -n 1 | grep -o '$(LPAR).*$(RPAR)' | tr -d '$(LPAR)$(RPAR)' )
override_dh_auto_build:
$(MAKE) COMMIT_HASH= TAG=$(CHANGELOG_RELEASE) BRANCH= CHANGES=

Wyświetl plik

@ -1 +1 @@
3.0 (quilt)
1.0

Wyświetl plik

@ -4,5 +4,5 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%wmbusmeters-$1.tar.gz%" \
https://github.com/weetmuts/wmbusmeters/tags \
https://github.com/wmbusmeters/wmbusmeters/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate

Wyświetl plik

@ -1,362 +0,0 @@
# Creating a new driver
To create a new driver, it is very convenient, to start with an existing driver,
that mostly matches the one you want to integrate. I will use the EurisII as a base for
Integration of Aventies HCA.
In fact, most of the manufacturers already exist in the source code
with their respective shortcodes, e.g. Aventies with "AAA".
Create the `/etc/wmbusmeters.conf` with content adapted to your installation, e.g.:
```
loglevel=debug
device=/dev/ttyUSB0:t1
logtelegrams=true
format=json
meterfiles=/var/lib/wmbusmeters/meter_readings
meterfilesaction=overwrite
meterfilesnaming=name-id
logfile=/var/log/wmbusmeters/wmbusmeters.log
```
Create a meter config in `/etc/wmbusmeters.d/` with content like this, using the existing type, you selected as a base for your class (adjust also name, id and key to your needs):
```
name=ABOGGLKZ
driver=eurisii
id=60900126
key=xxxxxxxxx
```
If you now start wmbusmeters with `wmbusmeters --debug --verbose --useconfig=/etc` and your meter transmits a message,
you will see a log like this:
```
[2021-07-05_21:07:30] (meter) ABOGGLKZ: meter detection did not match the selected driver eurisii! correct driver is: unknown!
(meter) Not printing this warning again for id: 60900126 mfct: (AAA) Aventies, Germany (0x421) type: Heat Cost Allocator (0x08) ver: 0x55
[2021-07-05_21:07:30] (meter) please consider opening an issue at https://github.com/weetmuts/wmbusmeters/
[2021-07-05_21:07:30] (meter) to add support for this unknown mfct,media,version combination
(meter) ABOGGLKZ: yes for me
(meter) ABOGGLKZ eurisii handling telegram from 60900126
(meter) ABOGGLKZ 60900126 "7644210426019060550872260190602104550806006005CA4269D455F02AE4A475AD546F7FF1EDF3C959E5480AA0A2341B6B6EA28884FA1E0EC355A23E66D055E3C790298553C3870727149DF88612ABF2EA184AEF0821B16BC11DA5BAABEFB34E4E68C6F2728D935011EAB98FCAA29274CC685B8079F7"
(wmbus) parseDLL @0 119
(telegram) DLL L=76 C=44 (from meter SND_NR) M=0421 (AAA) A=60900126 VER=55 TYPE=08 (Heat Cost Allocator) (driver unknown!) DEV=im871a[00101387] RSSI=-77
(wmbus) parseELL @10 109
(wmbus) parseAFL @10 109
(wmbus) parseTPL @10 109
(TPL) decrypting "CA4269D455F02AE4A475AD546F7FF1EDF3C959E5480AA0A2341B6B6EA28884FA1E0EC355A23E66D055E3C790298553C3870727149DF88612ABF2EA184AEF0821B16BC11DA5BAABEFB34E4E68C6F2728D935011EAB98FCAA29274CC685B8079F7"
(TPL) num encrypted blocks 6 (96 bytes and remaining unencrypted 0 bytes)
(TPL) IV 21042601906055080606060606060606
(TPL) decrypted "2F2F0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000"
(telegram) TPL CI=72 ACC=06 STS=00 CFG=0560 (AES_CBC_IV nb=6 cntn=0 ra=0 hc=0) ID=26019060 MFT=2104 VER=55 TYPE=08 (Heat Cost Allocator)
telegram=|76442104260190605508722601906021045508060060052F2F|0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000|+6647
(eurisii) 00: 76 length (118 bytes)
(eurisii) 01: 44 dll-c (from meter SND_NR)
(eurisii) 02: 2104 dll-mfct (AAA)
(eurisii) 04: 26019060 dll-id (60900126)
(eurisii) 08: 55 dll-version
(eurisii) 09: 08 dll-type (Heat Cost Allocator)
(eurisii) 0a: 72 tpl-ci-field (EN 13757-3 Application Layer (long tplh))
(eurisii) 0b: 26019060 tpl-id (60900126)
(eurisii) 0f: 2104 tpl-mfct (AAA)
(eurisii) 11: 55 tpl-version
(eurisii) 12: 08 tpl-type (Heat Cost Allocator)
(eurisii) 13: 06 tpl-acc-field
(eurisii) 14: 00 tpl-sts-field (OK)
(eurisii) 15: 6005 tpl-cfg 0560 (AES_CBC_IV nb=6 cntn=0 ra=0 hc=0 )
(eurisii) 17: 2f2f decrypt check bytes
(eurisii) 19: 0B dif (6 digit BCD Instantaneous value)
(eurisii) 1a: 6E vif (Units for H.C.A.)
(eurisii) 1b: * 660100 current consumption (166.000000 hca)
(eurisii) 1e: 42 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 1f: 6E vif (Units for H.C.A.)
(eurisii) 20: * A600 consumption at set date 1 (166.000000 hca)
(eurisii) 22: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 23: 01 dife (subunit=0 tariff=0 storagenr=2)
(eurisii) 24: 6E vif (Units for H.C.A.)
(eurisii) 25: * A600 consumption at set date 2 (166.000000 hca)
(eurisii) 27: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 28: 01 dife (subunit=0 tariff=0 storagenr=3)
(eurisii) 29: 6E vif (Units for H.C.A.)
(eurisii) 2a: * 9E00 consumption at set date 3 (158.000000 hca)
(eurisii) 2c: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 2d: 02 dife (subunit=0 tariff=0 storagenr=4)
(eurisii) 2e: 6E vif (Units for H.C.A.)
(eurisii) 2f: * 7E00 consumption at set date 4 (126.000000 hca)
(eurisii) 31: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 32: 02 dife (subunit=0 tariff=0 storagenr=5)
(eurisii) 33: 6E vif (Units for H.C.A.)
(eurisii) 34: * 5B00 consumption at set date 5 (91.000000 hca)
(eurisii) 36: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 37: 03 dife (subunit=0 tariff=0 storagenr=6)
(eurisii) 38: 6E vif (Units for H.C.A.)
(eurisii) 39: * 4200 consumption at set date 6 (66.000000 hca)
(eurisii) 3b: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 3c: 03 dife (subunit=0 tariff=0 storagenr=7)
(eurisii) 3d: 6E vif (Units for H.C.A.)
(eurisii) 3e: * 7701 consumption at set date 7 (375.000000 hca)
(eurisii) 40: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 41: 04 dife (subunit=0 tariff=0 storagenr=8)
(eurisii) 42: 6E vif (Units for H.C.A.)
(eurisii) 43: * 5B01 consumption at set date 8 (347.000000 hca)
(eurisii) 45: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 46: 04 dife (subunit=0 tariff=0 storagenr=9)
(eurisii) 47: 6E vif (Units for H.C.A.)
(eurisii) 48: * 4C01 consumption at set date 9 (332.000000 hca)
(eurisii) 4a: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 4b: 05 dife (subunit=0 tariff=0 storagenr=10)
(eurisii) 4c: 6E vif (Units for H.C.A.)
(eurisii) 4d: * 4701 consumption at set date 10 (327.000000 hca)
(eurisii) 4f: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 50: 05 dife (subunit=0 tariff=0 storagenr=11)
(eurisii) 51: 6E vif (Units for H.C.A.)
(eurisii) 52: * 3E01 consumption at set date 11 (318.000000 hca)
(eurisii) 54: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 55: 06 dife (subunit=0 tariff=0 storagenr=12)
(eurisii) 56: 6E vif (Units for H.C.A.)
(eurisii) 57: * 3B01 consumption at set date 12 (315.000000 hca)
(eurisii) 59: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 5a: 06 dife (subunit=0 tariff=0 storagenr=13)
(eurisii) 5b: 6E vif (Units for H.C.A.)
(eurisii) 5c: * 3B01 consumption at set date 13 (315.000000 hca)
(eurisii) 5e: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 5f: 07 dife (subunit=0 tariff=0 storagenr=14)
(eurisii) 60: 6E vif (Units for H.C.A.)
(eurisii) 61: * 3B01 consumption at set date 14 (315.000000 hca)
(eurisii) 63: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 64: 07 dife (subunit=0 tariff=0 storagenr=15)
(eurisii) 65: 6E vif (Units for H.C.A.)
(eurisii) 66: * 3B01 consumption at set date 15 (315.000000 hca)
(eurisii) 68: 82 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 69: 08 dife (subunit=0 tariff=0 storagenr=16)
(eurisii) 6a: 6E vif (Units for H.C.A.)
(eurisii) 6b: * 1301 consumption at set date 16 (275.000000 hca)
(eurisii) 6d: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(eurisii) 6e: 08 dife (subunit=0 tariff=0 storagenr=17)
(eurisii) 6f: 6E vif (Units for H.C.A.)
(eurisii) 70: * 9C00 consumption at set date 17 (156.000000 hca)
(eurisii) 72: 02 dif (16 Bit Integer/Binary Instantaneous value)
(eurisii) 73: FD vif (Second extension FD of VIF-codes)
(eurisii) 74: 17 vife (Error flags (binary))
(eurisii) 75: * 0000 error flags (0000)
```
Now keep especially the following lines in mind for integation into the meter definitions:
```
[2021-07-05_21:07:30] (meter) ABOGGLKZ: meter detection did not match the selected driver eurisii! correct driver is: unknown!
(meter) Not printing this warning again for id: 60900126 mfct: (AAA) Aventies, Germany (0x421) type: Heat Cost Allocator (0x08) ver: 0x55
```
and the telegram line with the decrypted content.
```
telegram=|76442104260190605508722601906021045508060060052F2F#0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000|+6647
```
You can now analyze the telegram with this command:
```
wmbusmeters --analyze 76442104260190605508722601906021045508060060052F2F0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000
```
This will test all existing drivers to see which drivers seems to be matching the best. (This method can be improved so do some sanity checks as well.) If the driver already decodes 100% of the content then perhaps you should only add
```
di.addDetection(MANUFACTURER_AAA, 0x08, 0x55);
```
to the existing driver_eursii.cc file. But in this case we chose to create a new driver.
(Remember to add a new test case at the end of the cc file.)
## Creating your new driver
As we used the eurisii meter as a template, you need to copy the driver_eurisii.cc to driver_xyz.cc replacing xyz
with a name created by you. In my case it is driver_aventieshca.cc
As long as you do not need any new (not-yet-implemented) wmbus protocol features, then the
entire driver is self contained within a single cc file, including tests.
Now replace all occurences of class name MeterEurisII by the class name you created (e.g. MeterAventiesHCA in my case).
Adjust the test cases at the end of the cc file! These test cases are picked up automatically
by the testing system. Such regression tests are very important for the future stability of wmbusmeters.
Media/type 0x08 is the code for a Heat Cost allocator. You can find other codes here [here](https://m-bus.com/assets/downloads/MBDOC48.PDF) (on page 76). At least you should check for plausibility...
### Further adjustments
If you need to do processing that is not support by the current addFieldWithExtractor code, then
you will have to implement the processContent function.
To collect the releavant data correctly, you need to adjust the code
for processing and printing the data from the meter. For this you
should edit the `MeterXXX::processContent` method to fit your
needs. Adhere to the debug log output of the processing function and
have a look at other meter's classes for examples how to process
multiple values with different sorage numbers or types.
If you get errors, it is quite probable that you missed the correct value information (e.g. ValueInformation::Volume):
```
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
}
```
Possible ValueInformation types are:
- Volume (0x10,0x17)
- OperatingTime (0x24,0x27)
- VolumeFlow (0x38,0x3F)
- FlowTemperature (0x58,0x5B)
- ReturnTemperature (0x5C,0x5F)
- TemperatureDifference (0x60,0x63)
- ExternalTemperature (0x64,0x67)
- HeatCostAllocation (0x6E,0x6E)
- Date (0x6C,0x6C)
- DateTime (0x6D,0x6D)
- EnergyMJ (0x0E,0x0F)
- EnergyWh (0x00,0x07)
- PowerW (0x28,0x2f)
- ActualityDuration (0x74,0x77)
You can add also special properties and getters for special data of your meter, like it is handled with the error codes for EurisII.
## Compiling and testing
If everything was right, you can try compiling the project:
```
./configure
make -j4
```
Test your new version with the analyze command: `./build/wmbusmeters --analyze ...`
Now test your code:
./build/wmbusmeters --format=json <hex> MyHCA aventieshca 12345678 NOKEY
It should print:
```
{"media":"heat cost allocation","meter":"aventieshca","name":"MyHCA","id":"60900126","current_consumption_hca":166,"consumption_at_set_date_hca":166,"consumption_at_set_date_2_hca":166,"consumption_at_set_date_3_hca":158,"consumption_at_set_date_4_hca":126,"consumption_at_set_date_5_hca":91,"consumption_at_set_date_6_hca":66,"consumption_at_set_date_7_hca":375,"consumption_at_set_date_8_hca":347,"consumption_at_set_date_9_hca":332,"consumption_at_set_date_10_hca":327,"consumption_at_set_date_11_hca":318,"consumption_at_set_date_12_hca":315,"consumption_at_set_date_13_hca":315,"consumption_at_set_date_14_hca":315,"consumption_at_set_date_15_hca":315,"consumption_at_set_date_16_hca":275,"consumption_at_set_date_17_hca":156,"error_flags":"","timestamp":"2022-01-18T10:04:08Z"}
```
And now you can run it for real:
./build_debug/wmbusmeters --format=json auto:t1 Water MyMeter 12345678 <key>
or using the config that you setup before:
`./build/wmbusmeters --debug --verbose useconfig=/`
When it looks good, now run the tests:
```
make test
```
If you have the time please try to build with debug information as well: `make DEBUG=true` and `make testd`
This will test the code and check that there are no memory leaks or buffer overflows etc.
Finally try the daemon: make; sudo make install
(Do the daemon reload command if such is requested.)
sudo systemctl start wmbusmeters.service
Update the regression tests in the end of driver_aventieshca.cc
If again everything was ok, `sudo make install` the new wmbusmeters and start it.
## Provide some Information (for decumentation and debugging)
Now edit your meter config in `/etc/wmbusmeters.d/` to use the new meter type (mine is aventieshca).
The log should show the correct recognition (aventieshca)-tags at the beginning of each decoding line for your meter.
```
(aventieshca) 17: 2f2f decrypt check bytes
(aventieshca) 19: 0B dif (6 digit BCD Instantaneous value)
(aventieshca) 1a: 6E vif (Units for H.C.A.)
(aventieshca) 1b: * 660100 current consumption (166.000000 hca)
(aventieshca) 1e: 42 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 1f: 6E vif (Units for H.C.A.)
(aventieshca) 20: * A600 consumption at set date 1 (166.000000 hca)
(aventieshca) 22: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 23: 01 dife (subunit=0 tariff=0 storagenr=2)
(aventieshca) 24: 6E vif (Units for H.C.A.)
(aventieshca) 25: * A600 consumption at set date 2 (166.000000 hca)
(aventieshca) 27: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 28: 01 dife (subunit=0 tariff=0 storagenr=3)
(aventieshca) 29: 6E vif (Units for H.C.A.)
(aventieshca) 2a: * 9E00 consumption at set date 3 (158.000000 hca)
(aventieshca) 2c: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 2d: 02 dife (subunit=0 tariff=0 storagenr=4)
(aventieshca) 2e: 6E vif (Units for H.C.A.)
(aventieshca) 2f: * 7E00 consumption at set date 4 (126.000000 hca)
(aventieshca) 31: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 32: 02 dife (subunit=0 tariff=0 storagenr=5)
(aventieshca) 33: 6E vif (Units for H.C.A.)
(aventieshca) 34: * 5B00 consumption at set date 5 (91.000000 hca)
(aventieshca) 36: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 37: 03 dife (subunit=0 tariff=0 storagenr=6)
(aventieshca) 38: 6E vif (Units for H.C.A.)
(aventieshca) 39: * 4200 consumption at set date 6 (66.000000 hca)
(aventieshca) 3b: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 3c: 03 dife (subunit=0 tariff=0 storagenr=7)
(aventieshca) 3d: 6E vif (Units for H.C.A.)
(aventieshca) 3e: * 7701 consumption at set date 7 (375.000000 hca)
(aventieshca) 40: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 41: 04 dife (subunit=0 tariff=0 storagenr=8)
(aventieshca) 42: 6E vif (Units for H.C.A.)
(aventieshca) 43: * 5B01 consumption at set date 8 (347.000000 hca)
(aventieshca) 45: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 46: 04 dife (subunit=0 tariff=0 storagenr=9)
(aventieshca) 47: 6E vif (Units for H.C.A.)
(aventieshca) 48: * 4C01 consumption at set date 9 (332.000000 hca)
(aventieshca) 4a: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 4b: 05 dife (subunit=0 tariff=0 storagenr=10)
(aventieshca) 4c: 6E vif (Units for H.C.A.)
(aventieshca) 4d: * 4701 consumption at set date 10 (327.000000 hca)
(aventieshca) 4f: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 50: 05 dife (subunit=0 tariff=0 storagenr=11)
(aventieshca) 51: 6E vif (Units for H.C.A.)
(aventieshca) 52: * 3E01 consumption at set date 11 (318.000000 hca)
(aventieshca) 54: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 55: 06 dife (subunit=0 tariff=0 storagenr=12)
(aventieshca) 56: 6E vif (Units for H.C.A.)
(aventieshca) 57: * 3B01 consumption at set date 12 (315.000000 hca)
(aventieshca) 59: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 5a: 06 dife (subunit=0 tariff=0 storagenr=13)
(aventieshca) 5b: 6E vif (Units for H.C.A.)
(aventieshca) 5c: * 3B01 consumption at set date 13 (315.000000 hca)
(aventieshca) 5e: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 5f: 07 dife (subunit=0 tariff=0 storagenr=14)
(aventieshca) 60: 6E vif (Units for H.C.A.)
(aventieshca) 61: * 3B01 consumption at set date 14 (315.000000 hca)
(aventieshca) 63: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 64: 07 dife (subunit=0 tariff=0 storagenr=15)
(aventieshca) 65: 6E vif (Units for H.C.A.)
(aventieshca) 66: * 3B01 consumption at set date 15 (315.000000 hca)
(aventieshca) 68: 82 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 69: 08 dife (subunit=0 tariff=0 storagenr=16)
(aventieshca) 6a: 6E vif (Units for H.C.A.)
(aventieshca) 6b: * 1301 consumption at set date 16 (275.000000 hca)
(aventieshca) 6d: C2 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(aventieshca) 6e: 08 dife (subunit=0 tariff=0 storagenr=17)
(aventieshca) 6f: 6E vif (Units for H.C.A.)
(aventieshca) 70: * 9C00 consumption at set date 17 (156.000000 hca)
(aventieshca) 72: 02 dif (16 Bit Integer/Binary Instantaneous value)
(aventieshca) 73: FD vif (Second extension FD of VIF-codes)
(aventieshca) 74: 17 vife (Error flags (binary))
(aventieshca) 75: * 0000 error flags (0000)
```
You can also provide an encrypted telegram, the AES key for the telegram and the decoded data in your pull request for Fredrik to add it to the regression tests. The information is part of the log and looks like this:
```
(serial) received binary "A5C203764421042601906055087226019060210455080A00600537A7B807E3BA027FE98D75848595628733C29F2D3262F23BA4D2C01D37084E784691E115674D6D8CB874698D4D2C9DB3832A38A39021457A46F151FCBC86947EE7E35CF7AFC049381E74FB2B19E0F835B867B40D22E61129D395263441F4DED061B541"
(im871a) checkIM871AFrame "A5C203764421042601906055087226019060210455080A00600537A7B807E3BA027FE98D75848595628733C29F2D3262F23BA4D2C01D37084E784691E115674D6D8CB874698D4D2C9DB3832A38A39021457A46F151FCBC86947EE7E35CF7AFC049381E74FB2B19E0F835B867B40D22E61129D395263441F4DED061B541"
(im871a) has_timestamp=0 has_rssi=1 has_crc16=1
[...]
(TPL) decrypting "37A7B807E3BA027FE98D75848595628733C29F2D3262F23BA4D2C01D37084E784691E115674D6D8CB874698D4D2C9DB3832A38A39021457A46F151FCBC86947EE7E35CF7AFC049381E74FB2B19E0F835B867B40D22E61129D395263441F4DED0"
(TPL) num encrypted blocks 6 (96 bytes and remaining unencrypted 0 bytes)
(TPL) IV 21042601906055080A0A0A0A0A0A0A0A
(TPL) decrypted "2F2F0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000"
(telegram) TPL CI=72 ACC=0a STS=00 CFG=0560 (AES_CBC_IV nb=6 cntn=0 ra=0 hc=0) ID=26019060 MFT=2104 VER=55 TYPE=08 (Heat Cost Allocator)
telegram=|764421042601906055087226019060210455080A0060052F2F|0B6E660100426EA60082016EA600C2016E9E0082026E7E00C2026E5B0082036E4200C2036E770182046E5B01C2046E4C0182056E4701C2056E3E0182066E3B01C2066E3B0182076E3B01C2076E3B0182086E1301C2086E9C0002FD170000|+7599
```
It would also be handy to provide a datasheet of the sensor within the pull request.
That's all :-)
Have fun!

Wyświetl plik

@ -1,22 +1,41 @@
FROM multiarch/alpine:${TARGETARCH}-latest-stable AS build
RUN apk add --no-cache alpine-sdk gcc linux-headers ncurses-dev librtlsdr-dev cmake libusb-dev bash
RUN git clone https://github.com/weetmuts/wmbusmeters.git && \
FROM alpine AS build
RUN apk add --no-cache alpine-sdk gcc linux-headers libxml2-dev cmake libusb-dev bash samurai
ADD https://api.github.com/repos/wmbusmeters/wmbusmeters/git/refs/heads/master version.json
RUN git clone https://github.com/steve-m/librtlsdr.git && \
git clone https://github.com/wmbusmeters/wmbusmeters.git && \
git clone https://github.com/weetmuts/rtl-wmbus.git && \
git clone https://github.com/merbanan/rtl_433.git
git clone https://github.com/merbanan/rtl_433.git && \
git clone https://github.com/ED6E0F17/rtl_reset.git
WORKDIR /librtlsdr
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DDETACH_KERNEL_DRIVER=ON \
-Wno-dev && \
cmake --build build && \
cmake --install build
WORKDIR /wmbusmeters
RUN make
WORKDIR /rtl-wmbus
RUN make release && chmod 755 build/rtl_wmbus
WORKDIR /rtl_433
RUN mkdir build && cd build && cmake ../ && make
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel && \
cmake --build build
WORKDIR /rtl_reset
RUN make
FROM multiarch/alpine:${TARGETARCH}-latest-stable as scratch
ENV QEMU_EXECVE=1
RUN apk add --no-cache mosquitto-clients libstdc++ curl libusb ncurses rtl-sdr netcat-openbsd
FROM alpine as scratch
RUN apk add --no-cache mosquitto-clients libstdc++ curl libusb libxml2 netcat-openbsd
WORKDIR /wmbusmeters
COPY --from=build /librtlsdr/build/src/librtlsdr.so.* /usr/lib/
COPY --from=build /librtlsdr/rtl-sdr.rules /usr/lib/udev/rules.d/rtl-sdr.rules
COPY --from=build /librtlsdr/build/src/rtl_* /usr/bin/
COPY --from=build /wmbusmeters/build/wmbusmeters /wmbusmeters/wmbusmeters
COPY --from=build /rtl-wmbus/build/rtl_wmbus /usr/bin/rtl_wmbus
COPY --from=build /rtl_433/build/src/rtl_433 /usr/bin/rtl_433
COPY --from=build /rtl_reset/rtl_reset /usr/bin/rtl_reset
COPY --from=build /wmbusmeters/docker/docker-entrypoint.sh /wmbusmeters/docker-entrypoint.sh
VOLUME /wmbusmeters_data/
CMD ["sh", "/wmbusmeters/docker-entrypoint.sh"]
CMD ["sh", "/wmbusmeters/docker-entrypoint.sh"]

Wyświetl plik

@ -4,7 +4,7 @@ The program receives and decodes C1,T1 or S1 telegrams
utility meter readings. The readings can then be published using
MQTT, curled to a REST api, inserted into a database or stored in a log file.
[FAQ/WIKI/MANUAL pages](https://github.com/weetmuts/wmbusmeters)
[FAQ/WIKI/MANUAL pages](https://github.com/wmbusmeters/wmbusmeters)
- Supported architectures
- ARMv7 32-bit (`armv7`)
@ -22,7 +22,7 @@ docker run -d --privileged \
-v /etc/localtime:/etc/localtime:ro \
-v /opt/wmbusmeters:/wmbusmeters_data \
-v /dev/:/dev/ \
weetmuts/wmbusmeters
wmbusmeters/wmbusmeters
```
### Command line Options
@ -40,7 +40,7 @@ If docker-compose.yml file is being used, then it is also possible to copy/paste
version: "2"
services:
wmbusmeters:
image: weetmuts/wmbusmeters
image: wmbusmeters/wmbusmeters
container_name: wmbusmeters
restart: always
volumes:
@ -48,7 +48,7 @@ services:
- /etc/localtime:/etc/localtime:ro
- /dev/:/dev/
```
Then, `docker-compose pull` can be used to pull the latest weetmuts/wmbusmeters image, `docker-compose up -d` to start the wmbusmeters container service, and `docker-compose down` to stop the wmbusmeters service and delete the container. It must be noted that those commands will also pull, start, and stop any other services defined in docker-compose.yml.
Then, `docker-compose pull` can be used to pull the latest wmbusmeters/wmbusmeters image, `docker-compose up -d` to start the wmbusmeters container service, and `docker-compose down` to stop the wmbusmeters service and delete the container. It must be noted that those commands will also pull, start, and stop any other services defined in docker-compose.yml.
## How to run docker in unprivileged mode
@ -73,7 +73,7 @@ docker run -d \
-v /etc/localtime:/etc/localtime:ro \
-v /opt/wmbusmeters:/wmbusmeters_data \
--device=/dev/im871a \
weetmuts/wmbusmeters
wmbusmeters/wmbusmeters
```
### Command line Options
@ -91,7 +91,7 @@ If docker-compose.yml file is being used, then it is also possible to copy/paste
version: "2"
services:
wmbusmeters:
image: weetmuts/wmbusmeters
image: wmbusmeters/wmbusmeters
container_name: wmbusmeters
restart: always
volumes:
@ -101,8 +101,8 @@ services:
- /dev/im871a
```
Then, `docker-compose pull` can be used to pull the latest weetmuts/wmbusmeters image, `docker-compose up -d` to start the wmbusmeters container service, and `docker-compose down` to stop the wmbusmeters service and delete the container. It must be noted that those commands will also pull, start, and stop any other services defined in docker-compose.yml.
Then, `docker-compose pull` can be used to pull the latest wmbusmeters/wmbusmeters image, `docker-compose up -d` to start the wmbusmeters container service, and `docker-compose down` to stop the wmbusmeters service and delete the container. It must be noted that those commands will also pull, start, and stop any other services defined in docker-compose.yml.
### Issues / Contributing
Please raise any issues with this container at its [GitHub repo](https://github.com/weetmuts/wmbusmeters)
Please raise any issues with this container at its [GitHub repo](https://github.com/wmbusmeters/wmbusmeters)

32
drivers/Makefile 100644
Wyświetl plik

@ -0,0 +1,32 @@
$(shell mkdir -p build/test)
PROG?=wmbusmeters
database:
@./generate.sh $(PROG)
web:
@mkdir -p build/web
@for i in $(wildcard src/*) ; do xmq $$i render-html --darkbg > build/web/$$(basename $${i}).html; done
@./generate_index.sh > build/web/index.html
tests:
@echo -n "// Generated " > build/generated_tests.xmq
@date +%Y-%m-%d_%H:%M >> build/generated_tests.xmq
@for i in $(wildcard src/*) ; do xmq $$i select /driver/test to-xmq >> build/generated_tests.xmq; done
install: database tests
@grep -v "// Generated " < build/generated_database.cc > build/a
@grep -v "// Generated " < ../src/generated_database.cc > build/b
@if ! diff build/a build/b ; then \
cp build/generated_database.cc ../src ; echo "Installed db"; else echo "No changes db." ; fi
@grep -v "// Generated " < build/generated_tests.xmq > build/a
@grep -v "// Generated " < ../tests/generated_tests.xmq > build/b
@if ! diff build/a build/b ; then \
cp build/generated_tests.xmq ../tests/generated_tests.xmq ; echo "Installed tests." ; else echo "No changes test." ; fi
test:
@for i in $(wildcard src/*) ; do ./test.sh $(PROG) $$i ; done
.PHONY: database web tests install test

Wyświetl plik

@ -0,0 +1,58 @@
#!/bin/bash
export PROG="$1"
export OUT="build/generated_database.cc"
cat > $OUT <<EOF
/*
Copyright (C) 2024 Fredrik Öhrström (gpl-3.0-or-later)
This program 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 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Generated $(date +%Y-%m-%d_%H:%M)
BuiltinDriver builtins_[] =
{
EOF
# { "elster", "driver{name=elster meter_type=GasMeter default_fields=name,id,total_m3,timestamp detect{mvt=ELS,81,03}field{name=total quantity=Volume match{measurement_type=Instantaneous vif_range=Volume}}}", false },
for i in src/*.xmq
do
NAME=$(basename $i)
NAME="${NAME%.*}"
CONTENT="$(xmq $i delete /driver/test to-xmq --compact | sed 's/"/\\"/g')"
cat >>$OUT <<EOF
{ "$NAME", "$CONTENT", false },
EOF
done
cat >> $OUT <<EOF
};
MapToDriver builtins_mvts_[] =
{
EOF
for i in src/*.xmq
do
NAME=$(basename $i)
export NAME="${NAME%.*}"
(xmq $i for-each /driver/detect/mvt --shell='./print_mvt.sh "${.}" "$NAME"') >> $OUT
done
cat >> $OUT <<EOF
};
EOF

Wyświetl plik

@ -0,0 +1 @@
#!/bin/bash

Wyświetl plik

@ -0,0 +1,10 @@
#!/bin/bash
MVT="$1"
DRIVER="$2"
M=$(echo "$1" | cut -f 1 -d ',')
V=$(echo "$1" | cut -f 2 -d ',')
T=$(echo "$1" | cut -f 3 -d ',')
echo " { { MANUFACTURER_${M},0x${V},0x${T} }, \"$DRIVER\" },"

Wyświetl plik

@ -0,0 +1,29 @@
driver {
name = elster
meter_type = GasMeter
default_fields = name,id,total_m3,timestamp
detect {
mvt = ELS,81,03
}
use = actuality_duration_s
field {
name = total
quantity = Volume
match {
measurement_type = Instantaneous
vif_range = Volume
}
about {
de = 'Der Gesamtwasserverbrauch.'
en = 'The total water consumption.'
fr = '''La consommation totale d'eau.'''
sv = 'Den totala vattenförbrukningen.'
}
}
test {
args = 'Gas elster 05105025 NOKEY'
telegram = 3644A511640010253837722550100593158103E70020052F2F_0374E602000C137034220302FD74EE0F2F2F2F2F2F2F2F2F2F2F2F2F2F2F
json = '{"media":"gas","meter":"elster","name":"Gas","id":"05105025","actuality_duration_s":742,"total_m3":3223.47,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'Gas;05105025;3223.47;1111-11-11 11:11.11'
}
}

Wyświetl plik

@ -0,0 +1,275 @@
driver {
name = eltako
default_fields = name,id,total_kwh,timestamp
meter_type = ElectricityMeter
detect {
mvt = ELT,01,02
}
field {
name = status
quantity = Text
info = status_and_error_flags
match {
measurement_type = Instantaneous
vif_range = ErrorFlags
}
lookup {
name = ERROR_FLAGS
map_type = BitToString
mask_bits = 0xff
default_message = OK
map {
name = BUSY
info = 'System is busy'
value = 0x01
test = Set
}
map {
name = GENERIC_APP_ERROR
info = 'Generic application error'
value = 0x02
test = Set
}
map {
name = CURRENT_LOW
info = 'Current too low'
value = 0x04
test = Set
}
map {
name = PERMANENT_ERROR
info = 'permanent error'
value = 0x08
test = Set
}
map {
name = TEMPORARY_ERROR
info = 'temporary error'
value = 0x10
test = Set
}
}
}
field {
name = 'total_tariff_1'
quantity = Energy
info = 'Total cumulative active energy per tariff.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyEnergyVIF
tariff_nr = 1
}
}
field {
name = 'total_tariff_2'
quantity = Energy
info = 'Total cumulative active energy per tariff.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyEnergyVIF
tariff_nr = 2
}
}
field {
name = 'total_reactive_tariff_{tariff_counter}'
quantity = Energy
info = 'Total cumulative reactive energy per tariff.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyEnergyVIF
storage_nr = 2
tariff_nr = 1,10
}
}
field {
name = voltage_l1_n
quantity = Voltage
info = 'Instantaneous voltage between L1 and neutral.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Voltage
add_combinable = Mfct01
}
}
field {
name = current_l1
quantity = Amperage
info = 'Instantaneous current in the L1 phase.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Amperage
add_combinable = Mfct01
}
}
field {
name = power_l1
quantity = Power
info = 'active Power in L1 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
add_combinable = Mfct01
}
}
field {
name = reactive_power_l1
quantity = Power
info = 'reactive Power in L1 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
subunit_nr = 1
add_combinable = Mfct01
}
}
field {
name = voltage_l2_n
quantity = Voltage
info = 'Instantaneous voltage between L2 and neutral.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Voltage
add_combinable = Mfct02
}
}
field {
name = current_l2
quantity = Amperage
info = 'Instantaneous current in the L2 phase.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Amperage
add_combinable = Mfct02
}
}
field {
name = power_l2
quantity = Power
info = 'active Power in L2 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
add_combinable = Mfct02
}
}
field {
name = reactive_power_l2
quantity = Power
info = 'reactive Power in L2 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
subunit_nr = 1
add_combinable = Mfct02
}
}
field {
name = voltage_l3_n
quantity = Voltage
info = 'Instantaneous voltage between L3 and neutral.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Voltage
add_combinable = Mfct03
}
}
field {
name = current_l3
quantity = Amperage
info = 'Instantaneous current in the L3 phase.'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = Amperage
add_combinable = Mfct03
}
}
field {
name = power_l3
quantity = Power
info = 'active Power in L3 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
add_combinable = Mfct03
}
}
field {
name = reactive_power_l3
quantity = Power
info = 'reactive Power in L3 phase'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
subunit_nr = 1
add_combinable = Mfct03
}
}
field {
name = ct_numerator
info = 'Current transformer ratio (numerator)'
quantity = Dimensionless
vif_scaling = None
match {
difvifkey = 02FF68
}
}
field {
name = active_power_overall
quantity = Power
info = 'active Power overall'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
add_combinable = Mfct00
}
}
field {
name = reactive_power_overall
quantity = Power
info = 'reactive Power overall'
match {
measurement_type = Instantaneous
vif_scaling = Auto
vif_range = AnyPowerVIF
subunit_nr = 1
add_combinable = Mfct00
}
}
field {
name = active_tariff
info = 'active tariff'
quantity = Dimensionless
vif_scaling = None
match {
difvifkey = 01FF13
}
}
field {
name = 'total'
quantity = Energy
info = 'Total active energy over all tariffs.'
calculate = total_tariff_1_kwh+total_tariff_2_kwh
}
test {
args = 'Eltako eltako 23451236 NOKEY'
telegram = 689292680800723612452394150102cd0000008c1004688902008c1104688902008c2004000000008c21040000000002fdc9ff01ee0002fddBff01100002acff0120008240acff010a0002fdc9ff02ef0002fddBff02110002acff0224008240acff02070002fdc9ff03ee0002fddBff030e0002acff031c008240acff03060002ff68010002acff0062008240acff00190001ff1300f416
json = '{"active_power_overall_kw": 0.98,"active_tariff_counter": 0,"ct_numerator_counter": 1,"current_l1_a": 1.6,"current_l2_a": 1.7,"current_l3_a": 1.4,"id": "23451236","media": "electricity","meter": "eltako","name": "Eltako","power_l1_kw": 0.32,"power_l2_kw": 0.36,"power_l3_kw": 0.28,"reactive_power_l1_kw": 0.1,"reactive_power_l2_kw": 0.07,"reactive_power_l3_kw": 0.06,"reactive_power_overall_kw": 0.25,"timestamp": "1111-11-11T11:11:11Z","total_kwh": 289.68,"total_reactive_tariff_1_kwh": 289.68,"total_reactive_tariff_2_kwh": 0,"total_tariff_1_kwh": 289.68,"total_tariff_2_kwh": 0,"voltage_l1_n_v": 238,"voltage_l2_n_v": 239,"voltage_l3_n_v": 238}'
fields = 'Eltako;23451236;289.68;1111-11-11 11:11.11'
}
}

Wyświetl plik

@ -0,0 +1,49 @@
driver {
name = iperl
meter_type = WaterMeter
default_fields = name,id,total_m3,max_flow_m3h,timestamp
detect {
mvt = SEN,68,06
mvt = SEN,68,07
mvt = SEN,7c,07
}
field {
name = total
quantity = Volume
match {
measurement_type = Instantaneous
vif_range = Volume
}
about {
de = 'Der Gesamtwasserverbrauch.'
en = 'The total water consumption.'
fr = '''La consommation totale d'eau.'''
sv = 'Den totala vattenförbrukningen.'
}
}
field {
name = max_flow
quantity = Flow
match {
measurement_type = Instantaneous
vif_range = VolumeFlow
}
about {
en = 'The maximum flow recorded during previous period.'
}
}
test {
args = 'MoreWater iperl 12345699 NOKEY'
coment = 'Test iPerl T1 telegram, that after decryption, has 2f2f markers.'
telegram = 1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F
json = '{"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'MoreWater;12345699;7.704;0;1111-11-11 11:11.11'
}
test {
args = 'WaterWater iperl 33225544 NOKEY'
comment = 'Test iPerl T1 telegram not encrypted, which has no 2f2f markers.'
telegram = 1844AE4C4455223368077A55000000_041389E20100023B0000
json = '{"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'WaterWater;33225544;123.529;0;1111-11-11 11:11.11'
}
}

Wyświetl plik

@ -0,0 +1,128 @@
driver {
name = kampress
default_fields = name,id,status,pressure_bar,max_pressure_bar,min_pressure_bar,timestamp
meter_type = PressureSensor
detect {
mvt = KAM,01,18
}
field {
name = status
quantity = Text
info = status_and_error_flags
match {
measurement_type = Instantaneous
vif_range = ErrorFlags
}
lookup {
name = ERROR_FLAGS
map_type = BitToString
mask_bits = 0xffff
default_message = OK
map {
name = DROP
info = 'Unexpected drop in pressure in relation to average pressure.'
value = 0x01
test = Set
}
map {
name = SURGE
info = 'Unexpected increase in pressure in relation to average pressure.'
value = 0x02
test = Set
}
map {
name = HIGH
info = 'Average pressure has reached configurable limit. Default 15 bar.'
value = 0x04
test = Set
}
map {
name = LOW
info = 'Average pressure has reached configurable limit. Default 1.5 bar.'
value = 0x08
test = Set
}
map {
name = TRANSIENT
info = 'Pressure changes quickly over short timeperiods. Average is fluctuating.'
value = 0x10
test = Set
}
map {
name = COMM_ERROR
info = 'Cannot measure properly or bad internal communication.'
value = 0x20
test = Set
}
}
}
field {
name = pressure
quantity = Pressure
info = 'The measured pressure.'
match {
measurement_type = Instantaneous
vif_range = Pressure
}
}
field {
name = max_pressure
quantity = Pressure
info = 'The maximum pressure measured during ?'
match {
measurement_type = Maximum
vif_range = Pressure
}
}
field {
name = min_pressure
quantity = Pressure
info = 'The minimum pressure measured during ?'
match {
measurement_type = Minimum
vif_range = Pressure
}
}
field {
name = alfa
info = 'We do not know what this is.'
quantity = Dimensionless
vif_scaling = None
match {
difvifkey = 05FF09
}
}
field {
name = beta
info = 'We do not know what this is.'
quantity = Dimensionless
vif_scaling = None
match {
difvifkey = 05FF0A
}
}
test {
args = 'Pressing kampress 77000317 NOKEY'
telegram = 32442D2C1703007701188D280080E39322DB8F78_22696600126967000269660005FF091954A33A05FF0A99BD823A02FD170800
json = '{"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001246,"beta_counter":0.000997,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'Pressing;77000317;LOW;1.02;1.03;1.02;1111-11-11 11:11.11'
}
test {
args = 'Pressing kampress 77000317 NOKEY'
telegram = '32442D2C1703007701188D280080E39322DB8F78_22696600126967000269660005FF091954A33A05FF0A99BD823A02FD170800
27442D2C1703007701188D280194E393226EC679DE735657_660067006600962B913A21B9423A0800'
json = '{"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001108,"beta_counter":0.000743,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'Pressing;77000317;LOW;1.02;1.03;1.02;1111-11-11 11:11.11'
}
test {
args = 'Pressing kampress 77000317 NOKEY'
telegram = '32442D2C1703007701188D280080E39322DB8F78_22696600126967000269660005FF091954A33A05FF0A99BD823A02FD170800
27442D2C1703007701188D289554F295224ED579DE73188A_650066006600E80EA43A6B97A3BA0800'
json = '{"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.02,"min_pressure_bar":1.01,"alfa_counter":0.001252,"beta_counter":-0.001248,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'Pressing;77000317;LOW;1.02;1.02;1.01;1111-11-11 11:11.11'
}
}

Wyświetl plik

@ -0,0 +1,24 @@
driver {
name = werhlemodwm
meter_type = WaterMeter
default_fields = name,id,total_m3,timestamp
detect {
mvt = WZG,03,16
}
use = meter_datetime
use = target_date
use = target_m3
use = total_m3
use = fabrication_no
field {
name = next_target
quantity = PointInTime
display_unit = date
match {
measurement_type = Instantaneous
vif_range = Date
add_combinable = FutureValue
storage_nr = 1
}
}
}

6
drivers/test.sh 100755
Wyświetl plik

@ -0,0 +1,6 @@
#!/bin/sh
export PROG="$1"
export DRIVER="$2"
echo Testing $DRIVER
xmq $DRIVER for-each /driver/test --shell='./test_case.sh "$PROG" "$DRIVER" "${args}" "${telegram}" "${json}" "${fields}" "$1"'

Wyświetl plik

@ -0,0 +1,47 @@
#!/bin/bash
TEST=build/test
PROG="$1"
DRIVER="$2"
ARGS="$3"
HEX="$4"
JSON="$5"
FIELDS="$6"
rm -f $TEST/test_output.txt $TEST/test_expected.txt $TEST/simulation_tmp.txt
echo "$HEX" | sed 's/^/telegram=/g' > $TEST/simulation_tmp.txt
$PROG --driver=$DRIVER --format=json $TEST/simulation_tmp.txt $ARGS \
| tail -n 1 \
| jq . --sort-keys \
| sed 's/"timestamp": "....-..-..T..:..:..Z"/"timestamp": "1111-11-11T11:11:11Z"/' \
> $TEST/test_output.txt
echo "$JSON" | jq . --sort-keys > $TEST/test_expected.txt
if ! diff $TEST/test_expected.txt $TEST/test_output.txt
then
if [ "$USE_MELD" = "true" ]
then
meld $TEST/test_expected.txt $TEST/test_output.txt
fi
fi
rm -f $TEST/test_output.txt $TEST/test_expected.txt
$PROG --driver=$DRIVER --format=fields $TEST/simulation_tmp.txt $ARGS \
| sed 's/....-..-.. ..:..:../1111-11-11 11:11.11/' \
| tail -n 1 \
> $TEST/test_output.txt
echo "$FIELDS" > $TEST/test_expected.txt
if ! diff $TEST/test_expected.txt $TEST/test_output.txt
then
if [ "$USE_MELD" = "true" ]
then
meld $TEST/test_expected.txt $TEST/test_output.txt
fi
fi

Wyświetl plik

@ -1,5 +0,0 @@
## 0.2.0
- Wmbusmeters configuration migrated to add-on page
## 0.1.0
- First versioned release of the add-on

Wyświetl plik

@ -1,103 +0,0 @@
# Home Assistant Community Add-on: wmbusmeters (W-MBus to MQTT)
This add-on allows you to acquire utility meter readings **without** the vendors bridge or gateway as long as they support C1, T1 or S1 telegrams using the wireless mbus protocol (WMBUS).
## Installation
The installation of this add-on is pretty straightforward and not different in
comparison to installing any other community-driven Home Assistant add-on.
1. Navigate to Supervisor > Add-on Store > Repositories
1. Add https://github.com/weetmuts/wmbusmeters
1. Install Wmbusmeters
1. Plug-in your radio receiver USB dongle
1. Start the addon container
1. In the logs you should see all the W-Mbus telegrams that wmbusmeter is able to receive. <br> _If you don't see anything, check the logs carefully. <br> If you configure it late evening or in the night, please note the radio modules often send telegrams less frequently than in typical working hours or don't send them at all. <br> If your antenna is in a distance to the radio module, try to locate it closer._
1. You are ready to configure!
1. Finally, don't forget about adding the MQTT sensor into your Home Assistant.
## Configuration
Once the wmbusmeters is receiving the telegrams you need to configure your meter using `meters` option (see below) to pass the readings to MQTT topic.
#### Option: `meters`
Specify your meters usign wmbusmeters meter file format. The `driver` and `id` values can be read from the add-on logs after the initial start (with empty `meters` configuration). The `name` is your label for the meter and `key` is the encryption key to decrypt telegrams (if your meter use any).
See [project README for more information][github]
```yaml
meters:
- |-
name=MainWater
driver=apator162
id=01234567
key=00000000000000000000000000000000
```
#### Option: `conf`
The wmbusmeters configuration file. It will be used as `wmbusmeters.conf`.
See [project README for more information][github]
#### Option: `data_path`
Path relative for add-on where wmbusmeters files are stored:
```
/logs/meter_readings/
/etc/wmbusmeters.conf
/etc/wmbusmeters.d/
```
#### Option: `mqtt`
By default it is empty `{}` and leverages then the _Moquitto broker_ addon details provided by supervisor. However, you can specify the custom mqtt broker connection details here
```yaml
mqtt:
host: your-broker-host
port: 1883
user: your-username
password: your-password
```
## Home Assistant integration
Finally, you need to tell Home Assistant how to extract the readings from the MQTT. You can add the following sensor definition into your `sensor:` section of `configuration.yaml`.
```yaml
sensor:
- platform: mqtt
state_topic: "wmbusmeters/MainWater"
json_attributes_topic: "wmbusmeters/MainWater"
unit_of_measurement: "m3"
value_template: "{{ value_json.total_m3 }}"
name: Water usage
icon: "mdi:gauge"
```
_Please note: `MainWater` is the water meter name used in `meters` configuration._
## Support
Got questions?
You have several options to get them answered:
- [Open an issue here][issue] in project GitHub
- The Home Assistant [Community Forum][forum].
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
## Authors & contributors
[Wmbusmeters contributors][contributors]
[contributors]: https://github.com/weetmuts/wmbusmeters/graphs/contributors
[forum]: https://community.home-assistant.io/c/home-assistant-os/25
[github]: https://github.com/weetmuts/wmbusmeters
[issue]: https://github.com/weetmuts/wmbusmeters/issues
[reddit]: https://reddit.com/r/homeassistant

Wyświetl plik

@ -1,33 +0,0 @@
ARG BUILD_FROM
FROM $BUILD_FROM AS build
ENV LANG C.UTF-8
RUN apk add --no-cache alpine-sdk gcc linux-headers ncurses-dev librtlsdr-dev cmake libusb-dev
ADD https://api.github.com/repos/weetmuts/wmbusmeters/git/refs/heads/master version.json
RUN git clone https://github.com/weetmuts/wmbusmeters.git && \
git clone https://github.com/weetmuts/rtl-wmbus.git && \
git clone https://github.com/merbanan/rtl_433.git
WORKDIR /wmbusmeters
RUN make
WORKDIR /rtl-wmbus
RUN make release && chmod 755 build/rtl_wmbus
WORKDIR /rtl_433
RUN mkdir build && cd build && cmake ../ && make
FROM $BUILD_FROM AS scratch
ENV QEMU_EXECVE=1
RUN apk add --no-cache mosquitto-clients libstdc++ curl libusb ncurses rtl-sdr netcat-openbsd
WORKDIR /wmbusmeters
COPY --from=build /wmbusmeters/build/wmbusmeters /wmbusmeters/wmbusmeters
COPY --from=build /rtl-wmbus/build/rtl_wmbus /usr/bin/rtl_wmbus
COPY --from=build /rtl_433/build/src/rtl_433 /usr/bin/rtl_433
COPY mqtt_discovery.sh /
RUN chmod a+x /mqtt_discovery.sh
COPY run.sh /
RUN chmod a+x /run.sh
CMD ["/run.sh"]

Wyświetl plik

@ -1,7 +0,0 @@
# Home Assistant Community Add-on: wmbusmeters (W-Mbus to MQTT)
Allows you to acquire utility meter readings **without** the vendors bridge or gateway as long as they support C1, T1 or S1 telegrams using the wireless mbus protocol (WMBUS).
It bridges WMBUS readings via MQTT. In this way you can integrate with whatever smart home infrastructure you are using.
See Documentation tab for more details.

Wyświetl plik

@ -1,41 +0,0 @@
{
"name": "Wmbusmeters (W-MBus to MQTT)",
"version": "0.2.24",
"slug": "wmbusmeters",
"description": "Acquire utility meter readings using the wireless mbus protocol (WMBUS)",
"arch": ["armv7", "aarch64", "amd64"],
"url": "https://github.com/weetmuts/wmbusmeters",
"init" : false,
"startup": "application",
"boot": "auto",
"devices": ["/dev/ttyUSB0", "/dev/ttyAMA0"],
"usb": true,
"uart": true,
"services": [
"mqtt:need"
],
"map": [
"share:rw",
"config:rw"
],
"options": {
"data_path": "/config/wmbusmeters",
"enable_mqtt_discovery": false,
"conf":
"loglevel=normal\ndevice=auto:t1\ndonotprobe=/dev/ttyAMA0\nlogtelegrams=false\nformat=json\nlogfile=/dev/stdout\nshell=/wmbusmeters/mosquitto_pub.sh wmbusmeters/$METER_NAME \"$METER_JSON\"",
"meters": [],
"mqtt": {}
},
"schema": {
"data_path": "str",
"enable_mqtt_discovery": "bool?",
"mqtt": {
"host": "str?",
"port": "port?",
"user": "str?",
"password": "str?"
},
"conf": "str",
"meters": [ "str" ]
}
}

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 15 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 26 KiB

Wyświetl plik

@ -1,98 +0,0 @@
#!/usr/bin/with-contenv bashio
aryDiscTopic=()
pub_args=()
while getopts h:p:u:P:c:w: flag
do
case "${flag}" in
h|p|u|P) pub_args+=("-${flag}" ${OPTARG});;
c) CONFIG_PATH=${OPTARG};;
w) CONFIG_DATA_PATH=${OPTARG};;
esac
done
# Get discovery_prefix
if bashio::config.exists "mqtt.discovery_prefix"
then MQTT_DISCOVERY_PREFIX=$(bashio::config "mqtt.discovery_prefix")
else MQTT_DISCOVERY_PREFIX=$(bashio::services mqtt "discovery_prefix"); fi
if [ "${MQTT_DISCOVERY_PREFIX+true}" ] || [ $MQTT_DISCOVERY_PREFIX != "null" ];
then MQTT_DISCOVERY_PREFIX="homeassistant"; fi
# Is MQTT discovery enabled?
CONFIG_MQTTDISCOVERY_ENABLED="$(jq --raw-output -c -M '.enable_mqtt_discovery' $CONFIG_PATH)"
if [ $CONFIG_MQTTDISCOVERY_ENABLED == "true" ]; then
echo -e "\nMQTT Discovery ..."
# Copy template files
templatedir="$(mktemp -d -p /dev/shm/)"
wget -O - https://github.com/weetmuts/wmbusmeters/archive/refs/heads/master.tar.gz 2> /dev/null | tar xz --strip=3 "wmbusmeters-master/ha-addon/mqtt_discovery" -C $templatedir || true
[ ! -d $CONFIG_DATA_PATH/etc/mqtt_discovery ] && mkdir -p $CONFIG_DATA_PATH/etc/mqtt_discovery
cp -u ${templatedir}/* ${CONFIG_DATA_PATH}/etc/mqtt_discovery/ 2>/dev/null || true
rm -r $templatedir
# Enumerate defined meters
IFS=$'\n'
for meter in $(jq -c -M '.meters[]' $CONFIG_PATH)
do
declare -A aryKV
declare kv
for line in $(printf '%s\n' $meter | jq --raw-output -c -M '.')
do
readarray -d = -t kv <<< $line
#echo "${kv[0]} = ${kv[1]}"
aryKV[${kv[0]}]=${kv[1]%$'\n'}
done
echo " Adding meter: ${aryKV['name']} ..."
if [ "${aryKV['id']+true}" ] && [ "${aryKV['driver']+true}" ] ; then
file="$CONFIG_DATA_PATH/etc/mqtt_discovery/${aryKV['driver']}.json"
if test -f "$file"; then
for attribute in $(jq --raw-output -c -M '. | keys[]' $file)
do
#echo "Attribute: ${attribute}"
aryKV["attribute"]=$attribute
filter=".${attribute}.component"
component=$(jq --raw-output -c -M $filter $file)
if [[ ! -z "$component" ]] && [ $component != "null" ] ; then
topic="$MQTT_DISCOVERY_PREFIX/$component/wmbusmeters/${aryKV['id']}_$attribute/config"
filter=".${attribute}.discovery_payload"
payload=$(jq --raw-output -c -M $filter $file)
for key in ${!aryKV[@]}; do
payload="${payload//\{$key\}/${aryKV[${key}]}}"
#echo ${key} ${aryKV[${key}]}
done
echo " Add/update topic: $topic"
#echo " Payload: $payload"
aryDiscTopic+=($topic)
/usr/bin/mosquitto_pub ${pub_args[@]} -r -t "${topic}" -m "${payload}"
fi
done
else
echo " File $file not found."
fi
fi
done
fi
echo -e "MQTT Discovery cleanup..."
ramtmp="$(mktemp -p /dev/shm/)"
/usr/bin/mosquitto_sub ${pub_args[@]} -t "$MQTT_DISCOVERY_PREFIX/+/wmbusmeters/+/config" --retained-only -F "%t" > $ramtmp & PID=$!
sleep 1
kill $PID
readarray -t aryReadTopic < $ramtmp;
rm $ramtmp
for topic in ${aryReadTopic[@]}
do
if [[ ! ${aryDiscTopic[@]} =~ $topic ]]; then
echo " Removing topic: $topic"
/usr/bin/mosquitto_pub ${pub_args[@]} -r -t "${topic}" -n
fi
done

Wyświetl plik

@ -1,111 +0,0 @@
{
"current_hca": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"name": "{name} current HCA",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "unit",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"previous_hca": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"name": "{name} previous HCA",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "unit",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"temp_room_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} room temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer"
}
},
"temp_radiator_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} radiator temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,270 +0,0 @@
{
"total_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "water",
"name": "{name} total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"target_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"device_class": "water",
"name": "{name} target",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"name": "{name} flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"min_flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"name": "{name} min flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"max_flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"name": "{name} max flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"min_flow_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} min water temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"max_flow_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} max water temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"min_external_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} min ambient temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer"
}
},
"status_dry": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status dry",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'DRY' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_reversed": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status reversed",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'REVERSED' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_leak": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status leak",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'LEAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_burst": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status burst",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'BURST' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,49 +0,0 @@
{
"total_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"name": "{name} total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,69 +0,0 @@
{
"total_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"name": "{name} total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"target_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"name": "{name} target",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,228 +0,0 @@
{
"total_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "water",
"name": "{name} total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"target_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"device_class": "water",
"name": "{name} target",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"max_flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"name": "{name} max flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"flow_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"availability": {
"topic": "wmbusmeters/{name}",
"value_template": "{{ value_json.{attribute} != 127 }}",
"payload_available": "True",
"payload_not_available": "False"
},
"enabled_by_default": false,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} water temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"external_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"availability": {
"topic": "wmbusmeters/{name}",
"value_template": "{{ value_json.{attribute} != 127 }}",
"payload_available": "True",
"payload_not_available": "False"
},
"enabled_by_default": false,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} ambient temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer"
}
},
"status_dry": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status dry",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'DRY' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_reversed": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status reversed",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'REVERSED' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_leak": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status leak",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'LEAK' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_burst": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status burst",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'BURST' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,422 +0,0 @@
{
"total_energy_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} total energy",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt-outline"
}
},
"total_volume_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"name": "{name} total volume",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:water"
}
},
"actual_flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"name": "{name} volume flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"forward_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} T1 temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"return_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} T2 temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"forward_energy_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} energy forward",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt"
}
},
"return_energy_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} energy returned",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt"
}
},
"status_VOLTAGE_INTERRUPTED": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} voltage interrupted",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'VOLTAGE_INTERRUPTED' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_LOW_BATTERY_LEVEL": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"entity_category": "diagnostic",
"device_class": "battery",
"name": "{name} low battery level",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'LOW_BATTERY_LEVEL' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T1_ABOVE_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T1 above range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T1_ABOVE_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T2_ABOVE_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T2 above range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T2_ABOVE_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T1_BELOW_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T1 below range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T1_BELOW_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T2_BELOW_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T2 below range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T2_BELOW_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_TEMP_DIFF_WRONG_POLARITY": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} temp diff wrong polarity",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'TEMP_DIFF_WRONG_POLARITY' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_FLOW_SENSOR_WEAK_OR_AIR": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} flow sensor weak or air",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'FLOW_SENSOR_WEAK_OR_AIR' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_WRONG_FLOW_DIRECTION": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} wrong flow direction",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'WRONG_FLOW_DIRECTION' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_UNKNOWN": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} unknown",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'UNKNOWN' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_FLOW_INCREASED": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} flow increased",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'FLOW_INCREASED' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,349 +0,0 @@
{
"total_energy_consumption_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} total energy consumption",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt-outline"
}
},
"total_volume_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"name": "{name} total volume",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:water"
}
},
"volume_flow_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"name": "{name} volume flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"t1_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} T1 temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"t2_temperature_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} T2 temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"energy_forward_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} energy forward",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt"
}
},
"energy_returned_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} energy returned",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt"
}
},
"status_VOLTAGE_INTERRUPTED": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} voltage interrupted",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'VOLTAGE_INTERRUPTED' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_LOW_BATTERY_LEVEL": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"entity_category": "diagnostic",
"device_class": "battery",
"name": "{name} low battery level",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'LOW_BATTERY_LEVEL' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_EXTERNAL_ALARM": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} external alarm",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'EXTERNAL_ALARM' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T1_ABOVE_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T1 above range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T1_ABOVE_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T2_ABOVE_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T2 above range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T2_ABOVE_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T1_BELOW_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T1 below range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T1_BELOW_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_SENSOR_T2_BELOW_MEASURING_RANGE": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} sensor T2 below range",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SENSOR_T2_BELOW_MEASURING_RANGE' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_TEMP_DIFF_WRONG_POLARITY": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "problem",
"name": "{name} temp diff wrong polarity",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'TEMP_DIFF_WRONG_POLARITY' in value_json.current_status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Kamstrup",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,49 +0,0 @@
{
"current_consumption_hca": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"name": "{name} heat cost total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "hca",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,50 +0,0 @@
{
"total_energy_consumption_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"device_class": "energy",
"state_class": "total",
"name": "{name} total energy consumption",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} RSSI",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dBm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,50 +0,0 @@
{
"total_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"device_class": "water",
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"name": "{name} total",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:gauge"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Qundis",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,407 +0,0 @@
{
"total_water_m3": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "total",
"name": "{name} total water volume",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:water"
}
},
"flow_water_m3h": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"name": "{name} water volume flow",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "m³/h",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"total_kwh": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"json_attributes_topic": "wmbusmeters/{name}",
"state_class": "total",
"device_class": "energy",
"name": "{name} total energy consumption",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kWh",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:home-lightning-bolt-outline"
}
},
"power_kw": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"name": "{name} current power consumption",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "kW",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:waves-arrow-right"
}
},
"forward_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} forward water temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"return_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} return water temperature",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-water"
}
},
"difference_c": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"state_class": "measurement",
"device_class": "temperature",
"name": "{name} water temperature difference forward-return",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:thermometer-chevron-down"
}
},
"status_OK": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status OK",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_TEMP_SENSOR_1_CABLE_BREAK": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Temperature Sensor 1 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Temperature Sensor 1 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_1_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_TEMP_SENSOR_2_CABLE_BREAK": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Temperature Sensor 2 Cable Break)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_CABLE_BREAK' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Temperature Sensor 2 Short Circuit)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_TEMP_SENSOR_2_SHORT_CIRCUIT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Flow Management System)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_FLOW_MEASUREMENT_SYSTEM_ERROR' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_ERROR_ELECTRONICS_DEFECT": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error (Electronics Defective)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR_ELECTRONICS_DEFECT' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_OK_INSTRUMENT_RESET": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status OK (instrument reset)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_INSTRUMENT_RESET' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_OK_BATTERY_LOW": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status OK (battery low)",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'OK_BATTERY_LOW' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"meter_timestamp": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"name": "{name} meter timestamp",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:timeline-clock"
}
},
"timestamp": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"state_class": "measurement",
"name": "{name} timestamp",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:clock"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": [
"wmbusmeters_{id}"
],
"manufacturer": "Engelmann",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,64 +0,0 @@
{
"status_smoke": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "smoke",
"name": "{name} status smoke",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'SMOKE' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"status_error": {
"component": "binary_sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": true,
"device_class": "problem",
"name": "{name} status error",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"value_template": "{{ 'ERROR' in value_json.status }}",
"payload_on": "True",
"payload_off": "False"
}
},
"rssi_dbm": {
"component": "sensor",
"discovery_payload": {
"device": {
"identifiers": ["wmbusmeters_{id}"],
"manufacturer": "Techem",
"model": "{driver}",
"name": "{name}",
"sw_version": "{id}"
},
"enabled_by_default": false,
"entity_category": "diagnostic",
"device_class": "signal_strength",
"state_class": "measurement",
"name": "{name} rssi",
"state_topic": "wmbusmeters/{name}",
"unique_id": "wmbusmeters_{id}_{attribute}",
"unit_of_measurement": "dbm",
"value_template": "{{ value_json.{attribute} }}",
"icon": "mdi:signal"
}
}
}

Wyświetl plik

@ -1,60 +0,0 @@
#!/usr/bin/with-contenv bashio
CONFIG_PATH=/data/options.json
CONFIG_DATA_PATH=$(bashio::config 'data_path')
CONFIG_CONF="$(jq --raw-output -c -M '.conf' $CONFIG_PATH)"
CONFIG_METERS="$(jq --raw-output -c -M '.meters' $CONFIG_PATH)"
echo "Syncing wmbusmeters configuration ..."
[ ! -d $CONFIG_DATA_PATH/logs/meter_readings ] && mkdir -p $CONFIG_DATA_PATH/logs/meter_readings
[ ! -d $CONFIG_DATA_PATH/etc/wmbusmeters.d ] && mkdir -p $CONFIG_DATA_PATH/etc/wmbusmeters.d
echo -e "$CONFIG_CONF" > $CONFIG_DATA_PATH/etc/wmbusmeters.conf
echo "Registering meters ..."
rm -f $CONFIG_DATA_PATH/etc/wmbusmeters.d/*
meter_no=0
IFS=$'\n'
for meter in $(jq -c -M '.meters[]' $CONFIG_PATH)
do
meter_no=$(( meter_no+1 ))
METER_NAME=$(printf 'meter-%04d' "$(( meter_no ))")
echo "Adding $METER_NAME ..."
METER_DATA=$(printf '%s\n' $meter | jq --raw-output -c -M '.')
echo -e "$METER_DATA" > $CONFIG_DATA_PATH/etc/wmbusmeters.d/$METER_NAME
done
echo "Generating MQTT configuration ... "
if bashio::config.exists "mqtt.host"
then
MQTT_HOST=$(bashio::config "mqtt.host")
if bashio::config.exists "mqtt.port"; then MQTT_PORT=$(bashio::config "mqtt.port"); fi
if bashio::config.exists "mqtt.user"; then MQTT_USER=$(bashio::config "mqtt.user"); fi
if bashio::config.exists "mqtt.password"; then MQTT_PASSWORD=$(bashio::config "mqtt.password"); fi
else
MQTT_HOST=$(bashio::services mqtt "host")
MQTT_PORT=$(bashio::services mqtt "port")
MQTT_USER=$(bashio::services mqtt "username")
MQTT_PASSWORD=$(bashio::services mqtt "password")
fi
echo "Broker $MQTT_HOST will be used."
pub_args=('-h' $MQTT_HOST )
pub_args_quoted=('-h' \'$MQTT_HOST\' )
[[ ! -z ${MQTT_PORT+x} ]] && pub_args+=( '-p' $MQTT_PORT ) && pub_args_quoted+=( '-p' \'$MQTT_PORT\' )
[[ ! -z ${MQTT_USER+x} ]] && pub_args+=( '-u' $MQTT_USER ) && pub_args_quoted+=( '-u' \'$MQTT_USER\' )
[[ ! -z ${MQTT_PASSWORD+x} ]] && pub_args+=( '-P' $MQTT_PASSWORD ) && pub_args_quoted+=( '-P' \'$MQTT_PASSWORD\' )
cat > /wmbusmeters/mosquitto_pub.sh << EOL
#!/usr/bin/with-contenv bashio
TOPIC=\$1
MESSAGE=\$2
/usr/bin/mosquitto_pub ${pub_args_quoted[@]} -r -t \$TOPIC -m "\$MESSAGE"
EOL
chmod a+x /wmbusmeters/mosquitto_pub.sh
# Running MQTT discovery
/mqtt_discovery.sh ${pub_args[@]} -c $CONFIG_PATH -w $CONFIG_DATA_PATH || true
echo "Running wmbusmeters ..."
/wmbusmeters/wmbusmeters --useconfig=$CONFIG_DATA_PATH

Wyświetl plik

@ -44,19 +44,22 @@ do
esac
done
SRC=$SRC ROOT=$ROOT /bin/sh ./scripts/install_binaries.sh
SRC=$SRC ROOT=$ROOT /bin/sh ./scripts/install_binaries.sh || exit $?
ROOT=$ROOT /bin/sh ./scripts/install_manpage.sh
ROOT=$ROOT /bin/sh ./scripts/install_manpage.sh || exit $?
if [ "$ADDUSER" = "true" ]
then
ROOT=$ROOT /bin/sh ./scripts/add_wmbusmeters_user.sh
ROOT=$ROOT /bin/sh ./scripts/add_wmbusmeters_user.sh || exit $?
fi
ROOT=$ROOT /bin/sh ./scripts/prepare_logfiles.sh
ROOT=$ROOT /bin/sh ./scripts/prepare_logfiles.sh || exit $?
ROOT=$ROOT /bin/sh ./scripts/install_default_configuration.sh
ROOT=$ROOT /bin/sh ./scripts/install_default_configuration.sh || exit $?
ROOT=$ROOT /bin/sh ./scripts/install_systemd_service.sh
ROOT=$ROOT /bin/sh ./scripts/install_systemd_service.sh || exit $?
ROOT=$ROOT /bin/sh ./scripts/add_myself_to_dialout.sh
ROOT=$ROOT /bin/sh ./scripts/add_myself_to_dialout.sh || exit $?
echo
echo "wmbusmeters sucessfully installed."

Wyświetl plik

@ -1,5 +0,0 @@
{
"name": "Wmbusmeter",
"url": "https://github.com/weetmuts/wmbusmeters/",
"maintainer": "weetmuts"
}

Wyświetl plik

@ -18,7 +18,7 @@ trap finish EXIT
cat > $TMP <<EOF
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: wmbusmeters
Source: https://github.com/weetmuts/wmbusmeters
Source: https://github.com/wmbusmeters/wmbusmeters
Upstream-Contact: Fredrik Öhrström <oehrstroem@gmail.com>
Files: *
@ -44,6 +44,9 @@ do
elif grep -q -i "CC0" $f
then
license="CC0"
elif grep -q -i "MIT" $f
then
license="MIT"
else
echo "Unknown license in file: "+$f
exit 1
@ -70,6 +73,25 @@ License: GPL-3+
On Debian systems, the complete text of the GNU General Public License
version 3 can be found in file "/usr/share/common-licenses/GPL-3".
License: MIT
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.
License: CC0
The authors, and therefore would be copyright holders, have as much
as possible relinguished their copyright to the public domain.

Wyświetl plik

@ -1,7 +1,7 @@
#!/bin/bash
# Copyright (C) 2022 Fredrik Öhrström (gpl-3.0-or-later)
# Grab all text up to the "Version x.y.z-RC1: <date>" line
# Grab all text up to the "Version x.y.z-RC1 <date>" line
# There should be no text.
CHANGES=$(sed '/Version /q' CHANGES | grep -v ^Version | sed '/./,$!d' | \
tac | sed -e '/./,$!d' | tac | sed -e '/./,$!d' > /tmp/release_changes)
@ -13,7 +13,7 @@ then
fi
# Grab all text between the Version RC and the previous VERSION.
sed -n '/^Version.*-RC[0-9]:/,/^Version .*\.[0-9]\+:/{p;/^Version .*\.[0-9]\+:/q}' CHANGES \
sed -n '/^Version.*-RC[0-9] /,/^Version .*\.[0-9]\+:/{p;/^Version .*\.[0-9]\+ /q}' CHANGES \
| grep -v "^Version " | sed '/./,$!d' \
| tac | sed -e '/./,$!d' | tac | sed -e '/./,$!d' > /tmp/release_changes
@ -23,27 +23,36 @@ then
exit 0
fi
# Grab the line from CHANGES which says: Version 1.2.3-RC1 2022-12-22
OLD_MESSAGE=$(grep -m 1 ^Version CHANGES)
RC_VERSION=$(grep -m 1 ^Version CHANGES | sed 's/Version \([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1 \2 \3/')
# Now extract the major, minor and patch.
PARTS=$(grep -m 1 ^Version CHANGES | sed 's/Version \([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1 \2 \3/')
MAJOR=$(echo "$RC_VERSION" | cut -f 1 -d ' ')
MINOR=$(echo "$RC_VERSION" | cut -f 2 -d ' ')
PATCH=$(echo "$RC_VERSION" | cut -f 3 -d ' ')
MAJOR=$(echo "$PARTS" | cut -f 1 -d ' ')
MINOR=$(echo "$PARTS" | cut -f 2 -d ' ')
PATCH=$(echo "$PARTS" | cut -f 3 -d ' ')
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
NEW_MESSAGE="Version $NEW_VERSION: $(date +'%Y-%m-%d')"
if git tag | grep -q "^${NEW_VERSION}\$"
then
echo "Oups! The new version tag $NEW_VERSION already exists!"
exit 0
fi
NEW_MESSAGE="Version $NEW_VERSION $(date +'%Y-%m-%d')"
PREV_GIT_MESSAGE=$(git log -1 --pretty=%B)
if [ "PREV_GIT_MESSAGE" != "$OLD_MESSAGE" ]
if [ "$PREV_GIT_MESSAGE" != "$OLD_MESSAGE" ]
then
echo "Oups! Something is wrong in the git log. Expected last commit to say \"$OLD_MESSAGE\" but it does not!"
echo "Oups! Something is wrong in the git log."
echo "Expected last commit to say \"$OLD_MESSAGE\" but it doesn't, it says: \"$PREV_GIT_MESSAGE\""
exit 0
fi
echo
echo "Deploying release $NEW_MESSAGE with changelog:"
echo "Deploying >>$NEW_MESSAGE<< with changelog:"
echo "----------------------------------------------------------------------------------"
cat /tmp/release_changes
echo "----------------------------------------------------------------------------------"
@ -57,17 +66,22 @@ while true; do
esac
done
sed 's/"version": "[\.0-9]*"/"version": "'$NEW_VERSION'"/' ha-addon/config.json > /tmp/release_haconfig
# Update the ha-addon version number. This will trigger rebuilds at ha installs with auto-update.
CMD="s/\"version\": \"[\.0-9]*\"/\"version\": \"${NEW_VERSION}\"/"
sed -i "$CMD" ha-addon/config.json
echo "Updated version number in ha-addon/config.json to $NEW_VERSION"
sed "s/$OLD_MESSAGE/$NEW_MESSAGE/" CHANGES > /tmp/release_changes
# Update the CHANGES file
CMD="1i $NEW_MESSAGE"
sed -i "$CMD" CHANGES
echo "Updated version string in CHANGES"
CMD="s/wmbusmeters version:.*/wmbusmeters version: $NEW_VERSION/g"
sed -i "$CMD" README.md
echo "Updated version string in README"
git commit -am "$NEW_MESSAGE"
git tag "$NEW_VERSION"
echo "Now do: git push ; git push --tags"
#git push
#git push --tags
echo "Now do: git push --followtags"

Wyświetl plik

@ -13,7 +13,7 @@ then
exit 1
fi
(cd src; grep -Eo "Copyright \(C\) (....-)?.... [^\(]+ \(.+\)" * | cut -f 2 -d ':' | tr -s ' ' | sed 's/(C) \([0-9][0-9][0-9][0-9]\) /(C) \1-\1 /' > $TMP)
(cd src; grep -Eo ".*Copyright \(C\) (....-)?.... [^\(]+ \(.+\)" * | cut -f 2 -d ':' | tr -s ' ' | sed 's/(C) \([0-9][0-9][0-9][0-9]\) /(C) \1-\1 /' > $TMP)
echo 'R"AUTHORS(' > $OUT

Wyświetl plik

@ -1,11 +1,26 @@
# Copyright (C) 2021-2022 Fredrik Öhrström (gpl-3.0-or-later)
# Copyright (C) 2021-2023 Fredrik Öhrström (gpl-3.0-or-later)
rm -f "$ROOT"/usr/bin/wmbusmeters "$ROOT"/usr/sbin/wmbusmetersd "$ROOT"/usr/bin/wmbusmeters-admin
mkdir -p "$ROOT"/usr/bin
mkdir -p "$ROOT"/usr/sbin
cp "$SRC" "$ROOT"/usr/bin/wmbusmeters
cp "${SRC}-admin" "$ROOT"/usr/bin/wmbusmeters-admin
# Command binary /usr/bin/wmbusmeters
wmbusmeters_dir="${ROOT}/usr/bin"
wmbusmeters_path="${wmbusmeters_dir}/wmbusmeters"
(cd "$ROOT"/usr/sbin; ln -s ../bin/wmbusmeters wmbusmetersd)
# Daemon /usr/sbin/wmbusmetersd which is a symlink to the command binary.
wmbusmetersd_dir="${ROOT}/usr/sbin"
wmbusmetersd_path="${wmbusmetersd_dir}/wmbusmetersd"
echo "binaries: installed $ROOT/usr/bin/wmbusmeters $ROOT/usr/sbin/wmbusmetersd $ROOT/usr/bin/wmbusmeters-admin"
# Remove any existing installed components.
rm -f "$wmbusmeters_path" "$wmbusmetersd_path" || exit $?
# Install the command binary and create the bin directory if necessary.
install -D -m 755 "$SRC" "$wmbusmeters_path" || exit $?
# Create the sbin directory if necessary.
mkdir -p "$wmbusmetersd_dir" || exit $?
# Calculate the relative symlink from sbin to bin.
wmbusmetersd_target="$(realpath -s --relative-to="${wmbusmetersd_dir}" "${wmbusmeters_path}")"
# Create the actual link.
ln -s "$wmbusmetersd_target" "$wmbusmetersd_path" || exit $?
echo "binaries: installed ${wmbusmeters_path} ${wmbusmetersd_path}"

Wyświetl plik

@ -14,11 +14,21 @@ then
loglevel=normal
# Remember to change auto here to the device you are going to use in production.
device=auto:t1
logfile=/var/log/wmbusmeters/wmbusmeters.log
# Set to true to capture all received telegrams in log file.
logtelegrams=false
format=json
meterfiles=/var/lib/wmbusmeters/meter_readings
meterfilesaction=overwrite
logfile=/var/log/wmbusmeters/wmbusmeters.log
# Enable the meterfiles to write telegrams to disk.
#meterfiles=/var/lib/wmbusmeters/meter_readings
#meterfilesaction=overwrite
# Enable execution of a shell command for each received telegram. For example: curl or mqtt
#shell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters/$METER_ID -m "$METER_JSON"
#shell=psql water -c "insert into consumption values ('$METER_ID',$METER_TOTAL_M3,'$METER_TIMESTAMP') "
# The alarmshell is executed when a problem with the receiving radio hardware is detected.
#alarmshell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters_alarm -m "$ALARM_TYPE $ALARM_MESSAGE"
# The alarmtimeout and expected activity is also used to detect failing receiving radio hardware.
#alarmtimeout=1h
#alarmexpectedactivity=mon-sun(00-23)
EOF
chmod 644 "$ROOT"/etc/wmbusmeters.conf
echo "conf file: created $ROOT/etc/wmbusmeters.conf"
@ -40,3 +50,18 @@ then
else
echo "conf dir: $ROOT/etc/wmbusmeters.d unchanged"
fi
####################################################################
##
## Create /etc/wmbusmeters.drivers.d
##
if [ ! -d "$ROOT"/etc/wmbusmeters.drivers.d ]
then
# Create the drivers directory
mkdir -p "$ROOT"/etc/wmbusmeters.drivers.d
chmod -R 755 "$ROOT"/etc/wmbusmeters.drivers.d
echo "conf dir: created $ROOT/etc/wmbusmeters.drivers.d"
else
echo "conf dir: $ROOT/etc/wmbusmeters.drivers.d unchanged"
fi

Wyświetl plik

@ -33,7 +33,7 @@ fi
cat <<'EOF' > $CURR_WMBS
[Unit]
Description="wmbusmeters service"
Documentation=https://github.com/weetmuts/wmbusmeters
Documentation=https://github.com/wmbusmeters/wmbusmeters
Documentation=man:wmbusmeters(1)
After=network.target
StopWhenUnneeded=false

Wyświetl plik

@ -44,6 +44,7 @@ then
postrotate
/bin/kill -HUP \`cat /run/wmbusmeters/wmbusmeters.pid 2> /dev/null\` 2> /dev/null || true
endscript
}
EOF
echo "logrotate: created $ROOT/etc/logrotate.d/wmbusmeters"
else

Wyświetl plik

@ -9,7 +9,7 @@ then
exit 0
fi
# Grab all text up to the "Version x.y.z: <date>" line
# Grab all text up to the "Version x.y.z <date>" line
# If there is no text, then we have to add some information to CHANGES
# before we make a release.
CHANGES=$(sed '/Version /q' CHANGES | grep -v ^Version | sed '/./,$!d' | \
@ -21,7 +21,7 @@ then
exit 0
fi
VERSION=$(grep -m 1 ^Version CHANGES | sed 's/Version \([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(-RC[ 0-9]\?\)\?:.*/\1 \2 \3 \4/')
VERSION=$(grep -m 1 ^Version CHANGES | sed 's/Version \([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(-RC[ 0-9]\?\)\? .*/\1 \2 \3 \4/')
MAJOR=$(echo "$VERSION" | cut -f 1 -d ' ')
MINOR=$(echo "$VERSION" | cut -f 2 -d ' ')
@ -45,18 +45,24 @@ else
# rc can only be used when the previous tag was also an rc!
if [ "$TYPE" = "rc" ] ; then echo "You must supply major,minor or patch! Not rc." ; exit 0; fi
# otherwise you supply major, minor or patch.
if [ "$TYPE" = "major" ] ; then MAJOR=$((MAJOR+1)) ; fi
if [ "$TYPE" = "minor" ] ; then MINOR=$((MINOR+1)) ; fi
if [ "$TYPE" = "major" ] ; then MAJOR=$((MAJOR+1)) ; MINOR=0 ; PATCH=0 ; fi
if [ "$TYPE" = "minor" ] ; then MINOR=$((MINOR+1)) ; PATCH=0 ; fi
if [ "$TYPE" = "patch" ] ; then PATCH=$((PATCH+1)) ; fi
RC=1
fi
RC_VERSION="$MAJOR.$MINOR.$PATCH-RC$RC"
MESSAGE="Version $RC_VERSION: $(date +'%Y-%m-%d')"
if git tag | grep -q "$RC_VERSION"
then
echo "Oups! The tag $RC_VERSION already exists! Please remove it!"
exit 0
fi
MESSAGE="Version $RC_VERSION $(date +'%Y-%m-%d')"
echo
echo "$MESSAGE"
echo "Creating release candidate >>$MESSAGE<< with changelog:"
echo "----------------------------------------------------------------------------------"
cat /tmp/release_changes
echo "----------------------------------------------------------------------------------"
@ -71,14 +77,11 @@ while true; do
done
# Insert release candidate line in CHANGES.
CMD="1 i\$MESSAGE"
CMD="1i $MESSAGE\n"
sed -i "$CMD" CHANGES
git commit -am "$MESSAGE"
git tag "$RC_VERSION"
echo "Now do: git push ; git push --tags"
#git push
#git push --tags
echo "Now do: git push --followtags"

Wyświetl plik

@ -2,5 +2,3 @@ T1;1;1;2019-04-03 19:00:42.000;97;148;88888888;0x6e4401068888888805077a85006085b
{"media":"water","meter":"apator162","name":"ApWater","id":"88888888","total_m3":4.848,"timestamp":"1111-11-11T11:11:11Z","device":"rtlwmbus[]","rssi_dbm":97}
C1;1;1;2020-01-23 10:25:13.000;97;148;76348799;0x2A442D2C998734761B168D2091D37CAC21E1D68CDAFFCD3DC452BD802913FF7B1706CA9E355D6C2701CC24
{"media":"cold water","meter":"multical21","name":"Vatten","id":"76348799","status":"DRY","total_m3":6.408,"target_m3":6.408,"flow_temperature_c":127,"external_temperature_c":19,"current_status":"DRY","time_dry":"22-31 days","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z","device":"rtlwmbus[]","rssi_dbm":97}
T1;1;1;2019-04-03 19:00:42.000;97;148;77777777;0xAE44EE4D777777773C077A4400A025E78F4A01F9DCA029EDA03BA452686E8FA917507B29E5358B52D77C111EA4C41140290523F3F6B9F9261705E041C0CA41305004605F42D6C9464E5A04EEE227510BD0DC0983C665C3A5E4739C2082975476AC637BCDD39766AEF030502B6A7697BE9E1C49AF535C15470FCF8ADA36CAB9D0B2A1A8690F8DDCF70859F18B3414D8315B311A0AFA57325531587CB7E9CC110E807F24C190D7E635BEDAF4CAE8A161
{"media":"water","meter":"supercom587","name":"Wasser","id":"77777777","total_m3":0,"timestamp":"1111-11-11T11:11:11Z","device":"rtlwmbus[]","rssi_dbm":97}

Wyświetl plik

@ -0,0 +1,5 @@
T1;1;1;2019-04-03 19:10:42.000;97;148;77777777;0x5744b40988227711101b7ab20800000265a00842658f088201659f08226589081265a0086265510852652b0902fb1aba0142fb1ab0018201fb1abd0122fb1aa90112fb1aba0162fb1aa60152fb1af501066d3b3bb36b2a00
#2019-04-03T19:10:42Z
T1;0;0;2021-12-29 13:50:57.000;11;108;99999999;0x294468505953629176f0a0009f29982b00e0982b00802e0601316acd636bcd63008dc3009ed4000fe5ff
T1;1;1;2019-04-03 19:00:42.000;97;148;88888888;0x2e44333003020100071b7a634820252f2f0265840842658308820165950802fb1aae0142fb1aae018201fb1aa9012f
#2019-04-03T19:00:42Z

Wyświetl plik

@ -60,3 +60,13 @@ telegram=|6E4401062020202705077A3D0060852F2F|0F|151794|94|0A0200|43|0403|81|D87F
telegram=|3E4401061405410305077A190030852F2F|0F|86B4B8|95|290200|40|C6C1|B4|F0F3F3|41|5559|42|FA701000|F0|01010000|10|BC780000|FFFFFFFFFFFFFFFFFFFFFF2483|
{"media":"water","meter":"apator162","name":"MyTapWaterf","id":"03410514","total_m3":30.908,"timestamp":"1111-11-11T11:11:11Z"}
|MyTapWaterf;03410514;30.908;1111-11-11 11:11.11
# Yet another
telegram=|3C4401061111441105077A280030852F2F|0F|064CB597180200|43|A0068300055A2D69610156BB0C101B1208007101A60AC5AA6DE6A5F0880E9ADD08393C|
{"id": "11441111", "media": "water", "meter": "apator162", "name": "MyTapWaterg", "timestamp": "1111-11-11T11:11:11Z", "total_m3": 528.923}
|MyTapWaterg;11441111;528.923;1111-11-11 11:11.11
# Yet another
telegram=|3E4401060403820305077A090030852F2F0F9B5B229700000044C2DED310A25500007201C64A0000853C000094310000A0464B1904FFFFFFFFFFFFFFFF2ED6|
{"id": "03820304", "media": "water", "meter": "apator162", "name": "MyTapWaterh", "timestamp": "1111-11-11T11:11:11Z", "total_m3": 21.922 }
|MyTapWaterh;03820304;21.922;1111-11-11 11:11.11

Wyświetl plik

@ -10,9 +10,9 @@ telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6_710008190000081900007
# Tets Multical21 C1 telegrams with maximum flow configuration
telegram=|2D442D2C776655441B168D2083B48D3A20_46887802FF20000004132F4E000092013B3D01A1015B028101E7FF0F03|
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
telegram=|21442D2C776655441B168D2079CC8C3A20_F4307912C40DFF00002F4E00003D010203|
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"target_m3":null,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
{"media":"cold water","meter":"multical21","name":"Vadden","id":"44556677","status":"OK","total_m3":20.015,"flow_temperature_c":2,"external_temperature_c":3,"max_flow_m3h":0.317,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}
# Test FlowIQ2200 C1 telegrams
@ -26,7 +26,7 @@ telegram=|314493441234567835087a740000200b6e2701004b6e450100426c5f2ccb086e790000
# Test another pair of QCalric C1 telegrams
telegram=|49449344939291903408780DFF5F350082180000800007B06EFFFF970000009F2C70020000BE26970000000000010018002E001F002E0023FF210008000500020000002F046D220FA227|
{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":null,"set_date":null,"consumption_at_set_date_hca":null,"set_date_1":null,"consumption_at_set_date_1_hca":null,"device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"}
{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","device_date_time":"2021-07-02 15:34","timestamp":"1111-11-11T11:11:11Z"}
telegram=|314493449392919034087a520000200b6e9700004b6e700200426c9f2ccb086e970000c2086cbe26326cffff046d2d16a227|
{"media":"heat cost allocation","meter":"qcaloric","name":"MyElement2","id":"90919293","status":"OK","current_consumption_hca":97,"set_date":"2020-12-31","consumption_at_set_date_hca":270,"set_date_1":"2020-12-31","consumption_at_set_date_1_hca":270,"set_date_17":"2021-06-30","consumption_at_set_date_17_hca":97,"error_date":"2127-15-31","device_date_time":"2021-07-02 22:45","timestamp":"1111-11-11T11:11:11Z"}
@ -55,4 +55,4 @@ telegram=|494468509494949495377286868686A85CFE07A90030052F2F_0413100000000F52FCF
# Test Zenner Minomess C1 water meter
telegram=|6644496A1064035514377251345015496A0007EE0050052F2F_0C1359000000026CBE2B82046CA12B8C0413FFFFFFFF8D0493132CFBFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02FD1700002F2F|
{"media":"water","meter":"minomess","name":"Mino","id":"15503451","meter_date":"2021-11-30","total_m3":0.059,"target_m3":244444.442,"target_date":"2021-11-01","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"minomess","name":"Mino","id":"15503451","meter_date":"2021-11-30","total_m3":0.059,"target_date":"2021-11-01","status":"OK","timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -1,7 +1,7 @@
# Test vario451 T1 telegrams with --addconversions=GJ
telegram=|374468506549235827C3A2|129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002|
# Test vario451 T1 telegrams with --calculate_total_gj=total_kwh etc
telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002|
{"media":"heat","meter":"vario451","name":"Hettan","id":"58234965","total_kwh":6371.666667,"total_gj":22.938,"current_kwh":2729.444444,"current_gj":9.826,"previous_kwh":3642.222222,"previous_gj":13.112,"timestamp":"1111-11-11T11:11:11Z"}
# Test Multical21 C1 telegrams with --addconversions=L,F
telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6|710008190000081900007F13|
# Test Multical21 C1 telegrams with --calculate_total_l=total_m3 etc
telegram=|23442D2C998734761B168D2087D19EAD217F1779EDA86AB6_710008190000081900007F13|
{"media":"cold water","meter":"multical21","name":"MyTapWater","id":"76348799","status":"DRY","total_m3":6.408,"total_l":6408,"target_m3":6.408,"target_l":6408,"flow_temperature_c":127,"flow_temperature_f":260.6,"external_temperature_c":19,"external_temperature_f":66.2,"current_status":"DRY","time_dry":"22-31 days","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -1,2 +1,2 @@
telegram=|6644242381818181640E7246564656A51170071F0050052F2F|15257A616F14139172137DAE3A0C000000008C2013917213000B3B0000000B26784601025AF5000266EF00046D1B08B7214C1338861200CC101300000000CC201338861200426C9F2C42EC7EBF2C|
{"media":"water","meter":"hydrus","name":"Vatten","id":"56465646","total_m3":114.35283,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":0,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
telegram=|6644242381818181640E7246564656A51170071F0050052F2F_15257A616F14139172137DAE3A0C000000008C2013917213000B3B0000000B26784601025AF5000266EF00046D1B08B7214C1338861200CC101300000000CC201338861200426C9F2C42EC7EBF2C|
{"media":"water","meter":"hydrus","name":"Vatten","id":"56465646","operating_time_h":14678,"meter_datetime":"2021-01-23 08:27","flow_temperature_c":24.5,"external_temperature_c":23.9,"status":"OK","total_tariff2_m3":137.291,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"flow_m3h":0,"total_at_date_m3":128.638,"at_date":"2020-12-31","timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -0,0 +1,2 @@
telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F|
telegram=|7B4479169977997730378C20F0900F002C2549EE0A0077C19D3D1A08ABCD729977997779161102F0005007102F2F#0702F5C3FA000000000007823C5407000000000000841004E081020084200415000000042938AB000004A9FF01FA0A000004A9FF02050A000004A9FF03389600002F2F2F2F2F2F2F2F2F2F2F2F2F|

Wyświetl plik

@ -6,12 +6,12 @@ telegram=|1944304C72242421D401A2|013D4013DD8B46A4999C1293E582CC|
# Test new version of IZAR
telegram=|2944A511780729662366A20118001378D3B3DB8CEDD77731F25832AAF3DA8CADF9774EA673172E8C61F2|
{"media":"water","meter":"izar","name":"IzarWater2","id":"66236629","prefix":"","serial_number":"000000","total_m3":16.76,"last_month_total_m3":11.84,"last_month_measure_date":"2019-11-30","remaining_battery_life_y":12,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"izar","name":"IzarWater2","id":"66236629","total_m3":16.76,"last_month_total_m3":11.84,"last_month_measure_date":"2019-11-30","remaining_battery_life_y":12,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"timestamp":"1111-11-11T11:11:11Z"}
# Yet another version of IZAR
telegram=|1944A511780779194820A1|21170013355F8EDB2D03C6912B1E37
{"media":"water","meter":"izar","name":"IzarWater3","id":"20481979","prefix":"","serial_number":"000000","total_m3":4.366,"last_month_total_m3":0,"last_month_measure_date":"2020-12-31","remaining_battery_life_y":11.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"izar","name":"IzarWater3","id":"20481979","total_m3":4.366,"last_month_total_m3":0,"last_month_measure_date":"2020-12-31","remaining_battery_life_y":11.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"timestamp":"1111-11-11T11:11:11Z"}
# And another izar, with a mfct specific tpl ci field a3.
@ -25,4 +25,4 @@ telegram=|1944304CDEFFE420CC01A2|63120013258F907B0AFF12529AC33B|
# Yet another version of IZAR
telegram=19442423860775035048A251520015BEB6B2E1ED623A18FC74A5
{"media":"water","meter":"izar","name":"IzarWater6","id":"48500375","prefix":"","serial_number":"000000","total_m3":521.602,"last_month_total_m3":519.147,"last_month_measure_date":"2021-11-15","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"leakage","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"izar","name":"IzarWater6","id":"48500375","total_m3":521.602,"last_month_total_m3":519.147,"last_month_measure_date":"2021-11-15","remaining_battery_life_y":9,"current_alarms":"no_alarm","previous_alarms":"leakage","transmit_period_s":8,"timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -0,0 +1,19 @@
telegram=|A244EE4D785634123C067A8F000000_0C1348550000426CE1F14C130000000082046C21298C0413330000008D04931E3A3CFE3300000033000000330000003300000033000000330000003300000033000000330000003300000033000000330000004300000034180000046D0D0B5C2B03FD6C5E150082206C5C290BFD0F0200018C4079678885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"warm water","meter":"supercom587","name":"MyWarmWater","id":"12345678","total_m3":5.548,"software_version":"010002","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|MyWarmWater;12345678;5.548;1111-11-11 11:11.11
telegram=|A244EE4D111111113C077AAC000000_0C1389490000426CE1F14C130000000082046C21298C0413010000008D04931E3A3CFE0100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000001600000031130000046D0A0C5C2B03FD6C60150082206C5C290BFD0F0200018C4079629885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"water","meter":"supercom587","name":"MyColdWater","id":"11111111","total_m3":4.989,"software_version":"010002","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|MyColdWater;11111111;4.989;1111-11-11 11:11.11
telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F|
{"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|MoreWater;12345699;7.704;0;1111-11-11 11:11.11
telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000|
{"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|WaterWater;33225544;123.529;0;1111-11-11 11:11.11
telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2020-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11776622;131;2020-02-08T02:00:00Z;1026;2019-12-31T02:00:00Z;22.44;25.51;1111-11-11 11:11.11

Wyświetl plik

@ -8,4 +8,10 @@ telegram=|6893936808007275404810C514000431270000#04786BF99F00046D040F632B0415E02
# Test ultraheat heat meter sent over mbus.
telegram=|68F8F86808007200464470A7320404270000000974040970040C0E082303000C14079519000B2D0500000B3B0808000A5B52000A5F51000A6206004C14061818004C0E490603000C7800464470891071609B102D020100DB102D0201009B103B6009009A105B78009A105F74000C22726701003C22000000007C2200000000426C01018C2006000000008C3006000000008C80100600000000CC200600000000CC300600000000CC801006000000009A115B64009A115F63009B113B5208009B112D020100BC0122000000008C010E490603008C2106000000008C3106000000008C811006000000008C011406181800046D310ACA210F21040010A0C116|
{"media":"heat","meter":"ultraheat","name":"MyUltra","id":"70444600","heat_kwh":8974.444444,"volume_m3":1995.07,"power_kw":0.5,"flow_m3h":0.808,"flow_c":52,"return_c":51,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"heat","meter":"ultraheat","name":"MyUltra","id":"70444600","heat_kwh":8974.444444,"volume_m3":1995.07,"power_kw":0.5,"flow_m3h":0.808,"flow_c":52,"return_c":51,"fabrication_no":"70444600","meter_datetime":"2022-01-10 10:49","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
# Test multical 403 heat meter sent over mbus.
telegram=|68464668084a72447744772d2c3404060000000406ce86000004ff073444020004ff08f8ce0100041411680300043B0f02000002593c19025da41104ff220000000004a5ff21c7d02700d916|
{"forward_energy_m3c": 148532,"id": "77447744","media": "heat","meter": "kamheat","name": "MyKamHeat","return_energy_m3c": 118520,"status": "OK","t1_temperature_c": 64.6,"t2_temperature_c": 45.16,"timestamp": "1111-11-11T11:11:11Z","total_energy_consumption_kwh": 34510,"total_volume_m3": 2232.49,"volume_flow_m3h": 0.527,"operating_time_h": 43489.183333}

Wyświetl plik

@ -0,0 +1,4 @@
telegram=|A244EE4D785634123C067A8F000000|0C1348550000426CE1F14C130000000082046C21298C0413330000008D04931E3A3CFE3300000033000000330000003300000033000000330000003300000033000000330000003300000033000000330000004300000034180000046D0D0B5C2B03FD6C5E150082206C5C290BFD0F0200018C4079678885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"warm water","meter":"supercom587","name":"MyWarmWater","id":"12345678","total_m3":5.548,"timestamp":"1111-11-11T11:11:11Z"}
telegram=|A244EE4D785634123C067A8F000000|0C1348560000426CE1F14C130000000082046C21298C0413330000008D04931E3A3CFE3300000033000000330000003300000033000000330000003300000033000000330000003300000033000000330000004300000034180000046D0D0B5C2B03FD6C5E150082206C5C290BFD0F0200018C4079678885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"warm water","meter":"supercom587","name":"MyWarmWater","id":"12345678","total_m3":6.548,"timestamp":"1111-11-11T11:11:11Z"}

Wyświetl plik

@ -0,0 +1,4 @@
telegram=|414493447514916746377275149167934446044D000020_0C06490000004C0600000000426CFF2CCC080611000000C2086C1F3102FD170000326CFFFF046D330F1432|
telegram=|5b44934475149167463778077975149167934446040dff5f3500823d0000810007c006ffff49000000ff2c000000001f3111000000008000800080008000800080008000800080000000000B002f02fd170000046d390d1432488408|
telegram=|414493447514916746377275149167934446044D000020_0C06490000004C0600000000426CFF2CCC080611000000C2086C1F3102FD170000326CFFFF046D330F1432|
telegram=|5b44934475149167463778077975149167934446040dff5f3500823d0000810007c006ffff49000000ff2c000000001f3111000000008000800080008000800080008000800080000000000B002f02fd170000046d390d1432488408|

Wyświetl plik

@ -8,23 +8,23 @@ telegram=|244465323251839134087a4f0000000b6e0403004b6e660300426c9e29326cffff046d
# Test another HCA from Qundis
telegram=|294465324185990401087a0080000082046c7f018b046e210300046d1a0e6f0202fdac7e012301fd0c01|
{"media":"heat cost allocation","meter":"lse_08","name":"HCA2","id":"04998541","status":"TPL_MFCT_80","set_date":"2003-01-31","consumption_at_set_date_hca":321,"device_date_time":"2003-02-15 14:26","duration_since_readout_h":2.489167,"model_version":"01","timestamp":"1111-11-11T11:11:11Z"}
{"media":"heat cost allocation","meter":"lse_08","name":"HCA2","id":"04998541","status":"UNKNOWN_80","set_date":"2003-01-31","consumption_at_set_date_hca":321,"device_date_time":"2003-02-15 14:26","duration_since_readout_h":2.489167,"model_version":"01","timestamp":"1111-11-11T11:11:11Z"}
|HCA2;04998541;2003-01-31;321;1111-11-11 11:11.11
# Test Qundis QWater5.5 S1 meter.
telegram=|2D4465327663341317077AAA0000000C13044001004C1340620000426C9F2C02BB560000326CFFFF046D180DA924|
{"media":"water","meter":"lse_07_17","name":"QW","id":"13346376","total_m3":14.004,"due_date_m3":6.24,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-04-09 13:24","timestamp":"1111-11-11T11:11:11Z"}
|QW;13346376;14.004000;6.240000;2020-12-31;OK;2127-15-31;2021-04-09 13:24;1111-11-11 11:11.11
|QW;13346376;14.004;6.24;2020-12-31;OK;2127-15-31;2021-04-09 13:24;1111-11-11 11:11.11
# Test another Qundis QWater5.5 meter.
telegram=|2D4465321413121116077A900000000C13565906004C1336400600426C9F2C02BB560000326CFFFF046D3405BA25|
{"media":"water","meter":"lse_07_17","name":"QWW","id":"11121314","total_m3":65.956,"due_date_m3":64.036,"due_date":"2020-12-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-05-26 05:52","timestamp":"1111-11-11T11:11:11Z"}
|QWW;11121314;65.956000;64.036000;2020-12-31;OK;2127-15-31;2021-05-26 05:52;1111-11-11 11:11.11
|QWW;11121314;65.956;64.036;2020-12-31;OK;2127-15-31;2021-05-26 05:52;1111-11-11 11:11.11
# Test yet another Qundis QWater5.5 meter.
telegram=|2D4465320877411218067A8C0000000C13122100004C1300000000426CFFFF02BB560000326CFFFF046D2104BC2B|
{"media":"warm water","meter":"lse_07_17","name":"QWWW","id":"12417708","total_m3":2.112,"due_date_m3":0,"due_date":"2127-15-31","error_code":"OK","error_date":"2127-15-31","device_date_time":"2021-11-28 04:33","timestamp":"1111-11-11T11:11:11Z"}
|QWWW;12417708;2.112000;0.000000;2127-15-31;OK;2127-15-31;2021-11-28 04:33;1111-11-11 11:11.11
|QWWW;12417708;2.112;0;2127-15-31;OK;2127-15-31;2021-11-28 04:33;1111-11-11 11:11.11

Wyświetl plik

@ -1,12 +1,12 @@
# Test Supercom587 T1 telegrams
telegram=|A244EE4D785634123C067A8F000000_0C1348550000426CE1F14C130000000082046C21298C0413330000008D04931E3A3CFE3300000033000000330000003300000033000000330000003300000033000000330000003300000033000000330000004300000034180000046D0D0B5C2B03FD6C5E150082206C5C290BFD0F0200018C4079678885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"warm water","meter":"supercom587","name":"MyWarmWater","id":"12345678","total_m3":5.548,"timestamp":"1111-11-11T11:11:11Z"}
|MyWarmWater;12345678;5.548000;1111-11-11 11:11.11
{"media":"warm water","meter":"supercom587","name":"MyWarmWater","id":"12345678","total_m3":5.548,"software_version":"010002","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|MyWarmWater;12345678;5.548;1111-11-11 11:11.11
telegram=|A244EE4D111111113C077AAC000000_0C1389490000426CE1F14C130000000082046C21298C0413010000008D04931E3A3CFE0100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000001600000031130000046D0A0C5C2B03FD6C60150082206C5C290BFD0F0200018C4079629885238310FD3100000082106C01018110FD610002FD66020002FD170000|
{"media":"water","meter":"supercom587","name":"MyColdWater","id":"11111111","total_m3":4.989,"timestamp":"1111-11-11T11:11:11Z"}
|MyColdWater;11111111;4.989000;1111-11-11 11:11.11
{"media":"water","meter":"supercom587","name":"MyColdWater","id":"11111111","total_m3":4.989,"software_version":"010002","status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|MyColdWater;11111111;4.989;1111-11-11 11:11.11
# Test Sontex868 T1 telegram
@ -18,24 +18,24 @@ telegram=|AF46EE4D2827282716087A80000000_046D040A9F2A036E000000426CE1F7436E00000
telegram=|1E44AE4C9956341268077A36001000_2F2F0413181E0000023B00002F2F2F2F|
{"media":"water","meter":"iperl","name":"MoreWater","id":"12345699","total_m3":7.704,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|MoreWater;12345699;7.704000;0.000000;1111-11-11 11:11.11
|MoreWater;12345699;7.704;0;1111-11-11 11:11.11
# Test iPerl T1 telegram not encrypted, no 2f2f markers.
telegram=|1844AE4C4455223368077A55000000_041389E20100023B0000|
{"media":"water","meter":"iperl","name":"WaterWater","id":"33225544","total_m3":123.529,"max_flow_m3h":0,"timestamp":"1111-11-11T11:11:11Z"}
|WaterWater;33225544;123.529000;0.000000;1111-11-11 11:11.11
|WaterWater;33225544;123.529;0;1111-11-11 11:11.11
# Test amiplus/apator electricity meter
telegram=|4E4401061010101002027A00004005_2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F|
{"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"voltage_at_phase_2_v":null,"voltage_at_phase_3_v":null,"device_date_time":"2019-03-20 12:57:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"voltage_at_phase_1_v":236,"device_date_time":"2019-03-20 12:57:00","timestamp":"1111-11-11T11:11:11Z"}
|MyElectricity1;10101010;15694.05;0.33;7.48;0;236;null;null;null;null;null;null;null;null;1111-11-11 11:11.11
# Test amiplus/apator electricity meter with three phase voltages
telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E032022650900000E833C0000000000001B2B9647000B2B5510000BAB3C0000000AFDC9FC0135020AFDC9FC0245020AFDC9FC0339020BABC8FC100000002F2F|
{"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"device_date_time":"2021-10-12 08:07:00","total_energy_consumption_tariff_1_kwh":null,"total_energy_consumption_tariff_2_kwh":null,"total_energy_consumption_tariff_3_kwh":null,"total_energy_production_tariff_1_kwh":null,"total_energy_production_tariff_2_kwh":null,"total_energy_production_tariff_3_kwh":null,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"electricity","meter":"amiplus","name":"MyElectricity2","id":"00254358","total_energy_consumption_kwh":9652.22,"current_power_consumption_kw":1.055,"total_energy_production_kwh":0,"current_power_production_kw":0,"voltage_at_phase_1_v":235,"voltage_at_phase_2_v":245,"voltage_at_phase_3_v":239,"max_power_consumption_kw":4.796,"device_date_time":"2021-10-12 08:07:00","timestamp":"1111-11-11T11:11:11Z"}
|MyElectricity2;00254358;9652.22;1.055;0;0;235;245;239;null;null;null;null;null;null;1111-11-11 11:11.11
@ -43,14 +43,14 @@ telegram=|5E44B6105843250000027A2A005005_2F2F0C7835221400066D404708AC2A400E03202
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|2F446850313233347462A2_069F255900B029310000000306060906030609070606050509050505050407040605070500|
{"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2022-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"}
|Duschen;34333231;13.800000;8.900000;2022-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11
{"media":"warm water","meter":"mkradio3","name":"Duschen","id":"34333231","total_m3":13.8,"target_m3":8.9,"current_date":"2024-04-27T02:00:00Z","prev_date":"2018-12-31T02:00:00Z","timestamp":"1111-11-11T11:11:11Z"}
|Duschen;34333231;13.8;8.9;2024-04-27T02:00:00Z;2018-12-31T02:00:00Z;1111-11-11 11:11.11
# Test MKRadio4 T1 telegrams
telegram=|2F446850200141029562A2_06702901006017030004000300000000000000000000000000000000000000000000000000|
{"media":"warm water","meter":"mkradio4","name":"Duschagain","id":"02410120","total_m3":0.4,"target_m3":0.1,"timestamp":"1111-11-11T11:11:11Z"}
|Duschagain;02410120;0.400000;0.100000;1111-11-11 11:11.11
|Duschagain;02410120;0.4;0.1;1111-11-11 11:11.11
# Test vario451 T1 telegrams
telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF862115175552877A36F26C9AB1CB24400000004000000000004908002|
@ -60,16 +60,16 @@ telegram=|374468506549235827C3A2_129F25383300A8622600008200800A2AF86211517555287
# Test FHKV data II/III
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|31446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2022-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11776622;131.000000;2022-02-08T02:00:00Z;1026.000000;2019-12-31T02:00:00Z;22.440000;25.510000;1111-11-11 11:11.11
telegram=|34446850226677116980A0119F27020480048300C408F709143C003D341A2B0B2A0707000000000000062D114457563D71A1850000|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11776622","current_hca":131,"current_date":"2020-02-08T02:00:00Z","previous_hca":1026,"previous_date":"2019-12-31T02:00:00Z","temp_room_c":22.44,"temp_radiator_c":25.51,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11776622;131;2020-02-08T02:00:00Z;1026;2019-12-31T02:00:00Z;22.44;25.51;1111-11-11 11:11.11
# FHKV radio 4 / EHKV vario 4
# There is a problem in the decoding here, the data stored inside the telegram does not seem to properly encode/decode the year....
# We should not report a current_date with a full year, if the year is actually not part of the telegram.
telegram=|33446850341211119480A2_0F9F292D005024040011BD08380904000000070000000000000000000000000001000000000003140E|
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11111234","current_hca":4,"current_date":"2022-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11111234;4.000000;2022-02-05T02:00:00Z;45.000000;2020-12-31T02:00:00Z;22.370000;23.600000;1111-11-11 11:11.11
{"media":"heat cost allocator","meter":"fhkvdataiii","name":"Room","id":"11111234","current_hca":4,"current_date":"2021-02-05T02:00:00Z","previous_hca":45,"previous_date":"2020-12-31T02:00:00Z","temp_room_c":22.37,"temp_radiator_c":23.6,"timestamp":"1111-11-11T11:11:11Z"}
|Room;11111234;4;2021-02-05T02:00:00Z;45;2020-12-31T02:00:00Z;22.37;23.6;1111-11-11 11:11.11
# Test FHKV data IV
telegram=|4E4468507620541494087AAD004005089D86B62A329B3439873999738F82461ABDE3C7AC78692B363F3B41EB68607F9C9160F550769B065B6EA00A2E44346E29FF5DC5CB86283C69324AD33D137F6F|
@ -101,11 +101,11 @@ telegram=|2e44333003020100071b7a634820252f2f0265840842658308820165950802fb1aae01
# Test Lansen door window telegram
telegram=|2e44333005020100071d7ab54800002f2f02fd1b110002fd971d01000efd3a2200000000008e40fd3a000000000000|
{"media":"reserved","meter":"lansendw","name":"Dooro","id":"00010205","status":"CLOSED","a_counter":22,"b_counter":0,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"reserved","meter":"lansendw","name":"Dooro","id":"00010205","status":"CLOSED","a_counter":22,"b_counter":0,"error_flags": "ERROR_FLAGS_1 PERMANENT_ERROR UNKNOWN_40","timestamp":"1111-11-11T11:11:11Z"}
|Dooro;00010205;CLOSED;1111-11-11 11:11.11
telegram=|2e44333005020100071d7ab66800002f2f02fd1b550002fd971d01000efd3a2300000000008e40fd3a000000000000|
{"media":"reserved","meter":"lansendw","name":"Dooro","id":"00010205","status":"OPEN","a_counter":23,"b_counter":0,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"reserved","meter":"lansendw","name":"Dooro","id":"00010205","status":"OPEN","a_counter":23,"b_counter":0,"error_flags": "ERROR_FLAGS_1 PERMANENT_ERROR UNKNOWN_60","timestamp":"1111-11-11T11:11:11Z"}
|Dooro;00010205;OPEN;1111-11-11 11:11.11
# Test Lansen pulse counter
@ -122,18 +122,18 @@ telegram=|5744b40988227711101b7ab20800000265a00842658f088201659f08226589081265a0
# Test Hydrus water meter telegram
telegram=|4E44A5116464646470077AED004005_2F2F01FD08300C13741100007C1300000000FC101300000000FC201300000000726C00000B3B00000002FD748713025A6800C4016D3B177F2ACC011300020000|
{"media":"water","meter":"hydrus","name":"HydrusWater","id":"64646464","total_m3":1.174,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":10.4,"external_temperature_c":0,"current_date":"","total_at_date_m3":0,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2000-00-00 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":13.686516,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusWater;64646464;1.174000;0.000000;OK;1111-11-11 11:11.11
{"target_datetime": "2019-10-31 23:59","flow_m3h": 0,"flow_temperature_c": 10.4,"id": "64646464","media": "water","meter": "hydrus","name": "HydrusWater","remaining_battery_life_y": 13.686797,"status": "OK","timestamp": "1111-11-11T11:11:11Z","target_m3": 0.2,"total_m3": 1.174}
|HydrusWater;64646464;1.174;null;OK;1111-11-11 11:11.11
# Test Hydrus new version water meter telegram
telegram=|3E44A5116565656570067AFB0030052F2F_0C13503400000DFD110A383731303134423032410B3B00000002FD74DC15C4016D3B178D29CC0113313400002F2F|
{"media":"warm water","meter":"hydrus","name":"HydrusVater","id":"65656565","total_m3":3.45,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":3.431,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2020-09-13 23:59","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":15.321013,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusVater;65656565;3.450000;0.000000;OK;1111-11-11 11:11.11
{"target_datetime": "2020-09-13 23:59","customer": "A20B410178","flow_m3h": 0,"id": "65656565","media": "warm water","meter": "hydrus","name": "HydrusVater","remaining_battery_life_y": 15.321328,"status": "OK","timestamp": "1111-11-11T11:11:11Z","target_m3": 3.431,"total_m3": 3.45}
|HydrusVater;65656565;3.45;null;OK;1111-11-11 11:11.11
# Test Hydrus with default AES encryption
telegram=||6644242328001081640E7266567464A51170071F0050052C411A08674048DD6BA82A0DF79FFD401309179A893A1BE3CE8EDC50C2A45CD7AFEC3B4CE765820BE8056C124A17416C3722985FFFF7FCEB7094901AB3A16294B511B9A740C9F9911352B42A72FB3B0C|
{"media":"water","meter":"hydrus","name":"HydrusAES","id":"64745666","total_m3":137.291,"total_tariff1_m3":0,"total_tariff2_m3":137.291,"max_flow_m3h":0,"flow_temperature_c":24.5,"external_temperature_c":23.9,"current_date":"2021-01-23 08:27","total_at_date_m3":128.638,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":128.638,"at_date":"2020-12-31 00:00","actuality_duration_s":6673,"operating_time_h":14678,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusAES;64745666;137.291000;0.000000;OK;1111-11-11 11:11.11
{"actuality_duration_s": 6673,"at_date": "2020-12-31","external_temperature_c": 23.9,"flow_m3h": 0,"flow_temperature_c": 24.5,"id": "64745666","media": "water","meter": "hydrus","meter_datetime": "2021-01-23 08:27","name": "HydrusAES","operating_time_h": 14678,"status": "OK","timestamp": "1111-11-11T11:11:11Z","total_at_date_m3": 128.638,"total_m3": 137.291,"total_tariff1_at_date_m3": 0,"total_tariff1_m3": 0,"total_tariff2_at_date_m3": 128.638,"total_tariff2_m3": 137.291}
|HydrusAES;64745666;137.291;128.638;OK;1111-11-11 11:11.11
# Test BMeters HydroDigit water telegram
telegram=|4E44B4098686868613077AF0004005_2F2F0C1366380000046D27287E2A0F150E00000000C10000D10000E60000FD00000C01002F0100410100540100680100890000A00000B30000002F2F2F2F2F2F|
@ -152,7 +152,7 @@ telegram=|2E4409077272727210077AD71020052F2F_046D040D742C041377000000446D0000612
# Test Axioma W1 telegram with additional fields compared to the older q400 meter.
telegram=|5E4409077372727210077A710050052F2F_046D0110A92704130000000004933B0000000004933C00000000023B000002592A0A446D0000A12744130000000044933B0000000044933C0000000001FD74622F2F2F2F2F2F2F2F2F2F2F2F2F2F|
{"media":"water","meter":"q400","name":"AxiomaWater","id":"72727273","meter_datetime":"2021-07-09 16:01","total_m3":0,"total_forward_m3":0,"total_backward_m3":0,"flow_temperature_c":26.02,"volume_flow_m3h":0,"status":"OK","set_datetime":"2021-07-01 00:00","consumption_at_set_date_m3":0,"forward_at_set_date_m3":0,"backward_at_set_date_m3":0,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"q400","name":"AxiomaWater","id":"72727273","meter_datetime":"2021-07-09 16:01","total_m3":0,"total_forward_m3":0,"total_backward_m3":0,"flow_temperature_c":26.02,"volume_flow_m3h":0,"status":"OK","set_datetime":"2021-07-01 00:00","consumption_at_set_date_m3":0,"forward_at_set_date_m3":0,"backward_at_set_date_m3":0,"battery_pct":98,"timestamp":"1111-11-11T11:11:11Z"}
|AxiomaWater;72727273;0;1111-11-11 11:11.11
# Test electricity meter with eBZ wMB E01.
@ -164,7 +164,7 @@ telegram=|5B445A149922992202378C20F6900F002C25BC9E0000BF48954821BC508D7299229922
# static telegram
telegram=|7B4479169977997730378C208B900F002C25E4EF0A002EA98E7D58B3ADC57299779977991611028B005087102F2F#0DFD090F34302e3030562030303030303030300D790E31323334353637383839595345310DFD100AAAAAAAAAAAAAAAAAAAAA0D780E31323334353637383930594553312F2F2F2F2F2F2F2F2F2F2F|
{"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","total_energy_consumption_kwh":null,"current_power_consumption_kw":null,"total_energy_production_kwh":null,"total_energy_consumption_tariff1_kwh":null,"total_energy_consumption_tariff2_kwh":null,"current_power_consumption_phase1_kw":null,"current_power_consumption_phase2_kw":null,"current_power_consumption_phase3_kw":null,"version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"}
{"media":"electricity","meter":"esyswm","name":"Elen2","id":"77997799","fabrication_no":"1SEY0987654321","enhanced_id":"1ESY9887654321","location":"AAAAAAAAAAAAAAAAAAAA","location_hex":"AAAAAAAAAAAAAAAAAAAA","version":"00000000 V00.04","timestamp":"1111-11-11T11:11:11Z"}
|Elen2;77997799;null;null;null;null;null;null;null;null;1ESY9887654321;1111-11-11 11:11.11
# dynamic telegram
@ -182,7 +182,7 @@ telegram=|5344A8159955995502028C201D900F002C250C390000ED176BBBB1591ADB7A1D003007
telegram=|73441486DD4444000303A0_B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000|
{"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"}
|Vatten;004444dd;871.571000;1111-11-11 11:11.11
|Vatten;004444dd;871.571;1111-11-11 11:11.11
# Test older version of water meter rfmtx1
@ -193,24 +193,24 @@ telegram=|4644B4097172737405077AA5000610_1115F78184AB0F1D1E200000005904103103208
# Test waterstarm
telegram=|3944FA122162092002067A3600202567C94D48D00DC47B11213E23383DB51968A705AAFA60C60E263D50CD259D7C9A03FD0C08000002FD0B0011|
{"media":"warm water","meter":"waterstarm","name":"Woter","id":"20096221","meter_timestamp":"2020-07-30 10:40","total_m3":0.106,"total_backwards_m3":0,"current_status":"OK","meter_version":"000008","parameter_set":"1100","timestamp":"1111-11-11T11:11:11Z"}
{"media":"warm water","meter":"waterstarm","name":"Woter","id":"20096221","meter_datetime":"2020-07-30 10:40","total_m3":0.106,"total_backwards_m3":0,"current_status":"OK","status":"OK","meter_version":"000008","parameter_set":"1100","timestamp":"1111-11-11T11:11:11Z"}
|Woter;20096221;0.106;0;OK;1111-11-11 11:11.11
# Test topaseskr water meter
telegram=|4E44B40512345678F1077A310040052F2F_01FD08040C13991848004C1359423500CC101300000000CC201359423500426C7F2C0B3B00000002FD74DA10025AD300C4016D3B179F27CC011387124600|
{"media":"water","meter":"topaseskr","name":"Witer","id":"78563412","total_m3":481.899,"access_counter":4,"temperature_c":21.1,"current_flow_m3h":0,"volume_year_period_m3":354.259,"reverse_volume_year_period_m3":0,"meter_year_period_start_date":"2019-12-31","volume_month_period_m3":461.287,"meter_month_period_start_datetime":"2020-07-31 23:59","battery_y":11.811331,"timestamp":"1111-11-11T11:11:11Z"}
{"media":"water","meter":"topaseskr","name":"Witer","id":"78563412","total_m3":481.899,"access_counter":4,"temperature_c":21.1,"current_flow_m3h":0,"volume_year_period_m3":354.259,"reverse_volume_year_period_m3":0,"meter_year_period_end_date":"2019-12-31","volume_month_period_m3":461.287,"meter_month_period_end_datetime":"2020-07-31 23:59","battery_y":11.811331,"timestamp":"1111-11-11T11:11:11Z"}
|Witer;78563412;481.899;21.1;0;354.259;0;2019-12-31;461.287;2020-07-31 23:59;1111-11-11 11:11.11
# Test Ultrimis water meter
telegram=|2E4401069897969501167A4B0320052F2F_0413320C000003FD1700000044132109000004933C000000002F2F2F2F2F|+0
{"media":"cold water","meter":"ultrimis","name":"Uater","id":"95969798","total_m3":3.122,"target_m3":2.337,"current_status":"OK","total_backward_flow_m3":0,"timestamp":"1111-11-11T11:11:11Z"}
|Uater;95969798;3.122000;2.337000;OK;0.000000;1111-11-11 11:11.11
|Uater;95969798;3.122;2.337;OK;0;1111-11-11 11:11.11
# Test Sensostar 2 heat meter
telegram=|9E44C5147956341200047A7B0090052F2F_046D25248A2B04063D1F000001FD17000415265F00004406131F0000840106901E0000C40106841E0000840206841E0000C402067A1E0000840306541E0000C40306021E00008404069E1D0000C40406D71C0000840506F21B0000C40506681A00008406061E190000C40606EB1700008407061C170000C40706EE1600002F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F|
{"media":"heat","meter":"sensostar","name":"Heater","id":"12345679","meter_timestamp":"2020-11-10 04:37","total_kwh":7997,"total_water_m3":2435.8,"current_status":"OK","reporting_date":null,"energy_consumption_at_reporting_date_kwh":7955,"consumption_1_months_ago_kwh":7955,"consumption_2_months_ago_kwh":7824,"consumption_3_months_ago_kwh":7812,"consumption_4_months_ago_kwh":7812,"consumption_5_months_ago_kwh":7802,"consumption_6_months_ago_kwh":7764,"consumption_7_months_ago_kwh":7682,"consumption_8_months_ago_kwh":7582,"consumption_9_months_ago_kwh":7383,"consumption_10_months_ago_kwh":7154,"consumption_11_months_ago_kwh":6760,"consumption_12_months_ago_kwh":6430,"consumption_13_months_ago_kwh":6123,"consumption_14_months_ago_kwh":5916,"consumption_15_months_ago_kwh":5870,"timestamp":"1111-11-11T11:11:11Z"}
|Heater;12345679;7997.000000;2435.800000;OK;null;7955.000000;1111-11-11 11:11.11
{"media":"heat","meter":"sensostar","name":"Heater","id":"12345679","meter_timestamp":"2020-11-10 04:37","total_kwh":7997,"total_water_m3":2435.8,"current_status":"OK","energy_consumption_at_reporting_date_kwh":7955,"consumption_1_months_ago_kwh":7955,"consumption_2_months_ago_kwh":7824,"consumption_3_months_ago_kwh":7812,"consumption_4_months_ago_kwh":7812,"consumption_5_months_ago_kwh":7802,"consumption_6_months_ago_kwh":7764,"consumption_7_months_ago_kwh":7682,"consumption_8_months_ago_kwh":7582,"consumption_9_months_ago_kwh":7383,"consumption_10_months_ago_kwh":7154,"consumption_11_months_ago_kwh":6760,"consumption_12_months_ago_kwh":6430,"consumption_13_months_ago_kwh":6123,"consumption_14_months_ago_kwh":5916,"consumption_15_months_ago_kwh":5870,"timestamp":"1111-11-11T11:11:11Z"}
|Heater;12345679;7997;2435.8;OK;null;7955;1111-11-11 11:11.11
# Test Elster V200H water meter
telegram=|2E449215303099990D077AB50820452F2F_0C12495849004C12557545000FB10445007022C50BFFFFFFFF0000FFF000|
@ -250,13 +250,13 @@ telegram=||9e44731e17011020010278046d0813bc2104030000000084100300000000842003000
# Test Hydrometer/Diehl Metering Sharky 774 heat meter
telegram=|5E44A5112751617241047A8B0050052F2F0C0E000000000C13010000000B3B0000000C2B000000000A5A26020A5E18020B260321000AA6180000C2026CBE2BCC020E00000000CC021301000000DB023B000000DC022B000000002F2F2F2F2F|
{"media":"heat","meter":"sharky774","name":"Sharky774","id":"72615127","total_energy_consumption_kwh":0,"total_volume_m3":0.001,"volume_flow_m3h":0,"power_kw":0,"flow_temperature_c":22.6,"return_temperature_c":21.8,"temperature_difference_c":0.8,"operating_time_h":0,"energy_at_set_date_kwh":0,"set_date":"","timestamp":"1111-11-11T11:11:11Z"}
|Sharky774;72615127;0.000000;0.001000;0.000000;0.000000;22.600000;21.800000;0.800000;0.000000;1111-11-11 11:11.11
{"media":"heat","meter":"sharky774","name":"Sharky774","id":"72615127","total_energy_consumption_kwh":0,"total_volume_m3":0.001,"volume_flow_m3h":0,"power_kw":0,"flow_temperature_c":22.6,"return_temperature_c":21.8,"operating_time_h":2103,"operating_time_in_error_h":0,"timestamp":"1111-11-11T11:11:11Z"}
|Sharky774;72615127;0;null;null;1111-11-11 11:11.11
# Test Hydrometer/Diehl Metering Sharky 775 heat meter
telegram=|534424232004256092687A370045752235854DEEEA5939FAD81C25FEEF5A23C38FB9168493C563F08DB10BAF87F660FBA91296BA2397E8F4220B86D3A192FB51E0BFCF24DCE72118E0C75A9E89F43BDFE370824B|
{"media":"heat","meter":"sharky","name":"Sharky775","id":"68926025","total_energy_consumption_kwh":2651,"total_energy_consumption_tariff1_kwh":0,"total_volume_m3":150.347,"total_volume_tariff2_m3":0.018,"volume_flow_m3h":0,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"}
|Sharky775;68926025;2651.000000;0.000000;150.347000;0.018000;0.000000;0.000000;42.300000;28.100000;14.100000;1111-11-11 11:11.11
{"media":"heat","meter":"sharky","name":"Sharky775","id":"68926025","total_energy_consumption_kwh":2651,"total_energy_consumption_tariff1_kwh":0,"total_volume_m3":150.347,"total_volume_tariff2_m3":0.018,"volume_flow_m3h":0,"power_kw":0,"flow_temperature_c":42.3,"return_temperature_c":28.1,"status":"OK","temperature_difference_c":14.1,"timestamp":"1111-11-11T11:11:11Z"}
|Sharky775;68926025;2651;0;150.347;0.018;0;0;42.3;28.1;14.1;1111-11-11 11:11.11
# Test Apator Elf Heat meter
telegram=|51440186010905001837721956880101064004DA000020026CA9220E017799241103000C13641320000A2D00000A5A90060A5E800544050E77000001FD0C010A6564370AFD4731030A274907047F00000002|
@ -270,23 +270,23 @@ telegram=|1E44A511909192937B077A9F0010052F2F_04130347030002FD1700002F2F2F|
# Test IZAR RS 868 water meter
telegram=|1E4424238B07797389607A8F00107D_041312170100426CBF23441344100100|
{"media":"water","meter":"hydrus","name":"HydrusIzarRS","id":"60897379","total_m3":71.442,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":69.7,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusIzarRS;60897379;71.442000;0.000000;OK;1111-11-11 11:11.11
{"at_date": "2021-03-31","id": "60897379","media": "water","meter": "hydrus","name": "HydrusIzarRS","status": "OK","timestamp": "1111-11-11T11:11:11Z","total_at_date_m3": 69.7,"total_m3": 71.442}
|HydrusIzarRS;60897379;71.442;69.7;OK;1111-11-11 11:11.11
# Test IZAR RS 868 water meter warm
telegram=|1E4424238B06204790607A2A0010D8_0413DDC00000426CBF23441382BB0000|
{"media":"warm water","meter":"hydrus","name":"HydrusIzarRSWarm","id":"60904720","total_m3":49.373,"total_tariff1_m3":0,"total_tariff2_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":0,"current_date":"","total_at_date_m3":48.002,"total_tariff1_at_date_m3":0,"total_tariff2_at_date_m3":0,"at_date":"2021-03-31 00:00","actuality_duration_s":0,"operating_time_h":0,"remaining_battery_life_y":0,"status":"OK","timestamp":"1111-11-11T11:11:11Z"}
|HydrusIzarRSWarm;60904720;49.373000;0.000000;OK;1111-11-11 11:11.11
{"at_date": "2021-03-31","id": "60904720","media": "warm water","meter": "hydrus","name": "HydrusIzarRSWarm","status": "OK","timestamp": "1111-11-11T11:11:11Z","total_at_date_m3": 48.002,"total_m3": 49.373}
|HydrusIzarRSWarm;60904720;49.373;48.002;OK;1111-11-11 11:11.11
# Test another Diehl branded meter with the izar protocol
telegram=|19442423850798160018A2410100133EBBD44081053F243A82A3|
{"media":"water","meter":"izar","name":"IzarWater4","id":"18001698","prefix":"","serial_number":"000000","total_m3":835.689,"last_month_total_m3":820.329,"last_month_measure_date":"2021-09-01","remaining_battery_life_y":0.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"manufacture_year":"0","timestamp":"1111-11-11T11:11:11Z"}
|IzarWater4;18001698;;000000;835.689000;820.329000;2021-09-01;0.500000;no_alarm;no_alarm;8.000000;0;1111-11-11 11:11.11
{"media":"water","meter":"izar","name":"IzarWater4","id":"18001698","total_m3":835.689,"last_month_total_m3":820.329,"last_month_measure_date":"2021-09-01","remaining_battery_life_y":0.5,"current_alarms":"no_alarm","previous_alarms":"no_alarm","transmit_period_s":8,"timestamp":"1111-11-11T11:11:11Z"}
|IzarWater4;18001698;null;null;835.689;820.329;2021-09-01;0.5;no_alarm;no_alarm;8;null;1111-11-11 11:11.11
# Test Aventies Water Meter
telegram=76442104710007612507727100076121042507B5006005E2E95A3C2A1279A5415E6732679B43369FD5FDDDD783EEEBB48236D34E7C94AF0A18A5FDA5F7D64111EB42D4D891622139F2952F9D12A20088DFA4CF8123871123EE1F6C1DCEA414879DDB4E05E508F1826D7EFBA6964DF804C9261EA23BBF03
{"media":"water","meter":"aventieswm","name":"Votten","id":"61070071","total_m3":466.472,"consumption_at_set_date_1_m3":465.96,"consumption_at_set_date_2_m3":458.88,"consumption_at_set_date_3_m3":449.65,"consumption_at_set_date_4_m3":442.35,"consumption_at_set_date_5_m3":431.07,"consumption_at_set_date_6_m3":423.98,"consumption_at_set_date_7_m3":415.23,"consumption_at_set_date_8_m3":409.03,"consumption_at_set_date_9_m3":400.79,"consumption_at_set_date_10_m3":393.2,"consumption_at_set_date_11_m3":388.63,"consumption_at_set_date_12_m3":379.26,"consumption_at_set_date_13_m3":371.26,"consumption_at_set_date_14_m3":357.84,"error_flags":"","timestamp":"1111-11-11T11:11:11Z"}
|Votten;61070071;466.472000;;1111-11-11 11:11.11
{"media":"water","meter":"aventieswm","name":"Votten","id":"61070071","status":"OK","total_m3":466.472,"consumption_at_set_date_1_m3":465.96,"consumption_at_set_date_2_m3":458.88,"consumption_at_set_date_3_m3":449.65,"consumption_at_set_date_4_m3":442.35,"consumption_at_set_date_5_m3":431.07,"consumption_at_set_date_6_m3":423.98,"consumption_at_set_date_7_m3":415.23,"consumption_at_set_date_8_m3":409.03,"consumption_at_set_date_9_m3":400.79,"consumption_at_set_date_10_m3":393.2,"consumption_at_set_date_11_m3":388.63,"consumption_at_set_date_12_m3":379.26,"consumption_at_set_date_13_m3":371.26,"consumption_at_set_date_14_m3":357.84,"error_flags":"","timestamp":"1111-11-11T11:11:11Z"}
|Votten;61070071;466.472;;1111-11-11 11:11.11
# Test Unismart Gas Meter
telegram=|6044B8059430040001037A1D005085E2B670BCF1A5C87E0C1A51DA18924EF984613DA2A9CD39D8F4C7208326C76D42DBEADF80D574192B71BD7C4F56A7F1513151768A9DB804883B28CB085CA2D0F7438C361CB9E2734712ED9BFBB2A14EF55208|
@ -295,8 +295,8 @@ telegram=|6044B8059430040001037A1D005085E2B670BCF1A5C87E0C1A51DA18924EF984613DA2
# Test Hydrocal M3 heat/cooling meter
telegram=|8E44B409747372710B0D7A798080052F2F_0C0E59600100046D1D36B9290C13679947000C0E000000000C13590000000C13000000000C13000000000A5A18020A5E11020F823D06003D06003D06003D0600140600620500480400E402001601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002F2F|
{"media":"heat/cooling load","meter":"hydrocalm3","name":"HeatCool","id":"71727374","status": "TPL_MFCT_80","total_heating_kwh":4460.833333,"total_cooling_kwh":0,"device_datetime":"2021-09-25 22:29","total_heating_m3":479.967,"total_cooling_m3":0.059,"c1_volume_m3":0,"c2_volume_m3":0,"supply_temperature_c":21.8,"return_temperature_c":21.1,"timestamp":"1111-11-11T11:11:11Z"}
|HeatCool;71727374;4460.833333;2021-09-25 22:29;1111-11-11 11:11.11
{"media":"heat/cooling load","meter":"hydrocalm3","name":"HeatCool","id":"71727374","status": "SABOTAGE_ENCLOSURE","total_heating_kwh":4460.833333,"total_cooling_kwh":0,"device_datetime":"2021-09-25 22:29","total_heating_m3":479.967,"total_cooling_m3":0.059,"c1_volume_m3":0,"c2_volume_m3":0,"supply_temperature_c":21.8,"return_temperature_c":21.1,"timestamp":"1111-11-11T11:11:11Z"}
|HeatCool;71727374;4460.833333;0;1111-11-11 11:11.11
# Test Weptech Munia temperature hygrometer
telegram=|2E44B05C82340100021B7A460000002F2F0A6601020AFB1A570602FD971D00002F2F2F2F2F2F2F2F2F2F2F2F2F2F2F|

Wyświetl plik

@ -10,18 +10,18 @@ description: |
to allow snap read USB devices and check that root user of your system is
added to group that can read USB devices
base: core18
base: core22
confinement: strict
architectures:
- build-on: amd64
run-on: amd64
build-for: amd64
- build-on: arm64
run-on: arm64
build-for: arm64
- build-on: armhf
run-on: armhf
build-for: armhf
parts:
script:
@ -31,25 +31,26 @@ parts:
- launcher.sh
wmbusmeters:
source: "https://github.com/weetmuts/wmbusmeters.git"
source: "https://github.com/wmbusmeters/wmbusmeters.git"
source-type: git
override-pull: |
snapcraftctl pull
if [ -n "$(git describe --tags | grep -)" ]; then
GIT_REV="$(git describe --tags | cut -f1,2 -d'-')"
snapcraftctl set-version "$GIT_REV"
snapcraftctl set-grade devel
craftctl default
if [ -n "$(git describe --tags | grep -E -- '-[^-RC]+$')" ]; then
GIT_REV="$(git describe --tags | rev | cut -f2- -d'-' | rev)"
craftctl set version="$GIT_REV"
craftctl set grade=devel
else
GIT_VER="$(git describe --tags)"
snapcraftctl set-version "$GIT_VER"
snapcraftctl set-grade stable
craftctl set version="$GIT_VER"
craftctl set grade=stable
fi
plugin: autotools
build-packages:
- g++
- make
- librtlsdr-dev
- libncurses5-dev
- libxml2-dev
- libxslt1-dev
stage-packages:
- mosquitto-clients
- curl
@ -57,6 +58,7 @@ parts:
- sysvinit-utils
- libusb-1.0-0
- rtl-sdr
- libxml2
prime:
- sbin/
- usr/bin/
@ -68,20 +70,14 @@ parts:
rtl-wmbus:
source: "https://github.com/weetmuts/rtl-wmbus.git"
plugin: make
artifacts:
- build/rtl_wmbus
organize:
build/rtl_wmbus: usr/bin/rtl_wmbus
prime:
- usr/bin/rtl_wmbus
make-parameters:
- DESTDIR=/usr
rtl-433:
source: "https://github.com/merbanan/rtl_433.git"
plugin: cmake
organize:
bin/rtl_433: usr/bin/rtl_433
prime:
- usr/bin/rtl_433
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
apps:
wmbusmeters:
@ -92,13 +88,12 @@ apps:
- network
- network-bind
- raw-usb
- serial-port
- system-observe
layout:
/usr/bin/wmbusmeters:
bind-file: $SNAP/usr/bin/wmbusmeters
/sbin/killall5:
bind-file: $SNAP/sbin/killall5
#rtl
/usr/bin/rtl_433:
bind-file: $SNAP/usr/bin/rtl_433
@ -106,51 +101,33 @@ layout:
bind-file: $SNAP/usr/bin/rtl_sdr
/usr/bin/rtl_wmbus:
bind-file: $SNAP/usr/bin/rtl_wmbus
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librtlsdr.so.0:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librtlsdr.so.0
/lib/$SNAPCRAFT_ARCH_TRIPLET/libusb-1.0.so.0:
symlink: $SNAP/lib/$SNAPCRAFT_ARCH_TRIPLET/libusb-1.0.so.0
/usr/lib/$CRAFT_ARCH_TRIPLET/librtlsdr.so.0:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/librtlsdr.so.0
/usr/lib/$CRAFT_ARCH_TRIPLET/libusb-1.0.so.0:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libusb-1.0.so.0
#mosquitto
/usr/bin/mosquitto_pub:
bind-file: $SNAP/usr/bin/mosquitto_pub
/usr/bin/mosquitto_sub:
bind-file: $SNAP/usr/bin/mosquitto_sub
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libmosquitto.so.1:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libmosquitto.so.1
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libcares.so.2:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libcares.so.2
/usr/lib/$CRAFT_ARCH_TRIPLET/libmosquitto.so.1:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libmosquitto.so.1
/usr/lib/$CRAFT_ARCH_TRIPLET/libcjson.so.1:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libcjson.so.1
#curl
/usr/bin/curl:
bind-file: $SNAP/usr/bin/curl
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libcurl.so.4:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libcurl.so.4
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libnghttp2.so.14:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libnghttp2.so.14
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librtmp.so.1:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/librtmp.so.1
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpsl.so.5:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpsl.so.5
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libldap_r-2.4.so.2:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libldap_r-2.4.so.2
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/liblber-2.4.so.2:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/liblber-2.4.so.2
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libsasl2.so.2:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libsasl2.so.2
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libgssapi.so.3:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libgssapi.so.3
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libheimntlm.so.0:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libheimntlm.so.0
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libasn1.so.8:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libasn1.so.8
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libhcrypto.so.4:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libhcrypto.so.4
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libroken.so.18:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libroken.so.18
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libwind.so.0:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libwind.so.0
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libheimbase.so.1:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libheimbase.so.1
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libhx509.so.5:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libhx509.so.5
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libkrb5.so.26:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libkrb5.so.26
/usr/lib/$CRAFT_ARCH_TRIPLET/libcurl.so.4:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libcurl.so.4
/usr/lib/$CRAFT_ARCH_TRIPLET/libnghttp2.so.14:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libnghttp2.so.14
/usr/lib/$CRAFT_ARCH_TRIPLET/librtmp.so.1:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/librtmp.so.1
/usr/lib/$CRAFT_ARCH_TRIPLET/libpsl.so.5:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libpsl.so.5
/usr/lib/$CRAFT_ARCH_TRIPLET/libldap-2.5.so.0:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libldap-2.5.so.0
/usr/lib/$CRAFT_ARCH_TRIPLET/liblber-2.5.so.0:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/liblber-2.5.so.0
/usr/lib/$CRAFT_ARCH_TRIPLET/libsasl2.so.2:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libsasl2.so.2

656
src/address.cc 100644
Wyświetl plik

@ -0,0 +1,656 @@
/*
Copyright (C) 2017-2024 Fredrik Öhrström (gpl-3.0-or-later)
This program 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 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include"address.h"
#include"manufacturers.h"
#include<assert.h>
#include<algorithm>
#include<string.h>
using namespace std;
vector<string> splitSequenceOfAddressExpressionsAtCommas(const string& mes);
bool isValidMatchExpression(const std::string& s, bool *has_wildcard);
bool doesIdMatchExpression(const std::string& id, std::string match_rule);
bool doesAddressMatchExpressions(Address &address,
std::vector<AddressExpression>& address_expressions,
bool *used_wildcard,
bool *filtered_out,
bool *required_found,
bool *required_failed);
bool isValidMatchExpression(const string& s, bool *has_wildcard)
{
string me = s;
// Examples of valid match expressions:
// 12345678
// *
// 123*
// !12345677
// 2222222*
// !22222222
// We also accept an secondary libmbus address:
// 100002842941011B
// A match expression cannot be empty.
if (me.length() == 0) return false;
// An me can be filtered out with an exclamation mark first.
if (me.front() == '!') me.erase(0, 1);
// More than one negation is not allowed.
if (me.front() == '!') return false;
// A match expression cannot be only a negation mark.
if (me.length() == 0) return false;
int count = 0;
// Some non-compliant meters have full hex in the id,
// but according to the standard there should only be bcd here...
// We accept hex anyway.
while (me.length() > 0 &&
((me.front() >= '0' && me.front() <= '9') ||
(me.front() >= 'A' && me.front() <= 'F') ||
(me.front() >= 'a' && me.front() <= 'f')))
{
me.erase(0,1);
count++;
}
if (me.length() == 0 && count == 16)
{
// A secondary libmbus address: 100002842941011B
// Strictly speaking the leading 8 digits should be bcd,
// but we accept hex as well.
*has_wildcard = false;
return true;
}
bool wildcard_used = false;
// An expression can end with a *
if (me.length() > 0 && me.front() == '*')
{
me.erase(0,1);
wildcard_used = true;
if (has_wildcard) *has_wildcard = true;
}
// Now we should have eaten the whole expression.
if (me.length() > 0) return false;
// Check the length of the matching bcd/hex
// If no wildcard is used, then the match expression must be exactly 8 digits.
if (!wildcard_used) return count == 8;
// If wildcard is used, then the match expressions must be 7 or less digits,
// even zero is allowed which means a single *, which matches any bcd/hex id.
return count <= 7;
}
vector<string> splitSequenceOfAddressExpressionsAtCommas(const string& mes)
{
vector<string> r;
bool eof, err;
vector<uchar> v (mes.begin(), mes.end());
auto i = v.begin();
for (;;) {
auto id = eatTo(v, i, ',', 64, &eof, &err);
if (err) break;
trimWhitespace(&id);
if (id == "ANYID") id = "*";
r.push_back(id);
if (eof) break;
}
return r;
}
bool isValidSequenceOfAddressExpressions(const string& mes)
{
vector<string> v = splitSequenceOfAddressExpressionsAtCommas(mes);
for (string me : v)
{
AddressExpression ae;
if (!ae.parse(me)) return false;
}
return true;
}
vector<AddressExpression> splitAddressExpressions(const string &aes)
{
vector<string> v = splitSequenceOfAddressExpressionsAtCommas(aes);
vector<AddressExpression> r;
for (string me : v)
{
AddressExpression ae;
if (ae.parse(me))
{
r.push_back(ae);
}
}
return r;
}
bool doesIdMatchExpression(const string& s, string match)
{
string id = s;
if (id.length() == 0) return false;
// Here we assume that the match expression has been
// verified to be valid.
bool can_match = true;
// Now match bcd/hex until end of id, or '*' in match.
while (id.length() > 0 && match.length() > 0 && match.front() != '*')
{
if (id.front() != match.front())
{
// We hit a difference, it cannot match.
can_match = false;
break;
}
id.erase(0,1);
match.erase(0,1);
}
bool wildcard_used = false;
if (match.length() && match.front() == '*')
{
wildcard_used = true;
match.erase(0,1);
}
if (can_match)
{
// Ok, now the match expression should be empty.
// If wildcard is true, then the id can still have digits,
// otherwise it must also be empty.
if (wildcard_used)
{
can_match = match.length() == 0;
}
else
{
can_match = match.length() == 0 && id.length() == 0;
}
}
return can_match;
}
bool hasWildCard(const string& mes)
{
return mes.find('*') != string::npos;
}
bool AddressExpression::match(const std::string &i, uint16_t m, uchar v, uchar t)
{
if (!(mfct == 0xffff || mfct == m)) return false;
if (!(version == 0xff || version == v)) return false;
if (!(type == 0xff || type == t)) return false;
if (!doesIdMatchExpression(i, id)) return false;
return true;
}
void AddressExpression::trimToIdentity(IdentityMode im, Address &a)
{
switch (im)
{
case IdentityMode::FULL:
id = a.id;
mfct = a.mfct;
version = a.version;
type = a.type;
required = true;
break;
case IdentityMode::ID_MFCT:
id = a.id;
mfct = a.mfct;
version = 0xff;
type = 0xff;
required = true;
break;
case IdentityMode::ID:
id = a.id;
mfct = 0xffff;
version = 0xff;
type = 0xff;
required = true;
break;
default:
break;
}
}
bool AddressExpression::parse(const string &in)
{
string s = in;
// Example: 12345678
// or 12345678.M=PII.T=1B.V=01
// or 1234*
// or 1234*.M=PII
// or 1234*.V=01
// or 12 // mbus primary
// or 0 // mbus primary
// or 250.MPII.V01.T1B // mbus primary
// or !12345678
// or !*.M=ABC
// or libmbus secondary style:
// 123456782941011B
id = "";
mbus_primary = false;
mfct = 0xffff;
type = 0xff;
version = 0xff;
filter_out = false;
if (s.size() == 0) return false;
if (s.size() > 1 && s[0] == '!')
{
filter_out = true;
s = s.substr(1);
// Double ! not allowed.
if (s.size() > 1 && s[0] == '!') return false;
}
vector<string> parts = splitString(s, '.');
assert(parts.size() > 0);
id = parts[0];
if (!isValidMatchExpression(id, &has_wildcard))
{
// Not a long id, so lets check if it is p0 to p250 for primary mbus ids.
if (id.size() < 2) return false;
if (id[0] != 'p') return false;
for (size_t i=1; i < id.length(); ++i)
{
if (!isdigit(id[i])) return false;
}
// All digits good.
int v = atoi(id.c_str()+1);
if (v < 0 || v > 250) return false;
// It is 0-250 which means it is an mbus primary address.
mbus_primary = true;
}
if (parts.size() == 1 && id.length() == 16)
{
// This is a secondary libmbus address.
string mfct_hex = id.substr(8,4);
string version_hex = id.substr(12,2);
string type_hex = id.substr(14,2);
id = id.substr(0,8);
vector<uchar> data;
bool ok = hex2bin(mfct_hex.c_str(), &data);
if (!ok) return false;
if (data.size() != 2) return false;
mfct = data[1] << 8 | data[0];
data.clear();
ok = hex2bin(version_hex.c_str(), &data);
if (!ok) return false;
if (data.size() != 1) return false;
version = data[0];
data.clear();
ok = hex2bin(type_hex.c_str(), &data);
if (!ok) return false;
if (data.size() != 1) return false;
type = data[0];
return true;
}
for (size_t i=1; i<parts.size(); ++i)
{
if (parts[i].size() == 4) // V=xy or T=xy
{
if (parts[i][1] != '=') return false;
vector<uchar> data;
bool ok = hex2bin(&parts[i][2], &data);
if (!ok) return false;
if (data.size() != 1) return false;
if (parts[i][0] == 'V')
{
version = data[0];
}
else if (parts[i][0] == 'T')
{
type = data[0];
}
else
{
return false;
}
}
else if (parts[i].size() == 5) // M=xyz
{
if (parts[i][1] != '=') return false;
if (parts[i][0] != 'M') return false;
bool ok = flagToManufacturer(&parts[i][2], &mfct);
if (!ok) return false;
}
else if (parts[i].size() == 6) // M=abcd explicit hex version
{
if (parts[i][1] != '=') return false;
if (parts[i][0] != 'M') return false;
vector<uchar> data;
bool ok = hex2bin(&parts[i][2], &data);
if (!ok) return false;
if (data.size() != 2) return false;
mfct = data[1] << 8 | data[0];
if (!ok) return false;
}
else
{
return false;
}
}
return true;
}
bool flagToManufacturer(const char *s, uint16_t *out_mfct)
{
if (s[0] == 0 || s[1] == 0 || s[2] == 0 || s[3] != 0) return false;
if (s[0] < '@' || s[0] > 'Z' ||
s[1] < '@' || s[1] > 'Z' ||
s[2] < '@' || s[2] > 'Z') return false;
*out_mfct = MANFCODE(s[0],s[1],s[2]);
return true;
}
string AddressExpression::str()
{
string s;
if (filter_out) s = "!";
if (required) s = "R";
s.append(id);
if (mfct != 0xffff)
{
s += ".M="+manufacturerFlag(mfct);
}
if (version != 0xff)
{
s += ".V="+tostrprintf("%02x", version);
}
if (type != 0xff)
{
s += ".T="+tostrprintf("%02x", type);
}
return s;
}
string Address::str()
{
string s;
s.append(id);
if (mfct != 0xffff)
{
s += ".M="+manufacturerFlag(mfct);
}
if (version != 0xff)
{
s += ".V="+tostrprintf("%02x", version);
}
if (type != 0xff)
{
s += ".T="+tostrprintf("%02x", type);
}
return s;
}
string Address::concat(std::vector<Address> &addresses)
{
string s;
for (Address& a: addresses)
{
if (s.size() > 0) s.append(",");
s.append(a.str());
}
return s;
}
string AddressExpression::concat(std::vector<AddressExpression> &address_expressions)
{
string s;
for (AddressExpression& a: address_expressions)
{
if (s.size() > 0) s.append(",");
s.append(a.str());
}
return s;
}
string manufacturerFlag(int m_field) {
char a = (m_field/1024)%32+64;
char b = (m_field/32)%32+64;
char c = (m_field)%32+64;
string flag;
flag += a;
flag += b;
flag += c;
return flag;
}
void Address::decodeMfctFirst(const vector<uchar>::iterator &pos)
{
mfct = *(pos+1) << 8 | *(pos+0);
id = tostrprintf("%02x%02x%02x%02x", *(pos+5), *(pos+4), *(pos+3), *(pos+2));
version = *(pos+6);
type = *(pos+7);
}
void Address::decodeIdFirst(const vector<uchar>::iterator &pos)
{
id = tostrprintf("%02x%02x%02x%02x", *(pos+3), *(pos+2), *(pos+1), *(pos+0));
mfct = *(pos+5) << 8 | *(pos+4);
version = *(pos+6);
type = *(pos+7);
}
bool doesTelegramMatchExpressions(std::vector<Address> &addresses,
std::vector<AddressExpression>& address_expressions,
bool *used_wildcard)
{
bool match = false;
bool filtered_out = false;
bool required_found = false; // An R12345678 field was found.
bool required_failed = true; // Init to fail, set to true if R is satistifed anywhere.
for (Address &a : addresses)
{
if (doesAddressMatchExpressions(a,
address_expressions,
used_wildcard,
&filtered_out,
&required_found,
&required_failed))
{
match = true;
}
// Go through all ids even though there is an early match.
// This way we can see if theres an exact match later.
}
// If any expression triggered a filter out, then the whole telegram does not match.
if (filtered_out) match = false;
// If a required field was found and it failed....
if (required_found && required_failed) match = false;
return match;
}
bool doesAddressMatchExpressions(Address &address,
vector<AddressExpression>& address_expressions,
bool *used_wildcard,
bool *filtered_out,
bool *required_found,
bool *required_failed)
{
bool found_match = false;
bool found_negative_match = false;
bool exact_match = false;
// Goes through all possible match expressions.
// If no expression matches, neither positive nor negative,
// then the result is false. (ie no match)
// If more than one positive match is found, and no negative,
// then the result is true.
// If more than one negative match is found, irrespective
// if there is any positive matches or not, then the result is false.
// If a positive match is found, using a wildcard not any exact match,
// then *used_wildcard is set to true.
// If an expression is required and it fails, then the match fails.
for (AddressExpression &ae : address_expressions)
{
bool has_wildcard = ae.has_wildcard;
bool is_negative_rule = ae.filter_out;
// We currently assume that only a single expression is required, the last one!
bool is_required = ae.required;
if (is_required) *required_found = true;
bool m = ae.match(address.id, address.mfct, address.version, address.type);
if (is_negative_rule)
{
if (m) found_negative_match = true;
}
else
{
if (m)
{
// A match, but the required does not count.
if (!is_required)
{
found_match = true;
if (!has_wildcard)
{
exact_match = true;
}
}
else
{
*required_failed = false;
}
}
}
}
if (found_negative_match)
{
*filtered_out = true;
return false;
}
if (found_match)
{
if (exact_match)
{
*used_wildcard = false;
}
else
{
*used_wildcard = true;
}
return true;
}
return false;
}
const char *toString(IdentityMode im)
{
switch (im)
{
case IdentityMode::ID: return "id";
case IdentityMode::ID_MFCT: return "id-mfct";
case IdentityMode::FULL: return "full";
case IdentityMode::NONE: return "none";
case IdentityMode::INVALID: return "invalid";
}
return "?";
}
IdentityMode toIdentityMode(const char *s)
{
if (!strcmp(s,"id")) return IdentityMode::ID;
if (!strcmp(s,"id-mfct")) return IdentityMode::ID_MFCT;
if (!strcmp(s, "full")) return IdentityMode::FULL;
if (!strcmp(s, "none")) return IdentityMode::NONE;
return IdentityMode::INVALID;
}
void AddressExpression::clear()
{
id = "";
has_wildcard = false;
mbus_primary = false;
mfct = 0xffff;
version = 0xff;
type = 0xff;
}
void AddressExpression::appendIdentity(IdentityMode im,
AddressExpression *identity_expression,
std::vector<Address> &as,
std::vector<AddressExpression> &es)
{
identity_expression->clear();
if (im == IdentityMode::NONE) return;
// Copy id, id-mfct, id-mfct-v-t to identity_expression from the last address.
identity_expression->trimToIdentity(im, as.back());
// Is this identity expression already in the list of address expressions?
if (std::find(es.begin(), es.end(), *identity_expression) == es.end())
{
// No, then add it at the end.
es.push_back(*identity_expression);
}
}
bool AddressExpression::operator==(const AddressExpression&ae) const
{
return id == ae.id &&
has_wildcard == ae.has_wildcard&&
mbus_primary == ae.mbus_primary &&
mfct == ae.mfct &&
version == ae.version &&
type == ae.type &&
filter_out == ae.filter_out;
}

117
src/address.h 100644
Wyświetl plik

@ -0,0 +1,117 @@
/*
Copyright (C) 2017-2022 Fredrik Öhrström (gpl-3.0-or-later)
This program 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 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADDRESS_H_
#define ADDRESS_H_
#include "util.h"
#include <string>
/**
IdentityMode:
@ID: The default, only the id groups the meter content.
@ID_MFCT: Used when you have two meters with the same id but different manufacturers.
@FULL: Used when you want to fully separate meter content on id.mft.v.t
@NONE: Do not separate any meters! This might lead to telegrams overwriting each others state.
Use this when no state is to be kept in the wmbusmeters object.
@INVALID: Cannot parse cmdline.
*/
enum class IdentityMode
{
ID,
ID_MFCT,
FULL,
NONE,
INVALID
};
const char *toString(IdentityMode im);
IdentityMode toIdentityMode(const char *s);
struct Address
{
std::string id; // p1 or 12345678 or non-compliant hex: 1234abcd
uint16_t mfct {};
uchar type {};
uchar version {};
void decodeMfctFirst(const std::vector<uchar>::iterator &pos);
void decodeIdFirst(const std::vector<uchar>::iterator &pos);
std::string str();
static std::string concat(std::vector<Address> &addresses);
};
struct AddressExpression
{
// An address expression is used to select which telegrams to decode for a driver.
// An address expression is also used to select a specific meter to poll for data.
// Example address: 12345678
// Or fully qualified: 12345678.M=PII.T=1b.V=01
// which means manufacturer triplet PII, type/media=0x1b, version=0x01
// Or wildcards in id: 12*.T=16
// which matches all cold water meters whose ids start with 12.
// Or negated tests: 12345678.V!=66
// which will decode all telegrams from 12345678 except those where the version is 0x66.
// Or every telegram which is does not start with 12 and is not from ABB:
// !12*.M!=ABB
std::string id; // p1 or 12345678 or non-compliant hex: 1234abcd
bool has_wildcard {}; // The id contains a *
bool mbus_primary {}; // Signals that the id is 0-250
uint16_t mfct { 0xffff }; // If 0xffff then any mfct matches this address.
uchar version { 0xff }; // If 0xff then any version matches this address.
uchar type { 0xff }; // If 0xff then any type matches this address.
bool filter_out {}; // Telegrams matching this rule should be filtered out!
bool required {}; // If true, then this address expression must be matched!
AddressExpression() {}
AddressExpression(Address &a) : id(a.id), mfct(a.mfct), version(a.version), type(a.type) { }
bool operator==(const AddressExpression&) const;
void clear();
void trimToIdentity(IdentityMode im, Address &a);
bool parse(const std::string &s);
bool match(const std::string &id, uint16_t mfct, uchar version, uchar type);
std::string str();
static std::string concat(std::vector<AddressExpression> &address_expressions);
static void appendIdentity(IdentityMode im,
AddressExpression *identity_expression,
std::vector<Address> &as,
std::vector<AddressExpression> &es);
};
/**
isValidSequenceOfAddressExpressions:
Valid sequenes look like this:
12345678
12345678,22334455,34*
12*.T=16,!*.M=XYZ
!*.V=33
*/
bool isValidSequenceOfAddressExpressions(const std::string& s);
std::vector<AddressExpression> splitAddressExpressions(const std::string &aes);
bool flagToManufacturer(const char *s, uint16_t *out_mfct);
std::string manufacturerFlag(int m_field);
bool doesTelegramMatchExpressions(std::vector<Address> &addresses,
std::vector<AddressExpression>& address_expressions,
bool *used_wildcard);
#endif

Wyświetl plik

@ -1,466 +0,0 @@
/*
Copyright (C) 2017-2022 Fredrik Öhrström (gpl-3.0-or-later)
This program 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 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<syslog.h>
#include<time.h>
#include"serial.h"
#include"shell.h"
#include"ui.h"
#include"util.h"
#include"wmbus.h"
bool running_as_root_ = false;
bool member_of_dialout_ = false;
#define LIST_OF_MAIN_MENU \
X(DETECT_WMBUS_RECEIVERS, "Detect wmbus receiver") \
X(RESET_WMBUS_RECEIVERS, "Reset wmbus receiver") \
X(LISTEN_FOR_METERS, "Listen for meters") \
X(EDIT_CONFIG, "Edit config") \
X(EDIT_METERS, "Edit meters") \
X(STOP_DAEMON, "Stop daemon") \
X(START_DAEMON, "Start daemon") \
X(EXIT_ADMIN, "Exit")
enum class MainMenuType {
#define X(name,description) name,
LIST_OF_MAIN_MENU
#undef X
};
const char *main_menu[] = {
#define X(name,description) description,
LIST_OF_MAIN_MENU
#undef X
(char *)NULL,
};
#define LIST_OF_WMBUS_RECEIVERS \
X(AMB8465, "amb8465") \
X(CUL, "cul") \
X(IM871A, "im871a") \
X(RC1180, "rc1180") \
X(IU880B, "iu880b")
enum class ReceiversType {
#define X(name,description) name,
LIST_OF_WMBUS_RECEIVERS
#undef X
};
const char *receivers_menu[] = {
#define X(name,description) description,
LIST_OF_WMBUS_RECEIVERS
#undef X
(char *)NULL,
};
bool detectIfRoot();
string userName();
bool detectIfMemberOfGroup(string group);
void detectWMBUSReceiver();
void resetWMBUSReceiver();
void probeFor(string type, AccessCheck(*func)(Detected*,shared_ptr<SerialCommunicationManager>));
void stopDaemon();
void startDaemon();
shared_ptr<SerialCommunicationManager> handler;
WINDOW *status_window;
WINDOW *serial_ports_window;
WINDOW *processes_window;
void alwaysOnScreen();
int main(int argc, char **argv)
{
if (argc == 2 && (!strcmp(argv[1], "--debug") || !strcmp(argv[1], "--trace")))
{
if (!strcmp(argv[1], "--trace")) traceEnabled(true); else debugEnabled(true);
setlogmask(LOG_UPTO (LOG_INFO));
openlog("wmbusmeters-admin", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
enableSyslog();
}
// Handle exit on signals...
onExit(exitUI);
initUI();
clear();
/*
refresh();
int x=0;
int y=0;
for (int i=0;i<10; ++i) {
printAt(stdscr, y, x, "HEJSAN", COLOR_PAIR(BG_PAIR));
y++;
x++;
};
refresh();
for(;;) {}
endwin();
return 0;
*/
running_as_root_ = detectIfRoot();
member_of_dialout_ = detectIfMemberOfGroup("dialout");
handler = createSerialCommunicationManager(0, 0);
initUI();
bool running = true;
registerUpdateCB(alwaysOnScreen);
alwaysOnScreen();
do
{
int c = selectFromMenu("wmbusmeters admin", main_menu);
switch (static_cast<MainMenuType>(c))
{
case MainMenuType::DETECT_WMBUS_RECEIVERS:
detectWMBUSReceiver();
break;
case MainMenuType::RESET_WMBUS_RECEIVERS:
resetWMBUSReceiver();
break;
case MainMenuType::LISTEN_FOR_METERS:
notImplementedYet("Listen for meters");
break;
case MainMenuType::EDIT_CONFIG:
notImplementedYet("Edit config");
break;
case MainMenuType::EDIT_METERS:
notImplementedYet("Edit meters");
break;
case MainMenuType::STOP_DAEMON:
stopDaemon();
break;
case MainMenuType::START_DAEMON:
startDaemon();
break;
case MainMenuType::EXIT_ADMIN:
running = false;
break;
}
} while (running);
exitUI();
}
void alwaysOnScreen()
{
vector<string> info;
if (member_of_dialout_ == false)
{
info.push_back("Not member of dialout!");
}
vector<int> daemons;
detectProcesses("wmbusmetersd", &daemons);
if (daemons.size() == 0)
{
info.push_back("No daemons running.");
}
else
{
for (int i : daemons)
{
info.push_back("Daemon "+to_string(i));
}
}
vector<int> processes;
detectProcesses("wmbusmeters", &processes);
if (processes.size() == 0)
{
}
else
{
for (int i : processes)
{
info.push_back("Process "+to_string(i));
}
}
vector<string> status;
time_t now = time(NULL);
struct tm nowt {};
localtime_r(&now, &nowt);
status.push_back("wmbusmeters-admin");
status.push_back(strdatetimesec(&nowt));
string name = "["+userName()+"]";
status.push_back(name);
displayStatusLineNoWait(&status_window, status, 0, 0);
displayInformationNoWait(&status_window, "Problems", info, 2, 2);
vector<string> devices = handler->listSerialTTYs();
if (devices.size() == 0)
{
devices.push_back("No serial ports found!");
}
//info.insert(info.end(), devices.begin(), devices.end());
displayInformationNoWait(&serial_ports_window, "Serial ports", devices, 1, 15);
erase();
wrefresh(status_window);
wrefresh(serial_ports_window);
}
void detectWMBUSReceiver()
{
int c = selectFromMenu("Select your wmbus radio device", receivers_menu);
switch (static_cast<ReceiversType>(c))
{
/* case ReceiversType::AMB3665:
probeFor("amb3665", detectAMB3665);
break;*/
case ReceiversType::AMB8465:
probeFor("amb8465/amb3665", detectAMB8465AMB3665);
break;
case ReceiversType::CUL:
probeFor("cul", detectCUL);
break;
case ReceiversType::IM871A:
probeFor("im871a/im170a", detectIM871AIM170A);
break;
case ReceiversType::IU880B:
probeFor("iu880b", detectIU880B);
break;
case ReceiversType::RC1180:
probeFor("rc1180", detectRC1180);
break;
}
}
void resetWMBUSReceiver()
{
int c = selectFromMenu("Select your wmbus radio device", receivers_menu);
switch (static_cast<ReceiversType>(c))
{
/*
case ReceiversType::AMB3665:
{
vector<string> devices = handler->listSerialTTYs();
if (devices.size() == 0)
{
vector<string> entries;
displayInformationAndWait("No serial ports!", entries);
return;
}
int c = selectFromMenu("Select device", devices);
string device = devices[c];
int was_baud = 0;
AccessCheck ac = factoryResetAMB3665(device, handler, &was_baud);
if (ac == AccessCheck::AccessOK)
{
vector<string> entries;
entries.push_back("amb3665 "+device+" using "+to_string(was_baud));
displayInformationAndWait("Factory reset successful", entries);
}
else
{
vector<string> entries;
entries.push_back(device);
displayInformationAndWait("No amb3665 response from", entries);
}
break;
}*/
case ReceiversType::AMB8465:
{
vector<string> devices = handler->listSerialTTYs();
if (devices.size() == 0)
{
vector<string> entries;
displayInformationAndWait("No serial ports!", entries);
return;
}
int c = selectFromMenu("Select device", devices);
string device = devices[c];
int was_baud = 0;
AccessCheck ac = factoryResetAMB8465(device, handler, &was_baud);
if (ac == AccessCheck::AccessOK)
{
vector<string> entries;
entries.push_back("amb8465 "+device+" using "+to_string(was_baud));
displayInformationAndWait("Factory reset successful", entries);
}
else
{
vector<string> entries;
entries.push_back(device);
displayInformationAndWait("No amb8465 response from", entries);
}
break;
}
case ReceiversType::CUL:
notImplementedYet("Resetting cul");
break;
case ReceiversType::IM871A:
notImplementedYet("Resetting im871a");
break;
case ReceiversType::RC1180:
notImplementedYet("Resetting RC1180");
break;
case ReceiversType::IU880B:
notImplementedYet("Resetting IU880B");
break;
}
}
void probeFor(string type, AccessCheck (*probe)(Detected*,shared_ptr<SerialCommunicationManager>))
{
Detected detected {};
vector<string> devices = handler->listSerialTTYs();
vector<string> entries;
for (string& device : devices)
{
string tty = "?";
AccessCheck ac = handler->checkAccess(device,
handler,
type,
[&](string d, shared_ptr<SerialCommunicationManager> m){
detected.found_file=d;
detected.specified_device.file=d; return probe(&detected, m);});
if (ac == AccessCheck::AccessOK)
{
tty = device+" DETECTED "+type;
}
else if (ac == AccessCheck::NoSuchDevice)
{
tty = device+" no such device";
}
else if (ac == AccessCheck::NoProperResponse)
{
tty = device+" no response";
}
else if (ac == AccessCheck::NotSameGroup)
{
tty = device+" not same group";
}
else if (ac == AccessCheck::NoPermission)
{
tty = device+" same group but wrong permissions";
}
entries.push_back(tty);
}
if (entries.size() == 0)
{
entries.push_back("No serial devices found.");
}
displayInformationAndWait("Probed serial devices", entries);
}
bool detectIfRoot()
{
vector<string> args;
vector<string> envs;
args.push_back("-u");
string out;
invokeShellCaptureOutput("/usr/bin/id", args, envs, &out, true);
return out == "0\n";
}
string userName()
{
vector<string> args;
vector<string> envs;
args.push_back("-u");
args.push_back("-n");
string out;
invokeShellCaptureOutput("/usr/bin/id", args, envs, &out, true);
return out;
}
bool detectIfMemberOfGroup(string group)
{
vector<string> args;
vector<string> envs;
string out;
invokeShellCaptureOutput("/usr/bin/groups", args, envs, &out, true);
out = out+" "; // Guarantee that the line ends with space.
size_t p = out.find(group+" ");
if (p == 0) return true;
p = out.find(" "+group+" ");
if (p != string::npos) return true;
return false;
}
void stopDaemon()
{
vector<string> info;
info.push_back("Enter sudo password to execute:");
info.push_back("systemctl stop wmbusmeters");
debug("(passowrd) calling inputfield\n");
string pwd = inputField("Stop daemon", info, "Password");
debug("(passowrd) GOT %s\n", pwd.c_str());
//string pwd = displayInformationAndInput("Stop daemon", info, 1, 1);
//vector<string> args;
//vector<string> envs;
//args.push_back("gurka");
// string out;
// invokeShellCaptureOutput("systemctl stop wmbusmeters", args, envs, &out, true);
}
void startDaemon()
{
}
/*
static char* trim_whitespaces(char *str)
{
char *end;
// trim leading space
while(isspace(*str))
str++;
if(*str == 0) // all spaces?
return str;
// trim trailing space
end = str + strnlen(str, 128) - 1;
while(end > str && isspace(*end))
end--;
// write new null terminator
*(end+1) = '\0';
return str;
}
*/

Wyświetl plik

@ -25,7 +25,6 @@
#include"shell.h"
#include"threads.h"
#include"util.h"
#include"version.h"
#include"wmbus.h"
#include <algorithm>
@ -426,7 +425,7 @@ void BusManager::detectAndConfigureWmbusDevices(Configuration *config, Detection
specified_device.handled = true;
continue;
}
if (specified_device.file != "" && dt == DetectionType::STDIN_FILE_SIMULATION)
if (specified_device.file != "")
{
shared_ptr<SerialDevice> sd = serial_manager_->lookup(specified_device.file);
if (sd != NULL)

Wyświetl plik

@ -75,7 +75,6 @@ private:
// Then check if the rtl_sdr and/or rtl_wmbus and/or rtl_433 is available.
bool rtlsdr_found_ = false;
bool rtlwmbus_found_ = false;
bool rtl433_found_ = false;
// Remember devices that were not detected as wmbus devices.
// To avoid probing them again and again.

Wyświetl plik

@ -16,6 +16,7 @@
*/
#include"cmdline.h"
#include"drivers.h"
#include"meters.h"
#include"util.h"
@ -59,27 +60,58 @@ shared_ptr<Configuration> parseCommandLine(int argc, char **argv)
return parseNormalCommandLine(c, argc, argv);
}
void enableEarlyLoggingFromCommandLine(int argc, char **argv)
{
int i = 1;
// First find all logging flags, --silent --verbose --normal --debug
while (argv[i] && argv[i][0] == '-')
{
if (!strcmp(argv[i], "--silent")) {
i++;
silentLogging(true);
continue;
}
if (!strcmp(argv[i], "--verbose")) {
verboseEnabled(true);
i++;
continue;
}
if (!strcmp(argv[i], "--normal")) {
i++;
continue;
}
if (!strcmp(argv[i], "--debug")) {
verboseEnabled(true);
debugEnabled(true);
i++;
continue;
}
if (!strcmp(argv[i], "--trace")) {
verboseEnabled(true);
debugEnabled(true);
traceEnabled(true);
i++;
continue;
}
i++;
}
}
static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int argc, char **argv)
{
int i = 1;
// First find all logging flags, --silent --verbose --normal --debug
while (argv[i] && argv[i][0] == '-')
{
if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-help") || !strcmp(argv[i], "--help")) {
c->need_help = true;
return shared_ptr<Configuration>(c);
}
if (!strncmp(argv[i], "--device=", 9) || // Deprecated
!strncmp(argv[i], "--overridedevice=", 17))
{
error("You can only use --overridedevice=xyz with --useconfig=xyz\n");
}
if (!strcmp(argv[i], "--silent")) {
c->silent = true;
i++;
silentLogging(true);
continue;
}
if (!strcmp(argv[i], "--verbose")) {
c->verbose = true;
verboseEnabled(true);
i++;
continue;
}
@ -91,6 +123,48 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
i++;
continue;
}
if (!strcmp(argv[i], "--debug")) {
c->debug = true;
verboseEnabled(true);
debugEnabled(true);
i++;
continue;
}
if (!strcmp(argv[i], "--trace")) {
c->debug = true;
c->trace = true;
verboseEnabled(true);
debugEnabled(true);
traceEnabled(true);
i++;
continue;
}
i++;
}
// Now do the rest of the arguments.
i = 1;
while (argv[i] && argv[i][0] == '-')
{
if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-help") || !strcmp(argv[i], "--help")) {
c->need_help = true;
return shared_ptr<Configuration>(c);
}
if (!strcmp(argv[i], "--silent") ||
!strcmp(argv[i], "--verbose") ||
!strcmp(argv[i], "--normal") ||
!strcmp(argv[i], "--debug") ||
!strcmp(argv[i], "--trace"))
{
// Handled already.
i++;
continue;
}
if (!strncmp(argv[i], "--device=", 9) || // Deprecated
!strncmp(argv[i], "--overridedevice=", 17))
{
error("You can only use --overridedevice=xyz with --useconfig=xyz\n");
}
if (!strcmp(argv[i], "--version")) {
c->version = true;
return shared_ptr<Configuration>(c);
@ -162,18 +236,6 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
i++;
continue;
}
if (!strcmp(argv[i], "--debug")) {
c->debug = true;
i++;
continue;
}
if (!strcmp(argv[i], "--trace")) {
c->debug = true;
c->trace = true;
i++;
continue;
}
if (!strncmp(argv[i], "--logtimestamps=", 16))
{
string ts = string(argv[i]+16);
@ -451,6 +513,15 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
i++;
continue;
}
if (!strncmp(argv[i], "--metershell=", 13)) {
string cmd = string(argv[i]+13);
if (cmd == "") {
error("The meter shell command cannot be empty.\n");
}
c->meter_shells.push_back(cmd);
i++;
continue;
}
if (!strncmp(argv[i], "--alarmshell=", 13)) {
string cmd = string(argv[i]+13);
if (cmd == "") {
@ -546,6 +617,15 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
i++;
continue;
}
if (!strncmp(argv[i], "--identitymode=", 15) && strlen(argv[i]) > 15) {
c->identity_mode = toIdentityMode(argv[i]+15);
if (c->identity_mode == IdentityMode::INVALID)
{
error("Not a valid identity mode. \"%s\"\n", argv[i]+15);
}
i++;
continue;
}
if (!strncmp(argv[i], "--resetafter=", 13) && strlen(argv[i]) > 13) {
c->resetafter = parseTime(argv[i]+13);
if (c->resetafter <= 0) {
@ -572,6 +652,31 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
i++;
continue;
}
if (!strncmp(argv[i], "--driversdir=", 13))
{
size_t len = strlen(argv[i]) - 13;
c->drivers_dir = string(argv[i]+13, len);
if (!checkIfDirExists(c->drivers_dir.c_str()))
{
error("You must supply a valid directory to --driversdir=<dir>\n");
}
i++;
loadDriversFromDir(c->drivers_dir);
continue;
}
if (!strncmp(argv[i], "--driver=", 9))
{
size_t len = strlen(argv[i]) - 9;
string file_name = string(argv[i]+9, len);
if (!checkFileExists(file_name.c_str()))
{
error("You must supply a valid file to --driver=<file>\n");
}
i++;
loadDriver(file_name, NULL);
continue;
}
error("Unknown option \"%s\"\n", argv[i]);
}
@ -632,50 +737,31 @@ static shared_ptr<Configuration> parseNormalCommandLine(Configuration *c, int ar
string bus;
string name = argv[m*4+i+0];
string driver = argv[m*4+i+1];
string id = argv[m*4+i+2];
string address_expressions = argv[m*4+i+2];
string key = argv[m*4+i+3];
MeterInfo mi;
mi.parse(name, driver, id, key);
if (!isValidSequenceOfAddressExpressions(address_expressions))
{
error("Not a valid meter id nor a valid sequence of match expression \"%s\"\n", address_expressions.c_str());
}
mi.parse(name, driver, address_expressions, key);
mi.poll_interval = c->pollinterval;
mi.identity_mode = c->identity_mode;
if (!isValidKey(key, mi))
{
error("Not a valid meter key \"%s\"\n", key.c_str());
}
if (mi.driver_name.str() == "")
{
error("Not a valid meter driver \"%s\"\n", driver.c_str());
}
//LinkModeSet default_modes = toMeterLinkModeSet(mi.driver);
/*
if (default_modes.has(LinkMode::MBUS))
{
// MBus primary address 0-250
// secondary hex address iiiiiiiimmmmvvmm
}
else
{
// WMBus ids are 8 hex digits iiiiiiii
if (!isValidMatchExpressions(id, true)) error("Not a valid id nor a valid meter match expression \"%s\"\n", id.c_str());
}
if (!isValidKey(key, mi)) error("Not a valid meter key \"%s\"\n", key.c_str());
*/
c->meters.push_back(mi);
// Check if the devices can listen to the meter link mode(s).
/*
Ignore this check for now until all meters have been refactored.
if (!default_modes.hasAll(mi.link_modes))
{
string want = mi.link_modes.hr();
string has = default_modes.hr();
error("(cmdline) cannot set link modes to: %s because meter %s only transmits on: %s\n",
want.c_str(), mi.driverName().str().c_str(), has.c_str());
}
string modeshr = mi.link_modes.hr();
debug("(cmdline) setting link modes to %s for meter %s\n",
mi.link_modes.hr().c_str(), name.c_str());
*/
}
return shared_ptr<Configuration>(c);

Wyświetl plik

@ -27,5 +27,6 @@
using namespace std;
shared_ptr<Configuration> parseCommandLine(int argc, char **argv);
void enableEarlyLoggingFromCommandLine(int argc, char **argv);
#endif

Wyświetl plik

@ -16,6 +16,7 @@
*/
#include"config.h"
#include"drivers.h"
#include"meters.h"
#include"units.h"
@ -52,11 +53,13 @@ void parseMeterConfig(Configuration *c, vector<char> &buf, string file)
string bus;
string name;
string driver = "auto";
string id;
string address_expressions;
string key = "";
string linkmodes;
int poll_interval = 0;
IdentityMode identity_mode {};
vector<string> telegram_shells;
vector<string> meter_shells;
vector<string> alarm_shells;
vector<string> extra_constant_fields;
vector<string> extra_calculated_fields;
@ -106,7 +109,7 @@ void parseMeterConfig(Configuration *c, vector<char> &buf, string file)
else
if (p.first == "driver") driver = p.second;
else
if (p.first == "id") id = p.second;
if (p.first == "id") address_expressions = p.second;
else
if (p.first == "key")
{
@ -127,10 +130,23 @@ void parseMeterConfig(Configuration *c, vector<char> &buf, string file)
}
}
else
if (p.first == "identitymode") {
identity_mode = toIdentityMode(p.second.c_str());
if (identity_mode == IdentityMode::INVALID)
{
error("Invalid identity mode: \"%s\"!\n", p.second.c_str());
}
}
else
if (p.first == "shell") {
telegram_shells.push_back(p.second);
}
else
if (p.first == "metershell") {
meter_shells.push_back(p.second);
}
else
if (p.first == "alarmshell") {
alarm_shells.push_back(p.second);
}
@ -170,36 +186,28 @@ void parseMeterConfig(Configuration *c, vector<char> &buf, string file)
MeterInfo mi;
mi.parse(name, driver, id, key); // sets driver, extras, name, bus, bps, link_modes, ids, name, key
mi.poll_interval = poll_interval;
/*
Ignore link mode checking until all drivers have been refactored.
LinkModeSet default_modes = toMeterLinkModeSet(mi.driver);
if (!default_modes.hasAll(mi.link_modes))
if (!isValidSequenceOfAddressExpressions(address_expressions))
{
string want = mi.link_modes.hr();
string has = default_modes.hr();
error("(cmdline) cannot set link modes to: %s because meter %s only transmits on: %s\n",
want.c_str(), mi.driverName().str().c_str(), has.c_str());
}
string modeshr = mi.link_modes.hr();
debug("(cmdline) setting link modes to %s for meter %s\n",
mi.link_modes.hr().c_str(), name.c_str());
*/
if (!isValidMatchExpressions(id, true)) {
warning("Not a valid meter id nor a valid meter match expression \"%s\"\n", id.c_str());
warning("In config, not a valid meter id nor a valid sequence of match expression \"%s\"\n", address_expressions.c_str());
use = false;
}
if (!isValidKey(key, mi)) {
warning("Not a valid meter key \"%s\"\n", key.c_str());
mi.parse(name, driver, address_expressions, key); // sets driver, extras, name, bus, bps, link_modes, ids, name, key
mi.poll_interval = poll_interval;
mi.identity_mode = identity_mode;
if (!isValidKey(key, mi))
{
warning("In config, not a valid meter key in config \"%s\"\n", key.c_str());
use = false;
}
if (use) {
if (use)
{
mi.extra_constant_fields = extra_constant_fields;
mi.extra_calculated_fields = extra_calculated_fields;
mi.shells = telegram_shells;
mi.idsc = toIdsCommaSeparated(mi.ids);
mi.meter_shells = meter_shells;
mi.selected_fields = selected_fields;
c->meters.push_back(mi);
}
@ -636,6 +644,11 @@ void handleShell(Configuration *c, string cmdline)
c->telegram_shells.push_back(cmdline);
}
void handleMeterShell(Configuration *c, string cmdline)
{
c->meter_shells.push_back(cmdline);
}
void handleAlarmShell(Configuration *c, string cmdline)
{
c->alarm_shells.push_back(cmdline);
@ -668,12 +681,14 @@ shared_ptr<Configuration> loadConfiguration(string root, ConfigOverrides overrid
string conf_dir = root;
string conf_file = root+"/etc/wmbusmeters.conf";
string conf_meter_dir = root+"/etc/wmbusmeters.d";
string conf_drivers_dir = root+"/etc/wmbusmeters.drivers.d";
if (!checkFileExists(conf_file.c_str()))
{
conf_dir = root+"/etc";
conf_file = root+"/wmbusmeters.conf";
conf_meter_dir = root+"/wmbusmeters.d";
conf_drivers_dir = root+"/wmbusmeters.drivers.d";
}
debug("(config) loading %s\n", conf_file.c_str());
@ -714,6 +729,7 @@ shared_ptr<Configuration> loadConfiguration(string root, ConfigOverrides overrid
else if (p.first == "selectfields") handleSelectedFields(c, p.second);
else if (p.first == "shell") handleShell(c, p.second);
else if (p.first == "resetafter") handleResetAfter(c, p.second);
else if (p.first == "metershell") handleMeterShell(c, p.second);
else if (p.first == "alarmshell") handleAlarmShell(c, p.second);
else if (startsWith(p.first, "json_") ||
startsWith(p.first, "field_"))
@ -793,6 +809,8 @@ shared_ptr<Configuration> loadConfiguration(string root, ConfigOverrides overrid
handleLogfile(c, overrides.logfile_override);
}
loadDriversFromDir(conf_drivers_dir);
return shared_ptr<Configuration>(c);
}

Wyświetl plik

@ -68,6 +68,7 @@ struct Configuration
ConfigOverrides overrides;
bool useconfig {};
std::string config_root;
std::string drivers_dir;
bool need_help {};
bool silent {};
bool verbose {};
@ -98,9 +99,11 @@ struct Configuration
bool json {};
bool pretty_print_json {};
int pollinterval {}; // Time between polling of mbus meters.
IdentityMode identity_mode {}; // How to group meters identities into state objects.
bool fields {};
char separator { ';' };
std::vector<std::string> telegram_shells;
std::vector<std::string> meter_shells;
std::vector<std::string> alarm_shells;
int alarm_timeout {}; // Maximum number of seconds between dongle receiving two telegrams.
std::string alarm_expected_activity; // Only warn when within these time periods.

Plik diff jest za duży Load Diff

Some files were not shown because too many files have changed in this diff Show More