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-wink

v1.1.0

Published

Pimatic plugin to interface with Wink connected devices

Downloads

5

Readme

pimatic-wink

Pimatic plugin to interface with Wink connected devices. Currently supports the following device types:

  1. Light Bulbs
  2. Binary Switches
  3. Shades
  4. Locks - only lock/unlock functions are supported
  5. Light Switches - This not a Wink device but, a varition on light_bulb and only offers on/off functionality. This will not be added automatically by discovery. If you want to use it, you will have to do it manually. You can change the class for a device added by auto-discovery to WinkLightBulb by editing the config.json file.

This plugin suppports auto-discovery available since pimatic v0.90, and that is the preferred way of adding devices, it will retrieve all the parameters it needs using the Wink API.

This version subscribes to pubnub streams where Wink publishes real-time device statutes - google 'wink pubnub' if you want further info.

The plugin should preferrably be installed using the pimatic UI functions. After installing the plugin you should edit the parameters and set the username and password. After this restart pimatic, this will retrieve the OAuth token that the plugin needs to make Wink API calls

Plugin

{
  "plugin": "wink",
  "client_id": "quirky_wink_android_app",
  "client_secret": "e749124ad386a5a35c0ab554a4f2c045",
  "username": "[email protected]",
  "password": "123456",
  "auth_token": "0000aaaaa99999988889999332211333"
},

client_id and client_secret are used for OAuth token generation. You can email wink support and request a personalized client_id and client_secret, it's been known to take considerable time to get it, so these were taken from the Android Wink app, first seen here:

https://github.com/davidgruhin/WinkPost/blob/master/js/wink.js#L335

username and password are those used to log in to the official Wink app.

auth_token is generated by accessing the Wink API - the plug will automatically do this, after you the username and password and restart pimatic. You can also retrieve this using the CLI - see usage not below

Devices

device_id, pubnub_subscribe_key, pubnub_channel are used to interact with devices and subscribe to status updates. If you use pimatic auto-discovery to add devices, these will be automatically populated for you. You can also manually populate these, by retrieving the device map using the CLI and looking them up in the device map.

{
  "id": "my-light-bulb",                //unique id used by pimatic
  "class": "WinkLightBulb",             //this should match the device type
  "name": "Office Light Bulb"           //call it what you want 
  "device_id": "212917",                //retrieved from Wink device map
  "pubnub_channel": "very_long_string", //retrieved from Wink device map   
  "pubnub_subscribe_key": "a_string"    //retrieved from Wink device map
},
{
  "id": "my-switch",
  "class": "WinkBinarySwitch",
  "name": "Outlet",
  "device_id": "718646",                 
  "pubnub_channel": "very_long_string",     
  "pubnub_subscribe_key": "a_string"     
},
{
  "id": "my-lock",
  "class": "WinkLock",
  "name": "Front Door",
  "device_id": "404706",                 
  "pubnub_channel": "very_long_string",     
  "pubnub_subscribe_key": "a_string" 
},
{
  "id": "my-shade",
  "class": "WinkShade",
  "name": "Curtains",
  "device_id": "516323",                 
  "pubnub_channel": "very_long_string",     
  "pubnub_subscribe_key": "a_string" 
},
{
  "id": "my-floodlight",
  "class": "WinkLightSwitch",           //this MUST be a light_bulb type device 
  "name": "Curtains",
  "device_id": "201551",                 
  "pubnub_channel": "very_long_string",     
  "pubnub_subscribe_key": "a_string" 
},

Bonus: CLI

pimatic-wink includes a bonus utility that can be run from the command line (via node). See wink-cli.js for more information.

Commands to retrive auth_token and device map - you don't need to do this manually, the plugin does this for you. The auth_token will be retrieved in the first run after installing. Device can be retrieved using auto-discovery.

auth token : node wink-cli.js auth_token '[email protected]' '123456'

device map: node wink-cli.js auth_token device_map