{"id":20085506,"url":"https://github.com/smarthome-go/node","last_synced_at":"2026-05-12T17:42:03.490Z","repository":{"id":50691912,"uuid":"489471101","full_name":"smarthome-go/node","owner":"smarthome-go","description":"Hardware interface for the smarthome server","archived":false,"fork":false,"pushed_at":"2023-09-02T21:22:30.000Z","size":1295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-13T02:17:20.937Z","etag":null,"topics":["433mhz","hardware","microservice","outlet-hardware","raspberry-pi","remote-control","smarthome","smarthome-controller"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/smarthome-go/node","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smarthome-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-06T19:27:12.000Z","updated_at":"2022-08-10T17:06:41.000Z","dependencies_parsed_at":"2023-12-15T00:10:18.300Z","dependency_job_id":"99d1f70f-d7bb-4a0b-a998-e0fdb6b4af94","html_url":"https://github.com/smarthome-go/node","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Fnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarthome-go","download_url":"https://codeload.github.com/smarthome-go/node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241518118,"owners_count":19975384,"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":["433mhz","hardware","microservice","outlet-hardware","raspberry-pi","remote-control","smarthome","smarthome-controller"],"created_at":"2024-11-13T15:56:18.780Z","updated_at":"2026-05-12T17:42:03.408Z","avatar_url":"https://github.com/smarthome-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node (formerly *Smarthome-hw*)\n**Version**: `0.5.0`\n Hardware interface for the Smarthome server\n \n ### Purpose\n The Smarthome server acts like a global hub to connect services, people and hardware together.\n Because the hub is a centralized server which should be able to run on any hardware, not just the Raspberry-Pi, a master-slave setup is used to control the power outlets which accessible to smarthome users. In this setup, the Smarthome-hub acts as the master which is able to orchistrate the slaves, in this case the hardware-nodes.\n \n The 433mhz sockets are controlled by a physical sender which is attached to each Raspberry-Pi, making it a hardware-node.\n The nodes can be registered in the smarthome server which is then able to manage the nodes, send power commands to them and monitor their health.\n \n Therefore, *node*  provides a *REST-API* for making its hardware accessible to the Smarthome-hub.\n \n For redundancy and increased reliability, a Smarthome network should contain more than just one hardware-node.\n Redundancy, fallback and latency are handled by the Smarthome-hub which automatically detects if nodes fail or take too long to respond.\n \nBecause a single node is not able to serve concurrent requests (*due to the limitations of the attached hardware*), a locking system is implemented in node.\nThis lock is acquired when a request is dispatched.\nThe lock is always released when no longer required, regardless whether the request was successful or not.\n\nIn order to provide a true concurrent, non-blocking access to the power outlets, the Smarthome-hub contains an internal queueing system which manages concurrent requests and executes them in a blocking manner (one after another).\n\n![smarthome-hw logo](./icon/readme.png)\n\n### Tokens\nIn order to guarantee a safe communication between the Smarthome-hub and the node, a token is required.\nWhen this application is first started, a *random* token will be generated and printed to the node's logs (**not to the log file**).\n#### Change Token\nIn order to change the default token, use the provided bash script which is located in the distribution directory.\n```bash\n./update_token.sh \"old_token\" \"new_token\"\n```\n\n### Api\nTo dispatch a power request, perform a **POST** request to a similar URL, using a similar request body.\nThe host and the `switch` should be modified to suit your usecase.\nThe payload has to be encoded as `application/json`, using `application/json` as the `Content-Type`.\n```\nhttp://localhost:8081/power?token=smarthome\n```\n\n```json\n{\n\t\"switch\": \"s1\",\n\t\"power\": true\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Fnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarthome-go%2Fnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Fnode/lists"}