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.
Closed

Trigger applications or apple scripts on remote devices like MacBooks

Hey guys, Just something that popped up.

How cool would it be if homey could mute my volume or dim the display on my macbook. Its easy to make an automator script or apple script to do this but it would be cool if homey could have the authority to trigger them when I ask for it.
just an idea.

Comments

  • Just make it. Making an app is a lot of fun.  :)
  • Can automator script be remotely triggered?
  • EmileEmile Administrator, Athom
    You could make a node.js server for your mac that open's apple scripts. Something like this:

    var applescript = require('applescript'); // https://github.com/TooTallNate/node-applescript
    var express = require('express') // http://expressjs.com

    var app = express();

    var scripts = {
    'volume_up': 'set volume output volume {{volume}} --100%'
    }

    app.get('/:script', function( req, res ){

    var script = scripts[ req.params.script ];

    if( typeof script != 'string' ) return res.status(400).send('invalid script');

    // replace variables
    for( var queryparam in req.query ) {
    script = script.replace( '{{' + queryparam + '}}', req.query[ queryparam ] );
    }

    applescript.execString(script, function(err, result) {
    if (err) return res.status(400).send(err.message || err.toString());
    res.send(result || 'ok');
    });

    })

    app.listen(8080)

    // example: POST http://yourip:8080/volume_up?volume=70



  • Why not use Unified Remote?
  • tommyjay said:
    Why not use Unified Remote?
    I homey able to communicate with "Unified Remote"?

  • Uranday said:
    Just make it. Making an app is a lot of fun.  :)
    Willing to learn but not skilled at making scripts as complex as this. And triggering them remotely is a problem.
    Im gonna try the node.js idea as soon as I get my homey.

  • tommyjay said:
    Why not use Unified Remote?
    I homey able to communicate with "Unified Remote"?
    Does it talk REST or HTTP? Then yes. Otherwise depends what protocols remote supports? depends how complicated is to implement supported protocol.
  • MatjaLipu said:
    tommyjay said:
    Why not use Unified Remote?
    I homey able to communicate with "Unified Remote"?
    Does it talk REST or HTTP? Then yes. Otherwise depends what protocols remote supports? depends how complicated is to implement supported protocol.
    I just think that many people would appreciate a Homey app that uses Unified Remote. I use it for a longer time now and most of my Flics are configured to do some Unified Remote action. They have a well documented API and many third party services, including Flic integrates with UR. Best of all, it's available for pretty much every platform out there; computer, gaming console, mobile, TV... I think Homey would greatly benefit a Unified Remote app. It's also pretty simple to set it up, so I think it would serve a wider customer base.
This discussion has been closed.