Skip to main content

Humidity

A sensor measuring humidity of outside environment.

import { Humidity } from "@devicescript/core"

const humidity = new Humidity()

Registers

reading

The relative humidity in percentage of full water saturation.

  • type: Register<number> (packing format u22.10)

  • read only

import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
const value = await humidity.reading.read()
  • track incoming values
import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
humidity.reading.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.

readingError

The real humidity is between humidity - humidity_error and humidity + humidity_error.

  • type: Register<number> (packing format u22.10)

  • optional: this register may not be implemented

  • read only

import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
const value = await humidity.readingError.read()
  • track incoming values
import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
humidity.readingError.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.

minReading

Lowest humidity that can be reported.

  • type: Register<number> (packing format u22.10)

  • constant: the register value will not change (until the next reset)

  • read only

import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
const value = await humidity.minReading.read()
note

write and read will block until a server is bound to the client.

maxReading

Highest humidity that can be reported.

  • type: Register<number> (packing format u22.10)

  • constant: the register value will not change (until the next reset)

  • read only

import { Humidity } from "@devicescript/core"

const humidity = new Humidity()
// ...
const value = await humidity.maxReading.read()
note

write and read will block until a server is bound to the client.