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

homebridge-unipi2

v1.0.0

Published

HomeBridge Plugin for the UniPi Neuron Devices

Downloads

5

Readme

homebridge-unipi2

Hombridge plugin for UniPi Neuron PLC Optimized for SmartHome usage.

Loosely based on Daan Kets original work, but with:

  • support for one accessory per relay, or one accessory per room with relays as different services, or one accessory with all relays as services
  • support for UniPi extensions modules (xS modules)
  • support for persistent aliases in the config.json (so Neuron module can be reseted without loosing informations)
  • support for complex rules (if/then/else with group conditions, actions to on/off relays, set analog outputs, process short/long/double clicks, or even call ifttt receipes)

Example config file:

    "platforms": [
    {
      "platform": "UniPi2",
      "id": "L203-sn250",
      "name": "My SmartHome",
    
      "aliases": {
        "DI 1_01": "in_switch1",
        "DI 1_02": "in_switch2",
        "DI UART_4_6_08": "in_doorbell",
        "AI UART_2_4_01": "in_rotary1",
        "DO 1_01": "led1",
        "DO 1_02": "led2",
        "RO 2_01": "light1",
        "RO 2_02": "light2",
        "AO UART_2_4_01": "dimmer1",
      },

      "rooms": {
        "living": [ "light1", "light2", "dimmer1" ],
        "leds": [ "led1", "led2" ]
      },

      "iftttKey": "xxxxxxxx",
      "config": {
        "dimmer1": { "inverted": true }
      },

      "rules": [
        {
          "when": "click in_doorbell",
          "then": "ifft doorbell"
        },
        {
          "when": "click in_switch1",
          "if": "off light1",
          "then": "on light1",
          "else": [ "off light1", "off light2", "off dimmer1" ]
        },
        {
          "when": "singleclick in_switch2",
          "if": [ "on light1", "on light2", "on dimmer1" ],
          "then": [ "off light1", "off light2", "off dimmer1" ],
          "else": "switch light2"
        },
        {
          "when": "doubleclick in_switch2",
          "then": [ "off light1", "off light2", "off dimmer1" ]
        },
        {
          "when": "move in_rotary1",
          "then": "setval dimmer1 in_rotary1"
        }

      ]
    }
  ]

Installation:

  1. Install UniPian OS image on the Neuron's SD card
  • Download the UniPian image (called "Neuron OpenSource OS")
  • Download balenaEtcher and install it
  • Connect the SD card to your PC, run balenaEtcher, and write the UniPian image to the SD card
  • Create an empty file called ssh (without extensions) at the root of the SD card
  • put the SD card into the Neuron and power it up
  1. Update all packages Connect to the Neuron using a SSH client, then type:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install evok
sudo systemctl enable evok
reboot
  1. Install homebridge
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt-get install -y nodejs gcc g++ make python
sudo npm i -g npm
sudo npm install -g --unsafe-perm homebridge
sudo hb-service install --user homebridge
  1. Install UniPi2 plugin
sudo npm -g install homebridge-unipi2
  1. Configure Evok and Homebridge
  • Edit the file /etc/evok.conf, make sure to set device-name = to the correct devices for the extensions, if any
  • Edit the file /var/lib/homebridge/.homebridge/config.json and add a platform "UniPi2" with all your rooms, devices, and rules
  1. (optional) Install Config-UI-X plugin
sudo npm install -g homebridge-config-ui-x

This will let you edit the config.json file at will using a webbrowser