[{"data":1,"prerenderedAt":533},["ShallowReactive",2],{"post-\u002Fblog\u002F2021\u002Fwmbus-meters-and-how-to-get-it-into-home-assistant":3},{"id":4,"title":5,"body":6,"categories":518,"date":523,"description":50,"extension":524,"image":525,"meta":526,"navigation":528,"path":529,"seo":530,"stem":531,"__hash__":532},"blog\u002Fblog\u002F2021\u002Fwmbus-meters-and-how-to-get-it-into-home-assistant.md","wmBus Meters And How To Get It Into Home Assistant",{"type":7,"value":8,"toc":515},"minimark",[9,13,38,41,44,150,153,332,335,351,354,381,384,387,476,479,485,488,491,496,511],[10,11,12],"p",{},"Recently, I decided to switch over to Home Assistant due to instability of iobroker. Maybe I had too many adapters, slaves or what else... Somehow it did not function properly anymore. Also the UI of Home Assistant and its performance is much better than iobroker in my opinion. So I gave it a try and most of my stuff was quickly integrated, especially the HomeMatic stuff with some Paspberry Pi 3 used as the CCU.",[10,14,15,16,22,26,27,31,32,37],{},"But one problem came up again... How to get my wmBus and M-Bus meter readings in. As I wrote in some ",[17,18,10],"a",{"href":19,"rel":20},"https:\u002F\u002Fblog.the78mole.de\u002Fintegrating-wmbus-devices-into-iobroker\u002F",[21],"nofollow",[17,23,25],{"href":19,"rel":24},[21],"revious post about wmBus",", I could not find a software able to decode the Messhelden (manufacturer code AAA) heat cost allocators correctly outside of iobroker (the working software was: ",[17,28,29],{"href":29,"rel":30},"https:\u002F\u002Fgithub.com\u002FISFH\u002FioBroker.wmbus",[21],"). So I gave ",[17,33,36],{"href":34,"rel":35},"https:\u002F\u002Fgithub.com\u002Fweetmuts\u002Fwmbusmeters",[21],"wmbusmeters"," a second try to publish the read values via MQTT.",[10,39,40],{},"After quite some work with updatigng my (really outdated) codebase, fixing stuff, integrating my two new meters, documenting, how to add a new meter and a help of the really active maintainer of wmbusmeters, I managed to get everything done. Take some Raspberry Pi, put the wmBus-Stick in place (I use IMST iM871A-USB) and move on with the software.",[10,42,43],{},"Just do the relevant steps: Cloning, building, installing, configuring enjoying:",[45,46,51],"pre",{"className":47,"code":48,"language":49,"meta":50,"style":50},"language-bash shiki shiki-themes github-light github-dark","pi@wmbuscollector:~ $ mkdir GIT\npi@wmbuscollector:~ $ cd GIT\npi@wmbuscollector:~ $ git clone https:\u002F\u002Fgithub.com\u002Fweetmuts\u002Fwmbusmeters.git\npi@wmbuscollector:~ $ cd wmbusmeters\npi@wmbuscollector:~ $ .\u002Fconfigure\npi@wmbuscollector:~ $ make\npi@wmbuscollector:~ $ sudo make install\n","bash","",[52,53,54,74,86,102,114,124,134],"code",{"__ignoreMap":50},[55,56,59,63,67,71],"span",{"class":57,"line":58},"line",1,[55,60,62],{"class":61},"sScJk","pi@wmbuscollector:~",[55,64,66],{"class":65},"sVt8B"," $ ",[55,68,70],{"class":69},"sZZnC","mkdir",[55,72,73],{"class":69}," GIT\n",[55,75,77,79,81,84],{"class":57,"line":76},2,[55,78,62],{"class":61},[55,80,66],{"class":65},[55,82,83],{"class":69},"cd",[55,85,73],{"class":69},[55,87,89,91,93,96,99],{"class":57,"line":88},3,[55,90,62],{"class":61},[55,92,66],{"class":65},[55,94,95],{"class":69},"git",[55,97,98],{"class":69}," clone",[55,100,101],{"class":69}," https:\u002F\u002Fgithub.com\u002Fweetmuts\u002Fwmbusmeters.git\n",[55,103,105,107,109,111],{"class":57,"line":104},4,[55,106,62],{"class":61},[55,108,66],{"class":65},[55,110,83],{"class":69},[55,112,113],{"class":69}," wmbusmeters\n",[55,115,117,119,121],{"class":57,"line":116},5,[55,118,62],{"class":61},[55,120,66],{"class":65},[55,122,123],{"class":69},".\u002Fconfigure\n",[55,125,127,129,131],{"class":57,"line":126},6,[55,128,62],{"class":61},[55,130,66],{"class":65},[55,132,133],{"class":69},"make\n",[55,135,137,139,141,144,147],{"class":57,"line":136},7,[55,138,62],{"class":61},[55,140,66],{"class":65},[55,142,143],{"class":69},"sudo",[55,145,146],{"class":69}," make",[55,148,149],{"class":69}," install\n",[10,151,152],{},"Configuration can bea easily done by editing the file \u002Fetc\u002Fwmbusmeters.conf:",[45,154,156],{"className":47,"code":155,"language":49,"meta":50,"style":50},"loglevel=debug\ndevice=\u002Fdev\u002FttyUSB0:t1\nlogtelegrams=true\nformat=json\nmeterfiles=\u002Fvar\u002Flog\u002Fwmbusmeters\u002Fmeter_readings\nmeterfilesaction=overwrite\nmeterfilesnaming=name-id\n# meterfilestimestamp=day\nlogfile=\u002Fvar\u002Flog\u002Fwmbusmeters\u002Fwmbusmeters.log\nshell=HOME=\u002Fhome\u002Fwmbusmeters\u002F \u002Fusr\u002Fbin\u002Fmosquitto_pub -h 172.22.2.137 -u mqtt -P mypass -t wmbusmeters\u002F$METER_ID -m \"$METER_JSON\"\njson_address=Elfenstrasse 12\njson_city=Bruchsaal\n",[52,157,158,170,180,190,200,210,220,230,237,248,307,321],{"__ignoreMap":50},[55,159,160,163,167],{"class":57,"line":58},[55,161,162],{"class":65},"loglevel",[55,164,166],{"class":165},"szBVR","=",[55,168,169],{"class":69},"debug\n",[55,171,172,175,177],{"class":57,"line":76},[55,173,174],{"class":65},"device",[55,176,166],{"class":165},[55,178,179],{"class":69},"\u002Fdev\u002FttyUSB0:t1\n",[55,181,182,185,187],{"class":57,"line":88},[55,183,184],{"class":65},"logtelegrams",[55,186,166],{"class":165},[55,188,189],{"class":69},"true\n",[55,191,192,195,197],{"class":57,"line":104},[55,193,194],{"class":65},"format",[55,196,166],{"class":165},[55,198,199],{"class":69},"json\n",[55,201,202,205,207],{"class":57,"line":116},[55,203,204],{"class":65},"meterfiles",[55,206,166],{"class":165},[55,208,209],{"class":69},"\u002Fvar\u002Flog\u002Fwmbusmeters\u002Fmeter_readings\n",[55,211,212,215,217],{"class":57,"line":126},[55,213,214],{"class":65},"meterfilesaction",[55,216,166],{"class":165},[55,218,219],{"class":69},"overwrite\n",[55,221,222,225,227],{"class":57,"line":136},[55,223,224],{"class":65},"meterfilesnaming",[55,226,166],{"class":165},[55,228,229],{"class":69},"name-id\n",[55,231,233],{"class":57,"line":232},8,[55,234,236],{"class":235},"sJ8bj","# meterfilestimestamp=day\n",[55,238,240,243,245],{"class":57,"line":239},9,[55,241,242],{"class":65},"logfile",[55,244,166],{"class":165},[55,246,247],{"class":69},"\u002Fvar\u002Flog\u002Fwmbusmeters\u002Fwmbusmeters.log\n",[55,249,251,254,256,259,261,264,267,271,274,277,280,283,286,289,292,295,298,301,304],{"class":57,"line":250},10,[55,252,253],{"class":65},"shell",[55,255,166],{"class":165},[55,257,258],{"class":65},"HOME",[55,260,166],{"class":165},[55,262,263],{"class":69},"\u002Fhome\u002Fwmbusmeters\u002F",[55,265,266],{"class":61}," \u002Fusr\u002Fbin\u002Fmosquitto_pub",[55,268,270],{"class":269},"sj4cs"," -h",[55,272,273],{"class":269}," 172.22.2.137",[55,275,276],{"class":269}," -u",[55,278,279],{"class":69}," mqtt",[55,281,282],{"class":269}," -P",[55,284,285],{"class":69}," mypass",[55,287,288],{"class":269}," -t",[55,290,291],{"class":69}," wmbusmeters\u002F",[55,293,294],{"class":65},"$METER_ID ",[55,296,297],{"class":269},"-m",[55,299,300],{"class":69}," \"",[55,302,303],{"class":65},"$METER_JSON",[55,305,306],{"class":69},"\"\n",[55,308,310,313,315,318],{"class":57,"line":309},11,[55,311,312],{"class":65},"json_address",[55,314,166],{"class":165},[55,316,317],{"class":69},"Elfenstrasse",[55,319,320],{"class":61}," 12\n",[55,322,324,327,329],{"class":57,"line":323},12,[55,325,326],{"class":65},"json_city",[55,328,166],{"class":165},[55,330,331],{"class":69},"Bruchsaal\n",[10,333,334],{},"Now start wmbusmeters with the following command and watch it fetching packets:",[45,336,338],{"className":47,"code":337,"language":49,"meta":50,"style":50},"pi@wmbuscollector:~ $ wmbusmeters --useconfig=\u002F\n",[52,339,340],{"__ignoreMap":50},[55,341,342,344,346,348],{"class":57,"line":58},[55,343,62],{"class":61},[55,345,66],{"class":65},[55,347,36],{"class":69},[55,349,350],{"class":269}," --useconfig=\u002F\n",[10,352,353],{},"Now you simply need to add meters that shall be collected and published on MQTT. This is done by placing a single file per meter in \u002Fetc\u002Fwmbusmeters.d",[45,355,359],{"className":356,"code":357,"language":358,"meta":50,"style":50},"language-vim shiki shiki-themes github-light github-dark","name=NBEGGLWS\ntype=aventieshca\nid=60900128\nkey=FFD16C9C361B0B7E094A2AED3DCA1B58\n","vim",[52,360,361,366,371,376],{"__ignoreMap":50},[55,362,363],{"class":57,"line":58},[55,364,365],{},"name=NBEGGLWS\n",[55,367,368],{"class":57,"line":76},[55,369,370],{},"type=aventieshca\n",[55,372,373],{"class":57,"line":88},[55,374,375],{},"id=60900128\n",[55,377,378],{"class":57,"line":104},[55,379,380],{},"key=FFD16C9C361B0B7E094A2AED3DCA1B58\n",[10,382,383],{},"The keys is only needed, if your meter sends encrypted data and you should have received the key from your manufacturer\u002Fseller of the meter.",[10,385,386],{},"My meters' data now gets transferred via MQTT and my Home Assistant simply fetches it and puts it into is history store (sqlite & influxdb in my case). The appropriate YAML in Home Assistant looks like this:",[45,388,392],{"className":389,"code":390,"language":391,"meta":50,"style":50},"language-yaml shiki shiki-themes github-light github-dark","sensor: \n - platform: mqtt\n   name: \"HCA NBEG WS\"\n   unique_id: wmbus.60900128\n   state_topic: \"wmbusmeters\u002F60900128\"\n   unit_of_measurement: \"hca\"\n   value_template: \"{{ value_json.current_consumption_hca }}\"\n   json_attributes_topic: \"wmbusmeters\u002F60900128\" \n","yaml",[52,393,394,403,417,427,437,447,457,467],{"__ignoreMap":50},[55,395,396,400],{"class":57,"line":58},[55,397,399],{"class":398},"s9eBZ","sensor",[55,401,402],{"class":65},": \n",[55,404,405,408,411,414],{"class":57,"line":76},[55,406,407],{"class":65}," - ",[55,409,410],{"class":398},"platform",[55,412,413],{"class":65},": ",[55,415,416],{"class":69},"mqtt\n",[55,418,419,422,424],{"class":57,"line":88},[55,420,421],{"class":398},"   name",[55,423,413],{"class":65},[55,425,426],{"class":69},"\"HCA NBEG WS\"\n",[55,428,429,432,434],{"class":57,"line":104},[55,430,431],{"class":398},"   unique_id",[55,433,413],{"class":65},[55,435,436],{"class":69},"wmbus.60900128\n",[55,438,439,442,444],{"class":57,"line":116},[55,440,441],{"class":398},"   state_topic",[55,443,413],{"class":65},[55,445,446],{"class":69},"\"wmbusmeters\u002F60900128\"\n",[55,448,449,452,454],{"class":57,"line":126},[55,450,451],{"class":398},"   unit_of_measurement",[55,453,413],{"class":65},[55,455,456],{"class":69},"\"hca\"\n",[55,458,459,462,464],{"class":57,"line":136},[55,460,461],{"class":398},"   value_template",[55,463,413],{"class":65},[55,465,466],{"class":69},"\"{{ value_json.current_consumption_hca }}\"\n",[55,468,469,472,474],{"class":57,"line":232},[55,470,471],{"class":398},"   json_attributes_topic",[55,473,413],{"class":65},[55,475,446],{"class":69},[10,477,478],{},"All attributes (other sensor values) simply get packed into the attributes of the new sensor.",[10,480,481],{},[482,483],"img",{"alt":50,"src":484},"\u002Fimages\u002Fblog\u002F2021\u002F07\u002Fimage-6.png",[10,486,487],{},"Happy metering!",[489,490],"hr",{},[492,493,495],"h2",{"id":494},"kommentare-comments","Kommentare \u002F Comments",[10,497,498,499,504,505,510],{},"Hast du Fragen oder Anmerkungen zu diesem Artikel? ",[17,500,503],{"href":501,"rel":502},"https:\u002F\u002Fgithub.com\u002Fthe78mole-blog\u002Fthe78mole-blog.github.io\u002Fissues\u002Fnew?title=Kommentar+zu%3A+wmbus-meters-and-how-to-get-it-into-home-assistant&labels=comment",[21],"Erstelle ein GitHub Issue"," oder starte eine ",[17,506,509],{"href":507,"rel":508},"https:\u002F\u002Fgithub.com\u002Fthe78mole-blog\u002Fthe78mole-blog.github.io\u002Fdiscussions",[21],"Diskussion",".",[512,513,514],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":50,"searchDepth":76,"depth":76,"links":516},[517],{"id":494,"depth":76,"text":495},[519,520,521,522],"Bus Systems","Home Assistant","Smart Home","wmBus","2021-07-13","md","\u002Fimages\u002Fblog\u002F2021\u002F07\u002FMBusWirelessLogo.jpg",{"tags":527},[],true,"\u002Fblog\u002F2021\u002Fwmbus-meters-and-how-to-get-it-into-home-assistant",{"title":5,"description":50},"blog\u002F2021\u002Fwmbus-meters-and-how-to-get-it-into-home-assistant","pf-KDfnLnowfjYuwyZ9GkG6SKrj7Dq2VfyPuU-auFpU",1777286694005]