npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pimatic-ifttt

v0.1.1

Published

Pimatic IFTTT Device

Downloads

9

Readme

#pimatic-ifttt

pimatic-ifttt is a pimatic plugin which allows IFTTT to trigger certain actions in pimatic. Here are a few usecases:

  • If you're in the proximity of your home turn on the lights.
  • Turn off the lights if you're leaving town.
  • Rinkle a bell when a friend posts to Facebook.
  • Etc.

With pimatic-ifttt you use IFTTT events to trigger your home automation!

Setup

Step 1: Setting up pimatic

Add the following to the plugins section of config.json:

{
    "plugin": "ifttt"
}

Pimatic will automatically download the plugin.

Now add a device to the devices section :

{
    "id": "ifttt-device",
    "name": "IFTTT device",
    "class": "IFTTTDevice"
}

To test if the API works, add the following rule

{
    "id": "ifttt-test-rule",
    "name": "ifttt-test-rule",
    "rule": "if IFTTT device is triggered then log \"API is triggered\"",
    "active": true,
    "logging": true
}

Now restart the pimatic.js daemon and trigger the api:

http://<pimatic-ip-address>:[portnumber]/api/device/ifttt-device/trigger

In the pimatic message interface you'll see the log message.

Step 2: Setting up IFTTT

To have IFTTT trigger pimatic, use (this)[https://github.com/captn3m0/ifttt-webhook] guide.

In short: you set up IFTTT to create a Wordpress blog post when an event is triggered. The post is send to a website which in turn triggers the pimatic-ifttt API.

For this to work the pimatic API should be publicly accessible. Your router should route traffic from outside your local lan to pimatic. This is a drawback although I'm not sure of the risks. I have only tested this while authentication was disabled. See the Contribute/TODO section below for a solution.

Using pimatic-ifttt

To use this plugin just add a device like explained above. Then use the pimatic rule editor to add actions when the device (or IFTTT event) is triggered.

Contribute

Here's how to set up pimatic-ifttt for development:

$ cd <pimatic-root-directory>/node_modules
$ git clone https://github.com/baswenneker/pimatic-ifttt.git
$ cd pimatic-ifttt

# To install all dependencies, execute:
$ npm install

Tip: use vagrant-pimatic-dev to set up a virtual pimatic development environment.

Running plugin tests

It's easy as pie, just run the following from <pimatic-root-directory>/node_modules/pimatic:

$ grunt test:pimatic-ifttt

The tests are found in <pimatic-root-directory>/node_modules/pimatic-ifttt/test.

TODO: integrate node-ifttt

At the moment the pimatic API should be publicly accessible so that a webservice is able to trigger the pimatic-ifttt plugin. This is not preferable because this allows other people to switch off your lights from the other side of the world :)

To overcome node-ifttt should be integrated with pimatic-ifttt. A short intro to node-ifttt:

This connect middleware exposes a fake WordPress compliant XMLRPC API, so you can use it as an endpoint for an IFTTT WordPress channel.

With node-ifttt integrated we don't have to expose the pimatic API: we only have to allow requests to the node-ifttt server which in turn triggers the pimatic API.