{"id":23127678,"url":"https://github.com/hlfshell/mqtt-scheduler","last_synced_at":"2025-08-17T05:31:11.496Z","repository":{"id":146170551,"uuid":"81161255","full_name":"hlfshell/mqtt-scheduler","owner":"hlfshell","description":"Given a set of desired, scheduled MQTT messages, publish them at the correct time/manner.","archived":false,"fork":false,"pushed_at":"2017-03-25T22:50:42.000Z","size":10,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T01:24:43.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/hlfshell.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":"2017-02-07T03:18:18.000Z","updated_at":"2025-01-01T20:33:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"dda5dfbc-2175-4c7c-9984-692b4d450b37","html_url":"https://github.com/hlfshell/mqtt-scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hlfshell/mqtt-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fmqtt-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fmqtt-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fmqtt-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fmqtt-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlfshell","download_url":"https://codeload.github.com/hlfshell/mqtt-scheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlfshell%2Fmqtt-scheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270810833,"owners_count":24650001,"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-08-17T02:00:09.016Z","response_time":129,"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-17T09:14:27.501Z","updated_at":"2025-08-17T05:31:11.486Z","avatar_url":"https://github.com/hlfshell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mqtt-scheduler\nThis is a node module / command line utility (depending on how you use it) to allow easier scheduling of \"tasks\" to be broadcasted on an MQTT network at a given time.\n\n# Install\n\nIf you are installing this as a command line utility, use\n\n```\nnpm install -g mqtt-scheduler\n```\n\nThis will install the mqtt-scheduler globally and allow you to use it as a command line utility.\n\nIf you wish to use this as a module to access additional functionality, use\n\n```\nnpm install --save mqtt-scheduler\n```\n\nwithin your node application.\n\n# The task file\n\nThe task file is used in either use-case. The file is a simple text file where each new line is a new task, and columns between tasks are single-tab delimited.\n\nA typical file is:\n\n```\ngarden lights\t\t9am\t\tgarden/lights\ton\n```\n\nThis would create a task called lights, which would broadcast the topic \"garden/lights\" with the body of \"on\" every day at 9 am.\n\nThe columns for the file are as follows:\n\n1. Task name\n\n2. Time. Date.js is used internally for decent human language parsing of intervals/times.\n\n3. MQTT Topic\n\n4. Message payload \n\n# Command Line Usage\n\nThe simplest way to invoke mqtt-scheduler is passing both the host and file.\n\n```\nmqtt-scheduler --file pathToFile --host mqtt_host_address\n```\n\nCLI options/flags are:\n\n* -h / --host - Your MQTT host. Required.\n* -p / --port - Your MQTT port. Defaults to 1883, the MQTT default port.\n* -i / --id - Your MQTT client id - defaults to \"mqtt_scheduler\".\n* -u / --username - Your MQTT connection username, if required.\n* -P / --password - Your MQTT connection password, if required.\n* -f / --file - The path to the scheduled tasks file. Required.\n\n# Programmatic usage\n\n```\nconst MQTTSCheduler = require('mqtt-scheduler');\nvar scheduler = new MQTTScheduler(opts, cb);\n```\n\nWHERE opts is an object with the following attributes:\n\n* host - Required - the address of your mqtt server\n* port - Defaults to 1883 - the port your mqtt server is listening on\n* clientId - defaults to mqtt_scheduler - the client id reported to the mqtt server\n* username - the username to log into the mqtt server (if required)\n* password - the password to log into the mqtt server (if requrired)\n* onConnect - function that is fired off when connection to the MQTT server occurs\n* onMessage - function that fires off when the client receives a message from the MQTT server\n* onError - function that is fired off when the MQTT client within the scheduler encounters an error\n* onClose - function that is fired off when the MQTT client connection closes\n* onTaskFire - function that is fired off when a task is triggered. It passes the task into the function\n\ncb is an optional callback that will report an error or success of connection to the MQTT server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlfshell%2Fmqtt-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlfshell%2Fmqtt-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlfshell%2Fmqtt-scheduler/lists"}