Please read Welcome to the forum to get started.
HomeyScript - share your scripts - main discussion topic
Write scripts for Homey, for when the Flow Editor might not be enough.
App store link: HomeyScript App
Wiki: HomeyScript Wiki (additional examples and information can be added here)
Visit https://homeyscript.athom.com to manage your scripts.
- Run a script as a Flow 'and' or 'then' card
In HomeyScript, you can access a few global objects:
Homey- A HomeyAPI instance. https://developer.athom.com/
_- Lodash. https://lodash.com/
fetch- The Fetch API. https://developer.mozilla.org/
console- V8 Logging API's.
log(...args)- A shortcut function to append to the output log.
say(text)- A shortcut function to make Homey speak.
__filename__- The script filename.
__script_id__- The script ID.
args- An (optional) Array of script args.
It is possible to trigger a script remotely using the Homey Web API.
let HomeyScript = await Homey.apps.getApp('com.athom.homeyscript'); HomeyScript.ApiPost('script/<ScriptID>/run', [arg1, arg2]);