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

@pmouli/somfy-synergy

v1.5.0-beta.34

Published

Interface for the Somfy Synergy API (myLink).

Downloads

4

Readme

node-somfy-synergy

A JavaScript interface for the Somfy Synergy API (myLink).

This package was tested using a Somfy myLink (Rev 2.0). To find out if your Somfy myLink is Rev 2.0, check out "What is different with the newer myLink (Rev 2.0)?" on the Somfy myLink FAQ.

Setup

You will need to use the Somfy myLink mobile app in order to configure your System ID, to obtain your Somfy myLink's IP address, and to obtain the Target IDs for each remotely controlled device.

  • Go to "Integration" and set a System ID by tapping "Change System ID" (which can be any string).
  • Tap "Get Integration report" to view the System ID, IP address, and Target IDs.

Example

The SomfySynergy class is instantiated with the System ID and IP address of your Somfy myLink.

The SomfySynergy class allows you to send the "down", "stop", and "up" commands to each target device.

const synergy = new SomfySynergy('mySystem', '192.168.1.123');

// Open the first set of shades.
const target1 = synergy.target('AB123C45.1');
target1.up();

// Close the second set of shades.
const target2 = synergy.target('AB123C45.2');
target2.down();

// Stop (or go to the favorite position for) the third set of shades.
const target3 = synergy.target('AB123C45.2');
target3.stop();

Each command is asynchronous (i.e. returns a promise):

synergy
  .target('AB123C45.1')
  .up()
  .then(success => {
    if (success) {
      console.log('Opened the first set of shades!');
    } else {
      console.error('Failed to open the first set of shades.');
    }
  });

Composite Targeting

The SomfySynergy.Platform class exposes an interface similar to SomfySynergy. Unlike SomfySynergy, this class will efficiently batch requests into "composite targets".

For example, suppose you have three Somfy myLink targets:

  • Target A: Left Window Shade
  • Target B: Right Window Shade
  • Target C: Both Window Shades

In other words, Target C is a channel programmed to control both Target A and Target B. You could then instantiate SomfySynergy.Platform with:

const platform = new SomfySynergy.Platform(
  new SomfySynergy(...),
  {
    '<Target A>': [],
    '<Target B>': [],
    '<Target C>': ['<Target A>', '<Target B>'],
  }
);

Unlike with SomfySynergy, sending the same command to multiple targets that are part of the same composite target will lead to de-duplication:

platform.target('<Target A>').up();
platform.target('<Target B>').up();
// Equivalent to...
platform.target('<Target C>').up();

This is useful for implementing more synchronized control of targets, whereas Somfy myLink typically incurs a short delay in between each method.

License

node-somfy-synergy is MIT licensed.