Skip to main content

bb-eco template validate

Validate a template file without applying

Usage​

bb-eco template validate <file> [options]

Arguments​

NameDescription
<file>Template file path (.json)

Options​

OptionDescription
--csvOutput in CSV format
--jsonOutput in JSON format
--timeout <timeout>Override default timeout in milliseconds
--verboseEnable verbose/debug output
-?, -h, --helpShow help and usage information

Examples​

Validate a template file before committing it or applying it to a fleet:

bb-eco template validate es-522-baseline.json
Template is valid.
Family: ES
Models: ES-522
Sections: network, serial (2 ports), device

Validation checks the JSON shape, the schema version, that every value is inside the range the device firmware accepts and is one of its choices, and names any key an earlier BB-Eco spelled differently with its place now. It runs entirely offline (no device is contacted), so it works in CI pipelines that gate template changes.

A template that fails says how many errors it has and links the part of the template format that explains each setting, then lists every error with the values that are accepted. This ED-560 template asks two analogue outputs for a range the ED-560 does not have, and writes engineering-unit values while its ASCII data format is hexadecimal:

bb-eco template validate ed-560-baseline.json
Template validation failed: 10 errors.
How to write these settings:
Analogue and temperature lines: https://docs.brainboxes.com/api/bb-eco/template-format#io-analogue-lines

- io.analogOutputs.lines[0].fullScaleRange: '0 to 5V' is not a Full Scale Range of analog outputs - legal values are: '0 to 10V', '0 to 20mA', '4 to 20mA'.
- io.analogOutputs.lines[1].fullScaleRange: '0 to 5V' is not a Full Scale Range of analog outputs - legal values are: '0 to 10V', '0 to 20mA', '4 to 20mA'.
- io.analogOutputs.lines[0].powerOnValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[0].safeValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[1].powerOnValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[1].safeValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[2].powerOnValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[2].safeValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[3].powerOnValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.
- io.analogOutputs.lines[3].safeValue: '+00.000' is not a Hexadecimal value - the ASCII Data Format is hexadecimal, so the device reads four hex digits, 0000 to 0FFF.

The command exits 1, so a pipeline stops on it. template apply and template diff refuse such a file the same way before any device is asked.

note

template apply parses strict JSON. If you started from a commented .jsonc reference template, strip the comments before validating or applying.

This page is auto-generated from the live CLI help text. Do not edit by hand - re-run node scripts/gen-cli-reference.mjs after changes. Example sections are maintained in docs/cli-examples/ in the bb-eco repo.