ItemValue

React component. Outputs a single item value. If OID is specified, updated automatically in real-time.

Example

../../_images/itemvalue.png
import { ItemValue } from "@eva-ics/webengine-react";

const MyComponent = () => {
  return (
    <>
      <div>
        <ItemValue oid="sensor:env/temp" digits="2" units="C" />
      </div>
      <div>
        <ItemValue oid="sensor:env/hum" digits="2" units="%" />
      </div>
    </>
  );
};

Parameters

name

type

required

description

oid

string

no

item OID

state

ItemState

no

item state

digits

number

no

round digits after comma

units

string

no

value units

threshold

Array<ItemValueThreshold>

no

alters value CSS classes according to threshold rules

format_with

(value: any) => any

no

a custom function to format value

engine

Eva

no

WebEngine object (if no default set)

Interfaces

ItemValueThreshold

interface ItemValueThreshold {
  value: number;
  class: string;
}

CSS classes

name

description

span.eva.state

base class

ok

item status = 1 (ok)

error

item status = -1 (error)

disconnected

the source node is disconnected