Configuring output pins on HydraFerret module

Enfield Cat's Blog: Arduino and other projects.


Introduction

While HydraFerret in not intended to be a home automation system, there are times when configuring output is useful. For example you may want to sound an audible alarm or trigger a relay. When using devices such as relays to control higher voltages be very careful around electrical safety. If appropriate ask an electrician for assistance, or compliance sign off. (The HydraFerret project can take no responsibilty for how you apply the project.)

Configuration

Configuration:
    output
    output [<index> disable]
    output [<index> default <value>]
    output [<index> <pin> <relay|pwm|servo|var> <name> <rpn expression>]

Frequency of evaluation:
    interval output <1-300>

Display of output to xymon console:
    enable output
    disable output

RPN variables:
    output.<0-7>.val

description

This allows up to 8 outputs to be defined, given default values or to be disabled. When no parameter is provided to the "output" command, output configuration is listed. Parameters to the "output&quit; command are:

  1. When enabling an output a pin must be specified. This is the pin used to drive the output. For consistency even a "var" output will need a pin, but an unused or high numbered pin can be used for "var" outputs.
  2. The output type:
    • relay: This is a binary on/off output. It is on/high if the expression is greater than 0, or off/low otherwise.
    • pwm: This is a pulse width modulated output based on the rpn expression. Scale is 0 - 65535 (ie 16 bit unsigned number)
    • servo This is a variation of the pwm output which in theory may control a servo motor, but in practice might be too unstable. Scale is 0 - 100 (percent)
    • var The value is used as a variable only and not used to control an I/O pin. This is useful for creating calculated results which can be displayed. Variables are always calculated in sequence by variable number, which allows for trivial programs to be created.
  3. A name for the variable, 16 characters in length or less. Some names of "var" outputs have special meanings:
    • hibernate Hibernate for the number of seconds calculated
    • identify set the value of the identify pin to the result
    • restart Restart of the result is greater than 0
    • ota Attempt OTA update (if available) when result is 1 or more
  4. A RPN expression, which may include measured results of sensors or other output values.

To enable or disable output to display on the xymon console, use either

enable output
disable output



Thank you for visiting camelthorn.cloudHome