# signalk-value-txt2num

> Signalk plugin that remaps path text value fields to a number

Latest version **0.4.2** (published 2022-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install signalk-value-txt2num
pnpm add signalk-value-txt2num
yarn add signalk-value-txt2num
bun add signalk-value-txt2num
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2022-02-24 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 192.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brian Scally |
| Maintainers | scallybmhome |
| Keywords | signalk-node-server-plugin, signalk-category-utility |

## Links

- npm: https://www.npmjs.com/package/signalk-value-txt2num
- Repository: https://github.com/scallybmHome/signalk-value-txt2num
- Homepage: https://github.com/scallybmHome/signalk-value-txt2num#readme
- Issues: https://github.com/scallybmHome/signalk-value-txt2num/issues
- npm.io page: https://npm.io/package/signalk-value-txt2num

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2022-02-24
- 0.4.1 — 2022-02-24
- 0.3.4 — 2022-02-24
- 0.3.2 — 2022-02-18
- 0.3.1 — 2022-02-18
- 0.3.0 — 2022-02-18

## README

# signalk-value-txt2num
A simple Signalk plugin that remaps txt in the values field a number is a related path.
This is particularly usfull if you want to plot state graphs using Graphana or similar package.

While some plugins andd numerical values automatically, several data ingestion methods do not provide a numeric pairing.

This plugin is an add on to those ingestion methods.
To improve consistency I have adopted the naming schema used by Scott Bender - https://github.com/sbender9?tab=repositories##.

## Example 1
One of my solar converters populates it's opertional state as text in the SignalK database.

![Data view](https://github.com/scallybmHome/signalk-value-txt2num/blob/main/images/data_view.png)

'Converter 36' populates an operational state of 'off', 'bulk', 'float' and 'error' through my N2K->Ethernet gateway.
This plugin adds an "Path"+Number leaf that contains a numeric representation of the device state.

To configure the plugin 

![Plugin Config](https://github.com/scallybmHome/signalk-value-txt2num/blob/main/images/config.png)

Add the path where the test field exists, and a keyword that is contained in the source.

Then enter the text and number pairs.  The text should be an exact match for the reperesentation of the population in the SignalK database.

## Example 2
My engine interface delivers notification in a JSON form to the value field
![Data view](https://github.com/scallybmHome/signalk-value-txt2num/blob/main/images/notification.png)

Everything is much the same,  though you need to add some text to the "leaf Key" field.
In this case 'message' is added to have the plugin parse the message field.

The resultant configuration looks like :
![Data view](https://github.com/scallybmHome/signalk-value-txt2num/blob/main/images/advanced.png)

Submit the changes and you should be good to go.

--
As usual anny comments and reviews please

---
_Source: https://npm.io/package/signalk-value-txt2num · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
