{"id":22491916,"url":"https://github.com/travishorn/autowater","last_synced_at":"2025-10-12T04:39:43.407Z","repository":{"id":40002324,"uuid":"274781280","full_name":"travishorn/autowater","owner":"travishorn","description":"System to record soil moisture and send a signal to add water when low.","archived":false,"fork":false,"pushed_at":"2022-12-13T03:52:07.000Z","size":2237,"stargazers_count":0,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T13:05:29.945Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/travishorn.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":"2020-06-24T22:27:29.000Z","updated_at":"2020-12-14T16:51:32.000Z","dependencies_parsed_at":"2023-01-28T06:15:21.540Z","dependency_job_id":null,"html_url":"https://github.com/travishorn/autowater","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/travishorn/autowater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Fautowater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Fautowater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Fautowater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Fautowater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/travishorn","download_url":"https://codeload.github.com/travishorn/autowater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Fautowater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010272,"owners_count":26084720,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-06T18:12:29.878Z","updated_at":"2025-10-12T04:39:43.391Z","avatar_url":"https://github.com/travishorn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autowater\n\nSystem to record soil moisture and send a signal to add water when low.\n\n## Development\n\nClone the repository\n\n```\ngit clone https://github.com/travishorn/autowater.git\n```\n\nChange into the directory\n\n```\ncd autowater\n```\n\nInstall dependencies\n\n```\nnpm install\n```\n\nCreate a `.env` file (or set environment variables however you like) with your\ndatabase credentials\n\n```\nDB_USER=exampleuser\nDB_PASSWORD=examplepassword\nDB_URL=example.com/autowater\n```\n\nRun the server\n\n```\nnpx netlify dev\n```\n\n### Database schema\n\nThe server will attempt to connect to the MongoDB database specified by the\nenvironment variables. This database should have a collection named `sensors`.\n\nThe `sensors` collection should have one or more documents in this format:\n\n```\n{\n  _id: ObjectId(\"...\"),\n  name: \"Example Sensor\",\n  keys: [\n    \"examplekey\"\n  ]\n}\n```\n\nEach sensor must have at least one key. The key is used for authenticating your\nsensor when recording measurements.\n\n### Recording measurements\n\nSend a request like the following. Make note of the key in the authorization\nheader. It must match a key on a sensor in the database.\n\n```\ncurl --request POST \\\n  --url http://localhost:8888/.netlify/functions/measurement \\\n  --header 'content-type: application/x-www-form-urlencoded' \\\n  --header 'authorization: Bearer examplekey' \\\n  --data moisture=0.5 \\\n  --data recorded_at=2020-06-24T22:19:22+0000\n```\n\nMeasurements are added to an array on the sensor document in the database. After\nmaking the request above, the sensor document may appear like this:\n\n```\n  _id: ObjectId(\"...\"),\n  name: \"Example Sensor\",\n  keys: [\n    \"examplekey\"\n  ],\n  measurements: [\n    ... any previous measurements ...,\n    {\n      moisture: 0.5,\n      recorded_at: 2020-06-24T22:19:22+0000\n    }\n  ]\n```\n\n## To do\n\n- Create method for saving settings to database\n- Measurement function should check measurement against minimum in settings\n- If measurement is below minimum, send a water signal\n- Create function for pulling stored measurements\n- Write deployment documentation (already partly configured for Netlify)\n\n## License\n\nCopyright 2020 Travis Horn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravishorn%2Fautowater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravishorn%2Fautowater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravishorn%2Fautowater/lists"}