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
Comments
am fooling around with the Homeyscript for some time now and thought i would share some of my scripts.
shown below is a script that will use any motion sensor and use the naming for switching it on or off. so now only 1 flow is needed for all motion sensors as long as naming is correct.
PIRDN5WC
name above is:
PIR to indicate its a motion sensor
D for a dimmer
N for a night dimmer (will be less bright at night)
5 for the time it should be ON
and the last text is used for the name of the lamp to switch.
The script below is the one i use to switch off the lights, wich are switched on with the script above
the below link is of the full implementation of the motion script since i added State control for managing SEC sensors.
Motion.js
I have rewriten your script a little so you can use it in the and / or column:
I'll spend another week getting your solution fittet into my script, thank you !
What did you try to ask?
When turning of devices stuff is left on - but seen as off in homey. I need to stagnate the commands I guess.
If you are using your <first ever script> that you posted a few days ago, try modifying the line device.setCapabilityValue('onoff', false);
Im able to find the SimpleLog app object and see the info on it - but how do i invoke an action?
Here is the app https://github.com/nklerk/nl.nielsdeklerk.log/blob/master/app.js and my script is like this
All i want to do is add a log entry - from a Homey Script - does the app need to expose some API's or?
As far as i know, you can't. There is no api interface. That's needed to use the app from HomeyScript. Because i also want that option i have already commented on this in the app store. Please add one comment there.
At this time i have solved this by using a better logic variable. That works in 99% but sometimes, when two scripts are fighting to be the first to log something. it goes wrong. So that's not reliable enough. I hope @nklerk will add this option soon!
All my z-wave devices turns off instantly - but the zigbee stuff just grinds to a halt, an leaves a random light or two on.
I'm using ikea and hue connected directly to homey - sometimes ikea bulbs are left on, sometimes hues.
Probably just zigbee in general.
Right now, if i do something wrong that turns on all the lights - i'll wake two kids and crazy woman.
But thank you, it did stagnate the off-commands as far as i have been able to test.
I am running a for loop that needs a delay, want to fade my ikea lights on or off.
if you want simple setTimeout functionality you can use this:
or you can use this:
I found this one that also works:
I get an exception when reading a variable using apiGet or write to a variable using apiPut
I have made a dashboard, showing me weather data, but could be usefull to trigger flows from the weatherstation
Every data I have in txt files updating every 2 seconds.
The weatherstation is a Davis Vantage Pro2
https://forum.athom.com/discussion/comment/66458/#Comment_66458
thanks in advance!
Why do you want to do that from HomeyScript ?
Is the app not working? https://apps.athom.com/app/org.telegram.api.bot
I would like to trigger flows or ask questions by talking to the bot - so was trying to make it a 2 way thing.
The script itself checks the temperature outside and starts the heater in my car to make sure it's warm and cosy and there is no ice on the windscreen. I have a small car with a small engine. For larger cars you might have to modify the calculations so the heater is on for a longer time.
You can find the script on GItHub https://github.com/tomhur/homeyscripts/blob/master/carheater.js
I'm having trouble calling another script from one script. I think I have been trying every variant of this
But triggering one script script from another is just a work around for I really would like to do.
Since I want one script that wait x number of seconds and one that waits a random number of seconds, what I really would like to do is create one global function that waits the inputed number of seconds so I can call that from both my wait script and my random script.
Cheers!
I use it to trigger flows from the Telegram Bot app.
As a convenience the script has an array of shortcuts, so you don't need to enter the full title for frequently used flows.
I've added the following flow to run this script whenever the Telegram Bot receives a message. If no flow was triggered, the text is speech emulated, so Homey handles it with speech recognition.
Just kidding ;-)
Thanks for pointing out.
may i ask if anyone can provide some guidance if i can load the telegram app via homeyscript to send myself a text based on the script i created?
i see from the examples that it is possible to load an app. would it be possible to fire off a method within homeyscript to take advantage of the telegram app to send myself some text?
i am trying to loop through my devices based on certain criteria and use a bot to inform when certain appliances are not turned off
thanks!
@jorden sorry i am not good at this but did you expose any API?
maybe it's because I am a newbie, but could someone explain this to me:
!= means "not equal" so why is this used to return classes equal light?
Regards
Andreas
it depends on the code around this line, I guess it gets ALL devices, loops over them and skips the loop when it is not equal to Light,,,, So processes (and maybe returns) somewhere else all lights....