This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Official HomeyScript
HomeyScript - share your scripts - main discussion topic
CommunityModerators
Member
HomeyScript
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.
Features
- Write a script in JavaScript and have direct access to Homey's Web API (bèta)
- Run a script as a Flow 'and' or 'then' card
Documentation
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.
API
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]);
Tagged:
Comments
Let's share the scripts you are using in this topic!
But you asked for it, dreamt about it, got it..... now time to share the scripts you will dream about this night
gives this
Homey2 Homey2 AMST-606 AMST-606 X10OnOffH2 X10OnOffH2 X10OnOffH1 X10OnOffH1 X10MS13EK6 X10MS13EK6 X10MS13EA1 X10MS13EA1 X10DimH3 X10DimH3 X10MS13EA3 X10MS13EA3 Denon AVR Denon AVR 5d6081 5d6081 HMS100 HMS100 X10MS13EC2 X10MS13EC2 X10MS13EA5 X10MS13EA5 HMS100 2 HMS100 2 HMS100 4 HMS100 4 HMS100 5 HMS100 5 HMS100 3 HMS100 3 rfx5d6018 rfx5d6018 Denon AVR Denon AVR 1d20bc 1d20bc Samsung Remote Samsung Remote 2de stekkerdoos computer 2de stekkerdoos computer homey haamstede homey haamstede lamp ther haamstede lamp ther haamstede led voor garage haamstede led voor garage haamstede CV-ketel haamstede CV-ketel haamstede frituur haamstede frituur haamstede led zijkantschuur led zijkantschuur versterker schuur versterker schuur afwasmachine haamsdtede afwasmachine haamsdtede magnetron haamstede magnetron haamstede inx10 h1 haamstede inx10 h1 haamstede oven haamstede oven haamstede nachtlamp haamstede nachtlamp haamstede thermostaat haamstede thermostaat haamstede boombox boombox muziekschijf muziekschijf Setop box haamstede Setop box haamstede Televisie alles haamstede Televisie alles haamstede Televisie zelf haamstede Televisie zelf haamstede versterker haamstede versterker haamstede Hue Lamp Hue Lamp Hue Lamp 1 Hue Lamp 1 Hue Lamp 2 Hue Lamp 2 nacht boven nacht boven nacht midden nacht midden bolletjes bolletjes slaapkamer jilles slaapkamer jilles nacht onder nacht onder Inez Inez halletje halletje keuken keuken led kast led kast LivingWhites Plug 3 LivingWhites Plug 3 LivingWhites Plug 4 LivingWhites Plug 4 LivingWhites Plug 5 LivingWhites Plug 5 rene rene X10OnOffA1 X10OnOffA1 2Lan0536ae 2Lan0536ae New Device New Device ---------------- Script returned: false ---------------- Script returned: false
Returns:
completely new to javascript, hoping someone will help, how would i go about doing this? In a working fashion.
Until i can change device classes i name my devices (L) for lights, (H) for heat and so forth.
Should do the trick then
https://www.w3schools.com/js/default.asp
My head exploded the last time I tried to finish my script, so I'll probably be saving it for a day without too much else going on
Return:
Homey
Homey
True
True
?!
Is far from close to do any programming myself - but I will definitely keep an eye on what all you programmers publish here ;-)