{"id":16251905,"url":"https://github.com/ascillato/knx-dpt-parser","last_synced_at":"2025-04-08T12:29:55.864Z","repository":{"id":107916745,"uuid":"133335760","full_name":"ascillato/knx-dpt-parser","owner":"ascillato","description":"Generic KNX telegram payload parser","archived":false,"fork":false,"pushed_at":"2017-02-25T19:29:59.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T08:36:26.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ascillato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-14T09:18:38.000Z","updated_at":"2021-02-27T11:38:30.000Z","dependencies_parsed_at":"2023-04-26T13:17:07.415Z","dependency_job_id":null,"html_url":"https://github.com/ascillato/knx-dpt-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascillato%2Fknx-dpt-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascillato%2Fknx-dpt-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascillato%2Fknx-dpt-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascillato%2Fknx-dpt-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ascillato","download_url":"https://codeload.github.com/ascillato/knx-dpt-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247842016,"owners_count":21005207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T15:11:45.130Z","updated_at":"2025-04-08T12:29:55.772Z","avatar_url":"https://github.com/ascillato.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# knx-dpt-parser\nParser for KNX telegrams. \n\nIf you do not know what KNX is,  \nor do not know what group addresses are,  \n**you are in the wrong repository**  \n\n### If you're still here...\nHere is how to use it:\n\nYou have a node project that gets unparsed KNX telegram data. Header etc. need already to be interpreted, we deal with the payload only.  \nAn example can be found in the *testbusmonitor.js* which is a simple group monitor which prints to stdout. There is a config variable on top to configure the connection to *knxd*  \n\nYou require at least the Decorder.decode\n```javascript\nvar decode = require('knx-dpt-parser').decode;\n```\nAlternatively, you can use `convenienceDecode()` which adds some more easiness to DPT10 Time and DPT11 Date telegrams.  \n\n```javascript\nvar decode = require('knx-dpt-parser').convenienceDecode;\n```\n\n\nThen in you code, if you have both, telegram payload and destination group address, you call the decoder\n\n```javascript\nresult  = decode(payload, dpttype);\n```\nThe result is an object, containing one child object for each contained DPT-format (most types just have one format), plus an 'subitems' entry with the number of formats contained, and a 'TypeText' entry specifying the type of the DPT.  \nAll format child objects contain a value field, containing the numeric value of the section (except for char/string types DPT4 \u0026 16).  \n\nExample for a simple DPT1.001 telegram: \n\n```\n{'0': { value: 1, interpretation: 'True' }, TypeText: 'boolean', subitems: 1, value: 1 }\n``` \nThe last value field is available in the `convenienceDecode()` only.  \n\nA sample of a date DPT11.001, also by `convenienceDecode()` to get the combined value field:  \n```\n { '0': { value: null, interpretation: 'reserved' },\n  '1': { value: 25, Unit: 'Day of month' },\n  '2': { value: null, interpretation: 'reserved' },\n  '3': { value: 2, Unit: 'Month' },\n  '4': { value: null, interpretation: 'reserved' },\n  '5': { value: 2017, Unit: 'Year' },\n  TypeText: 'date',\n  DPT: 'DPST-11-1',\n  subitems: 6,\n  value: '2017-02-25' \n }\n```\nA sample of time DPT10.001\n```\n{ '0': { value: 6, interpretation: 'Saturday', Name: 'Day' },\n  '1': { value: 17, Unit: 'hours', Name: 'Hour' },\n  '2': { value: null, interpretation: 'reserved' },\n  '3': { value: 55, Unit: 'minutes', Name: 'Minutes' },\n  '4': { value: null, interpretation: 'reserved' },\n  '5': { value: 40, Unit: 'seconds', Name: 'Seconds' },\n  TypeText: 'time of day',\n  DPT: 'DPST-10-1',\n  subitems: 6,\n  value: '17:55:40' \n}\n```\nThe value generated by convenienceDecode() for Time types does not include the weekday.\n \nEnumerative types (such as HVAC control mode DPT20.102) have the text of the mode in 'interpretation'.\n```\n{ '0': { value: 3, interpretation: 'Economy', Name: 'HVACMode' },\n  TypeText: 'HVAC mode',\n  DPT: 'DPST-20-102',\n  subitems: 1 }\n```\n\nThe `dpttype` parameter can either be a string like 'DPT1.001' or 'DPST-1-1', in fact '1.1' would be sufficient. It could optimize the process if you convert all DPTs to harmonised objects before using them regulary. For that, use `dptobject = uniformDPT('string-1-1')` and pass that object later to decode. You have to pay attention to the way you require the package, of course.\n  \n  \n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascillato%2Fknx-dpt-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascillato%2Fknx-dpt-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascillato%2Fknx-dpt-parser/lists"}