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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-easy-device

v1.0.2

Published

A Node-RED node for easy IoT device management with platform integration support

Readme

node-red-contrib-easy-device

A Node-RED node for easy IoT device management that provides a simple way to manage Internet of Things devices with platform integration.

Features

  • Multi-device Support: Supports various IoT device types including lighting, air conditioning, sensors, and more
  • Multiple Protocols: Compatible with Modbus, UDP, TCP, Cross, and Zigbee 3.0 protocols
  • Flexible Communication: Supports RS485 and RJ45 communication channels
  • Device Discovery: Automatic device discovery and management capabilities
  • Group Control: Ability to control multiple devices simultaneously
  • Spatial Organization: Organize devices by space, floor area, and floor for better management
  • Action-based Control: Define custom actions for different device types

Installation

Via Node-RED Palette Manager

  1. Open Node-RED in your browser
  2. Go to the menu (≡) → Manage palette
  3. Click on the "Install" tab
  4. Search for node-red-contrib-easy-device
  5. Click "Install"

Via npm

npm install node-red-contrib-easy-device

Manual Installation

  1. Navigate to your Node-RED user directory (typically ~/.node-red)
  2. Run the installation command:
    npm install node-red-contrib-easy-device
  3. Restart Node-RED

Usage

Basic Setup

  1. Add the Easy Device Node: Drag the "easy-device" node from the device category to your flow
  2. Configure Device Host: Set up the device host configuration with IP and port
  3. Configure Spatial Information: Set space, floor area, and floor details
  4. Add Devices: Configure individual devices with their properties

Node Configuration

Device Host Configuration

  • Host: IP address of the device host
  • Port: Communication port (default: 1880)

Main Node Configuration

  • Name: Descriptive name for the node
  • Mac: MAC address of the gateway device
  • Device Host: Reference to the configured device host
  • Space: Spatial identifier for device organization
  • Floor Area: Floor area identifier
  • Floor: Floor identifier

Device Configuration

For each device, configure:

  • Code: Unique device identifier
  • Name: Human-readable device name
  • Area: Physical area where the device is located
  • Type: Device type (lighting, sensors, air conditioning, etc.)
  • Protocol: Communication protocol (Modbus, UDP, TCP, etc.)
  • Channel: Communication channel (RS485, RJ45)
  • Actions: Available actions for the device

Supported Device Types

Control Devices

  • Light: Basic lighting control (on/off/charge)
  • Adjustable Light: Dimmable lighting (on/off/adjust/charge)
  • Air Conditioning: Climate control (on/off/temperature/mode/fan/charge/alarm)
  • Air Cleaner: Air purification (on/off/fan)
  • Air Fan: Ventilation (on/off/fan)
  • Blind: Window covering (up/down/pause/charge)
  • Smart Pad: Interactive display (status/refresh/play/fullscreen/bind)

Sensor Devices

  • Air Sensor: Environmental monitoring (PM2.5, PM10, TVOC, CO2, formaldehyde, etc.)
  • Smoke Sensor: Fire detection (smoke/charge)
  • Human Sensor: Occupancy detection (presence/charge)
  • WC Sensor: Restroom occupancy (presence/charge)
  • Power Sensor: Electrical monitoring (voltage/current/power/kwh)
  • Water Sensor: Water usage monitoring (water/charge)
  • Inundation Sensor: Flood detection (inundation/charge)
  • AI Camera Sensor: Intelligent monitoring (density count/cross count/face recognition/smoking detection/duty detection)

Gateway Devices

  • Edge Gateway: Network management (reboot/backup flow/info)

Message Format

Input Messages

The node accepts messages with specific topic patterns:

  1. Device Discovery:

    {
      "topic": "/iot/discover",
      "payload": timestamp
    }
  2. Enhanced Discovery:

    {
      "topic": "/iot/yqdiscover",
      "payload": timestamp,
      "devices": [array_of_devices]
    }
  3. Device Action:

    {
      "topic": "/iot/action/{type}/{space}/{floorarea}/{floor}/{area}/{names}",
      "payload": action_data
    }

Output Messages

The node outputs structured messages containing:

  • topic: Original message topic
  • prepayload: Original payload
  • name: Node name
  • space: Space identifier
  • floorarea: Floor area identifier
  • floor: Floor identifier
  • gateway: Gateway MAC address
  • layers: Array of all easy-device node IDs
  • layer: Current node ID
  • devices: Array of configured devices
  • payload: Processed payload data

Output Ports

  1. Port 1: Device discovery responses
  2. Port 2: Group control responses
  3. Port 3+: Individual device responses (one port per configured device)

Examples

Basic Device Discovery

// Inject node payload
{
  "topic": "/iot/discover",
  "payload": 1706489007340
}

Control Specific Device Type

// Control all lights in a specific area
{
  "topic": "/iot/action/light/building1/floor2/room201/area1/light1",
  "payload": {
    "action": "on",
    "value": true
  }
}

Group Control

// Control multiple devices of the same type
{
  "topic": "/iot/action/light/building1/floor2/room201/all",
  "payload": {
    "action": "off"
  }
}

API Integration

The node can integrate with external platforms through the device host configuration. Ensure your platform provides the following endpoint:

GET /esaydevice/init?mac={mac_address}&layer={node_id}

This endpoint should return device configuration data including floors, areas, and device definitions.

Troubleshooting

Common Issues

  1. Device Not Responding

    • Check device host configuration
    • Verify network connectivity
    • Ensure correct MAC address
  2. Discovery Not Working

    • Verify topic format: /iot/discover
    • Check payload structure
    • Ensure platform integration is configured
  3. Action Commands Failing

    • Verify topic pattern: /iot/action/{parameters}
    • Check device configuration
    • Ensure device supports the requested action

Debug Mode

Enable Node-RED debug mode to see detailed message flows:

  1. Add debug nodes to monitor input/output
  2. Check Node-RED logs for error messages
  3. Verify device status indicators

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

ISC License - see LICENSE file for details

Support

For support and questions:

  • Create an issue on the GitHub repository
  • Check the Node-RED community forum
  • Review the Node-RED documentation

Changelog

Version 1.0.1

  • Initial release
  • Basic device management functionality
  • Multi-protocol support
  • Spatial organization features

Note: This node requires platform integration for full functionality. Ensure your IoT platform supports the expected API endpoints and message formats.