{"id":20284162,"url":"https://github.com/clebert/node-plant-sensor","last_synced_at":"2025-07-21T08:32:24.323Z","repository":{"id":57102455,"uuid":"364363078","full_name":"clebert/node-plant-sensor","owner":"clebert","description":"A Node.js API for the Xiaomi Plant Sensor with native TypeScript support.","archived":false,"fork":false,"pushed_at":"2023-03-26T22:53:21.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-15T10:53:57.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/clebert.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":"2021-05-04T19:22:31.000Z","updated_at":"2025-02-05T17:24:43.000Z","dependencies_parsed_at":"2022-08-20T18:40:35.004Z","dependency_job_id":null,"html_url":"https://github.com/clebert/node-plant-sensor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clebert/node-plant-sensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fnode-plant-sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fnode-plant-sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fnode-plant-sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fnode-plant-sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clebert","download_url":"https://codeload.github.com/clebert/node-plant-sensor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fnode-plant-sensor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266267288,"owners_count":23902334,"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-11-14T14:18:33.408Z","updated_at":"2025-07-21T08:32:24.305Z","avatar_url":"https://github.com/clebert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Plant Sensor\n\n\u003e A Node.js API for the\n\u003e [Xiaomi Plant Sensor](https://xiaomi-mi.com/sockets-and-sensors/xiaomi-huahuacaocao-flower-care-smart-monitor/)\n\u003e with native TypeScript support.\n\nThis package runs only on Linux and uses BlueZ and D-Bus under the hood.\n\n## Installation\n\n```\nnpm install @clebert/node-plant-sensor @clebert/node-bluez @clebert/node-d-bus\n```\n\n## Features\n\n- Designed from the ground up with TypeScript.\n- Supports reading the temperature, illuminance, moisture, and conductivity.\n- Supports reading the battery level and firmware version.\n\n## Usage example\n\n```js\nimport {Adapter} from '@clebert/node-bluez';\nimport {PlantSensor} from '@clebert/node-plant-sensor';\n\nawait Adapter.use(async (adapter) =\u003e {\n  const plantSensor = new PlantSensor(adapter, `XX:XX:XX:XX:XX:XX`);\n  const data = await plantSensor.getData();\n\n  console.log(`Temperature (°C):`, data.temperature);\n  console.log(`Illuminance (lx):`, data.illuminance);\n  console.log(`Moisture (%):`, data.moisture);\n  console.log(`Conductivity (µS/cm):`, data.conductivity);\n\n  const properties = await plantSensor.getProperties();\n\n  console.log(`Battery level (%):`, properties.batteryLevel);\n  console.log(`Firmware version:`, properties.firmwareVersion);\n});\n```\n\n## Configure D-Bus user permissions\n\nCreate the `/etc/dbus-1/system.d/node-bluez.conf` configuration file. The\nusername may need to be modified.\n\n```xml\n\u003c!DOCTYPE busconfig PUBLIC \"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN\"\n  \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\"\u003e\n\n\u003cbusconfig\u003e\n  \u003cpolicy user=\"pi\"\u003e\n    \u003callow own=\"org.bluez\"/\u003e\n    \u003callow send_destination=\"org.bluez\"/\u003e\n    \u003callow send_interface=\"org.bluez.GattCharacteristic1\"/\u003e\n    \u003callow send_interface=\"org.bluez.GattDescriptor1\"/\u003e\n    \u003callow send_interface=\"org.freedesktop.DBus.ObjectManager\"/\u003e\n    \u003callow send_interface=\"org.freedesktop.DBus.Properties\"/\u003e\n  \u003c/policy\u003e\n\u003c/busconfig\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebert%2Fnode-plant-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclebert%2Fnode-plant-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebert%2Fnode-plant-sensor/lists"}