Skip to content

Commit d8d0ac4

Browse files
authored
chore: promote baseDeltas.json usage vs defaults.json (#223)
1 parent 97b5345 commit d8d0ac4

File tree

1 file changed

+45
-30
lines changed

1 file changed

+45
-30
lines changed

lib/help/help.md

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ___
4747
- [2.3.1.3 Delete widget](#2_3_1_3)
4848
- [2.3.1.4 Unit selection](#2_3_1_4)
4949
- [2.3.1.5 Widget Specific Settings](#2_3_1_5)
50-
- [2.3.1.5.1 Universal Widget](#2_3_1_5_1)
50+
- [2.3.1.5.1 Universal Widget (with colored zones)](#2_3_1_5_1)
5151
- [2.3.1.5.2 Compass Widget](#2_3_1_5_2)
5252
- [2.3.1.5.3 Windmeter Widget](#2_3_1_5_3)
5353
- [2.3.1.5.4 Digital DateTime Widget](#2_3_1_5_4)
@@ -340,7 +340,7 @@ ___
340340
Each widget type has specific settings.
341341

342342
<a id="2_3_1_5_1"></a>
343-
**2.3.1.5.1. Universal Widget** [Back to up menu](#2_3_1_5)
343+
**2.3.1.5.1. Universal Widget (with colored zones)** [Back to up menu](#2_3_1_5)
344344
___
345345
This widget has alternative digital and analog views.
346346
>
@@ -349,52 +349,67 @@ This widget has alternative digital and analog views.
349349
The analog view can display colored zones for value ranges.
350350
The ranges can be based on local settings in or zones fetched from the server.
351351

352-
Local settings are configured in InstrumentPanel settings and stored in the browser.
352+
In `Local` mode, the zones are configured in InstrumentPanel settings panel and stored in the browser.
353353
The configuration is limited: a single red zone from redline value to maximum value and you can set the minimum value for the gauge.
354354
>
355355
>![universal-analog-local](./help/widget-settings-analog-local.png#maxwidth)
356356
>
357-
On the server the zones are configured by modifying the **defaults.json** file in you the server settings directory.
357+
In `server` mode, the zones are configured by modifying the `~/.signalk/baseDeltas.json` file on your Signal K server.
358358
You can configure multiple zones, each associated with a state that has its own color.
359-
Only colors are configured in InstrumentPanel.
359+
In this case, only colors are configured in InstrumentPanel settings panel.
360360
Changes there take effect after server restart.
361361
>
362362
>![universal-analog-server](./help/widget-settings-analog-server.png#maxwidth)
363363
>
364-
**batteries 1** sample **defaults.json**:
365-
364+
**batteries 1** sample **baseDeltas.json**:
365+
Locate `updates/meta` section in your `baseDeltas.json`
366+
```
367+
{
368+
"context": "vessels.self",
369+
"updates": [
370+
{
371+
"meta": [
372+
```
373+
Insert content like below
366374
```
367-
"vessels": { //<= this key already exist do not insert
368-
"self": { //<= this key already exist do not insert
369-
"electrical": { //<= if this key exists, insert the following key below it
370-
"batteries": { //<= if this key exists, insert the following key below it
371-
"1": { //<= if this key exists, insert the following key below it
372-
"voltage": { //<= if this key exists, insert the following key below it
373-
"meta": {
374-
"displayName": "battery 1",
375-
"zones": [
376-
{"upper": 11.8, "state": "alarm"},
377-
{"upper": 12, "lower": 11.8, "state": "warn"},
378-
{"upper": 14.6, "lower": 12, "state": "nominal"},
379-
{"lower": 14.6, "state": "alarm"}
380-
],
381-
"displayScale": {
382-
"lower": 11.5,
383-
"upper": 15.5
384-
}
375+
{
376+
"path": "electrical.batteries.1.voltage",
377+
"value": {
378+
"displayName": "battery 1",
379+
"zones": [
380+
{
381+
"upper": 11.8,
382+
"state": "alarm"
383+
},
384+
{
385+
"upper": 12,
386+
"lower": 11.8,
387+
"state": "warn"
388+
},
389+
{
390+
"upper": 14.6,
391+
"lower": 12,
392+
"state": "nominal"
393+
},
394+
{
395+
"lower": 14.6,
396+
"state": "alarm"
385397
}
386-
}
398+
],
399+
"displayScale": {
400+
"lower": 11.5,
401+
"upper": 15.5
387402
}
388-
}
389403
}
390-
}
391404
}
392405
```
406+
Add `,` after the last `}` if your section is followed by another one.
407+
393408
**Make sure the content is valid JSON**.
394409
Using an editor that validates the format is a great help !
395410

396411
For more information on zones see [the Signal K Specification](https://signalk.org/specification/1.5.0/doc/data_model_metadata.html#metadata-for-a-data-value)
397-
and [Server FAQ](https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#how-to-add-missing-units-and-static-data)
412+
and [Server FAQ](https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#if-you-have-a-signalkbasedeltasjson-file)
398413

399414
<a id="2_3_1_5_2"></a>
400415
**2.3.1.5.2. Compass Widget** [Back to up menu](#2_3_1_5)
@@ -438,7 +453,7 @@ The configuration is manual and must be done only once on the Signal K server.
438453
- Edit the `~/.signalk/baseDeltas.json` file on your Signal K server.
439454
You can also look at this
440455
[Server FAQ](https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#if-you-have-a-signalkbasedeltasjson-file)
441-
on the format of this file.
456+
on the file format.
442457
- Locate the `updates/value` section:
443458
```
444459
[

0 commit comments

Comments
 (0)