{"id":22204816,"url":"https://github.com/erspearson/node-red-contrib-xap-framework","last_synced_at":"2025-03-25T02:46:27.511Z","repository":{"id":65462336,"uuid":"224391558","full_name":"erspearson/node-red-contrib-xap-framework","owner":"erspearson","description":"Send and receive xAP home automation messages from Node-RED","archived":false,"fork":false,"pushed_at":"2022-03-18T15:35:58.000Z","size":61,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T09:34:28.530Z","etag":null,"topics":["node-red-contrib","typescript","xap-home-automation"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erspearson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-27T09:19:47.000Z","updated_at":"2022-01-04T19:10:00.000Z","dependencies_parsed_at":"2023-01-24T15:45:30.523Z","dependency_job_id":null,"html_url":"https://github.com/erspearson/node-red-contrib-xap-framework","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.3125,"last_synced_commit":"69dde9035d3512715e14783708f55ad87c3b9822"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erspearson%2Fnode-red-contrib-xap-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erspearson%2Fnode-red-contrib-xap-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erspearson%2Fnode-red-contrib-xap-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erspearson%2Fnode-red-contrib-xap-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erspearson","download_url":"https://codeload.github.com/erspearson/node-red-contrib-xap-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245388760,"owners_count":20607163,"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":["node-red-contrib","typescript","xap-home-automation"],"created_at":"2024-12-02T17:19:55.773Z","updated_at":"2025-03-25T02:46:27.491Z","avatar_url":"https://github.com/erspearson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-red-contrib-xap-framework\n\nSend and receive xAP home automation messages with Node-RED and\n[xap-framework](https://github.com/erspearson/xap-framework).\n\nRequires\n[xap-hub](https://github.com/erspearson/xap-hub)\nto communicate with the LAN.\n\nxap-hub is best installed globally and run as a service.\n\n## Installation\n\nNot yet published to the Node-RED repository so install locally. Typically,\n\n``cd ~/.node-red``\n\n``npm install node-red-contrib-xap-framework``\n\nand restart Node-RED.\n\nThe xAP-In and xAP-Out nodes will appear in the network section of the node palette.\n\n## Nodes\n\n* xAP-Device config node\n* xAP-In receives xAP messages from the LAN\n* xAP-Out transmits messages to the LAN.\n\n### xAP-Device (config node)\n\n* Common connection point for In and Out nodes to communicate with the local network.\n* Sets the source address for messages sent and sets the interval between heartbeat messages.\n\n### xAP-In\n\n* By default, with no filters set, receives all xAP messages\n* Filters can be set for class, source and target message fields\n* ``msg.payload`` contains the xAP message as a structured message object that can be inspected in a function node using all the methods and sub-objects defined by xap-framework.\n\n```javascript\nfunction lc(str) { return str.toLowerCase(); }\n\n// Extract the header and first block\nvar hdr = msg.payload.header;\nvar blk = msg.payload.blocks[1];\n\n// Check the header class and block name\nif(hdr.class == 'xapbsc.event') {\n  if(lc(blk.name) == 'output.state') {\n      state = lc(blk.getValue('state'));\n...\n```\n\n### xAP-Out\n\nParses a string containing a partial xAP message on its input, passes it to the connected xAP-Device config node which adds the source address and UID, and transmits to xap-hub for forwarding onto the LAN.\n\n#### Example\n\nA template node Mustache template for creating a BSC command message:\n\n```json\n{\n  \"class\": \"xAPBSC.Cmd\",\n  \"target\": \"{{target}}\",\n  \"output.state.1\": {\n    \"ID\": \"*\",\n    \"State\": \"{{state}}\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferspearson%2Fnode-red-contrib-xap-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferspearson%2Fnode-red-contrib-xap-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferspearson%2Fnode-red-contrib-xap-framework/lists"}