Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions n-fuse-sta/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0 - 2026-02-03

- First version of plugin
7 changes: 7 additions & 0 deletions n-fuse-sta/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2026 Thinger.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55 changes: 55 additions & 0 deletions n-fuse-sta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Action Button

The Action Button is a compact LoRaWAN-enabled IoT button featuring tactile feedback in a very compact form factor. This wireless sensor device is designed to detect and transmit user interactions wirelessly over long-range LoRaWAN networks, enabling remote triggering, alerts, and action-based automation scenarios.

## Thinger.io Integration

The Action Button integrates with Thinger.io through LoRaWAN network servers, allowing automatic device provisioning and data visualization. The device sends uplink messages when button interactions are detected, enabling real-time event-driven applications.

## Requirements

A LoRaWAN server is required to communicate the Action Button into Thinger.io, some options are:

- [The Things Stack](https://www.thethingsindustries.com/stack/)
- [LORIOT](https://loriot.io/)
- [ChirpStack](https://www.chirpstack.io/)

Alongside, the corresponding plugin for the selected LoRaWAN server needs to be installed in your Thinger.io instance.

## Features

- **Compact Form Factor**: Ultra-compact housing designed for easy deployment
- **Tactile Feedback**: Provides tactile confirmation on button press
- **Multiple Gestures**: Supports detection of single press, double press, and long press events
- **Long Range Communication**: LoRaWAN connectivity for extended wireless range
- **Battery Powered**: Ultra-low power design for extended battery life
- **Easy Installation**: Simple mounting options for various applications

## Use Cases

- Emergency alerts and alarm triggering
- Access control and check-in systems
- Call buttons for assistance requests
- Process control triggers in industrial environments
- Event logging and attendance tracking
- Smart building automation controls
- Patient or employee notification systems

## Get Started

### Installation

Look for the plugin in the [Thinger.io Plugin Store](https://marketplace.thinger.io/) and install it in your Thinger.io instance. Once the plugin is installed a new Product will be created for this device.

### Configuration

The Product is already preconfigured, check that the auto provision prefix matches the one selected in your LoRaWAN server plugin in Thinger.io, or change it to your desire.

### Usage

Start sending uplinks for autoprovisioning devices and buckets.
This product also provides a predefined dashboard and downlinks.

## Additional Resources

- [Thinger.io Documentation](https://docs.thinger.io)
Binary file added n-fuse-sta/assets/sta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions n-fuse-sta/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"name": "n_fuse_sta",
"version": "1.0.0",
"description": "Action Button with tactile feedback in a very compact Form Factor",
"author": "Thinger.io",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/thinger-io/plugins.git",
"directory": "n-fuse-sta"
},
"metadata": {
"name": "N-Fuse STA",
"description": "Action Button with tactile feedback in a very compact Form Factor",
"image": "assets/sta.png",
"category": "devices",
"vendor": "n-fuse"
},
"resources": {
"products": [
{
"description": "Action Button with tactile feedback in a very compact Form Factor",
"enabled": true,
"name": "N-Fuse STA",
"product": "n_fuse_sta",
"profile": {
"api": {
"downlink": {
"enabled": true,
"handle_connectivity": false,
"request": {
"data": {
"path": "/downlink",
"payload": "{\n \"data\" : \"{{payload.data=\"\"}}\",\n \"port\" : {{payload.port=85}},\n \"priority\": {{payload.priority=3}},\n \"confirmed\" : {{payload.confirmed=false}},\n \"uplink\" : {{property.uplink}} \n}",
"payload_function": "",
"payload_type": "",
"plugin": "{{property.uplink.source}}",
"target": "plugin_endpoint"
}
}
},
"uplink": {
"device_id_resolver": "getId",
"enabled": true,
"handle_connectivity": true,
"request": {
"data": {
"payload": "{{payload}}",
"payload_function": "",
"payload_type": "source_payload",
"resource_stream": "uplink",
"target": "resource_stream"
}
}
}
},
"autoprovisions": {
"device_autoprovisioning": {
"config": {
"mode": "pattern",
"pattern": "n-fuse-sta-.*"
},
"enabled": true
}
},
"buckets": {
"n_fuse_sta_data_bucket": {
"backend": "mongodb",
"data": {
"payload": "{{payload}}",
"payload_function": "parseOrDecodeIncomingData",
"payload_type": "source_payload",
"resource": "uplink",
"source": "resource",
"update": "events"
},
"enabled": true,
"retention": {
"period": 3,
"unit": "months"
},
"tags": []
}
},
"code": {
"code": "function decodeThingerUplink(thingerData) {\n // 0. If data has already been decoded, we will return it\n if (thingerData.decodedPayload) return thingerData.decodedPayload;\n \n // 1. Extract and Validate Input\n // We need 'payload' (hex string) and 'fPort' (integer)\n const hexPayload = thingerData.payload || \"\";\n const port = thingerData.fPort || 1;\n\n // 2. Convert Hex String to Byte Array\n const bytes = [];\n for (let i = 0; i < hexPayload.length; i += 2) {\n bytes.push(parseInt(hexPayload.substr(i, 2), 16));\n }\n\n // 3. Dynamic Function Detection and Execution\n \n // CASE A: (The Things Stack v3)\n if (typeof decodeUplink === 'function') {\n try {\n const input = {\n bytes: bytes,\n fPort: port\n };\n var result = decodeUplink(input);\n \n if (result.data) return result.data;\n\n return result; \n } catch (e) {\n console.error(\"Error inside decodeUplink:\", e);\n throw e;\n }\n }\n\n // CASE B: Legacy TTN (v2)\n else if (typeof Decoder === 'function') {\n try {\n return Decoder(bytes, port);\n } catch (e) {\n console.error(\"Error inside Decoder:\", e);\n throw e;\n }\n }\n\n // CASE C: No decoder found\n else {\n throw new Error(\"No compatible TTN decoder function (decodeUplink or Decoder) found in scope.\");\n }\n}\n\n\n// TTN decoder\nconst trigger_type = [\n {val: 0, type: 'rtc', str: 'Scheduled time interval'},\n {val: 1, type: 'action', str: 'Single Press'},\n {val: 2, type: 'action', str: 'Double Press'},\n {val: 3, type: 'action', str: 'Long Press'},\n]\n\nfunction decodeUplink(input) {\n // assert frame port 1\n if(input.fPort != 1) return {errors: ['unknown FPort']};\n // assert protocol version 01\n if(input.bytes[0] & 0xc0 != 0x40) return {errors: ['unknown format version']};\n\n // Simplify trigger\n const trigger = (input.bytes[0] & 0x01) && ((input.bytes[1] >> 6 & 0x02 | input.bytes[0] >> 1 & 0x01) + 1);\n\n return {\n data: {\n mcu: {\n temperature: /* °C */ input.bytes[2] / 255 * 165 - 40,\n },\n info: {\n version: 0x01,\n battery: /* Voltage */ (input.bytes[1] & 0x7f) / 100 + 2,\n txpower: /* rp002 index */ input.bytes[0] >> 2 & 0x0f,\n trigger: trigger_type[trigger],\n ...(trigger && {gesture_count: input.bytes[3]}),\n }\n }\n }\n}\n",
"environment": "javascript",
"storage": "",
"version": "1.0"
},
"properties": {
"uplink": {
"data": {
"payload": "{{payload}}",
"payload_function": "",
"payload_type": "source_payload",
"resource": "uplink",
"source": "resource",
"update": "events"
},
"default": {
"source": "value"
},
"enabled": true
}
}
},
"_resources": {
"properties": []
}
}
]
}
}