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

formula

string

no

value modification formula e.g. “x/1000”

digits

number

no

round digits after comma

units

string

no

value units

className

string

no

base class name

threshold

Array<ItemValueThreshold>

no

alters value CSS classes according to threshold rules

format_with

(value: any) => any

no

a custom function to format value

set_color_with

(value: any) => string | undefined

no

a custom function to set value color

set_class_name_with

(value: any) => string | undefined

no

a custom function to set CSS class

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