Skip to main content

villas hook

The villas hook command can be used to test filter / process hook functions.

Usage

villas-hook --help
Usage: villas-hook [OPTIONS] NAME
NAME the name of the hook function
PARAM* a string of configuration settings for the hook
OPTIONS is one or more of the following options:
-c CONFIG a JSON file containing just the hook configuration
-f FMT the input data format
-F FMT the output data format (defaults to input format)
-t DT the data-type format string
-d LVL set debug level to LVL
-v CNT process CNT smps at once
-o PARAM=VALUE provide parameters for hook configuration
-h show this help
-V show the version of the tool

Supported hooks:
- average: Calculate average over some signals
- cast: Cast signals types
- decimate: Downsamping by integer factor
- dp: Transform to/from dynamic phasor domain
- drop: Drop messages with reordered sequence numbers
- dump: Dump data to stdout
- ebm: Energy-based Metric
- fix: Fix received data by adding missing fields
- gate: Skip samples only if an enable signal is under a specified threshold
- jitter_calc: Calc jitter, mean and variance of GPS vs NTP TS
- limit_rate: Limit sending rate
- limit_value: Limit signal values
- lua: Implement hook functions or expressions in Lua
- ma: A simple moving average filter over a fixed number of past samples
- pmu_dft: This hook calculates the dft on a window
- pps_ts: Timestamp samples based GPS PPS signal
- print: Print the message to stdout or a file
- restart: Call restart hooks for current node
- rms: This hook calculates the root-mean-square (RMS) on a window
- scale: Scale signals by a factor and add offset
- shift_seq: Shift sequence number of samples
- shift_ts: Shift timestamps of samples
- skip_first: Skip the first samples
- stats: Collect statistics for the current node
- ts: Overwrite origin timestamp of samples with receive timestamp

Supported IO formats:
- csv: Comma-separated values
- gtnet: RTDS GTNET
- iotagent_ul: FIWARE IotAgent UltraLight format
- json: Javascript Object Notation
- json.edgeflex: EdgeFlex JSON format
- json.kafka: JSON Kafka schema/payload messages
- json.reserve: RESERVE JSON format
- opal.asyncip: OPAL-RTs AsyncIP example format
- protobuf: Google Protobuf
- raw: Raw binary data
- tsv: Tabulator-separated values
- value: A bare text value without any headers
- villas.binary: VILLAS binary network format
- villas.human: VILLAS human readable format
- villas.web: VILLAS binary network format for WebSockets

Example:
villas-signal random | villas-hook skip_first seconds=10

v0.11.0-56c966f-debug (built on Mar 14 2022 16:07:12)
Copyright 2014-2021, Institute for Automation of Complex Power Systems, EONERC
Steffen Vogel <StVogel@eonerc.rwth-aachen.de>