Skip to main content

ECO2

caution

This service is rc and may change in the future.

Measures equivalent CO₂ levels.

import { ECO2 } from "@devicescript/core"

const eCO2 = new ECO2()

Registers

reading

Equivalent CO₂ (eCO₂) readings.

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

  • read only

import { ECO2 } from "@devicescript/core"

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

const eCO2 = new ECO2()
// ...
eCO2.reading.subscribe(async (value) => {
...
})
note

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

readingError

Error on the reading value.

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

  • optional: this register may not be implemented

  • read only

import { ECO2 } from "@devicescript/core"

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

const eCO2 = new ECO2()
// ...
eCO2.readingError.subscribe(async (value) => {
...
})
note

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

minReading

Minimum measurable value

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

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

  • read only

import { ECO2 } from "@devicescript/core"

const eCO2 = new ECO2()
// ...
const value = await eCO2.minReading.read()
note

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

maxReading

Minimum measurable value

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

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

  • read only

import { ECO2 } from "@devicescript/core"

const eCO2 = new ECO2()
// ...
const value = await eCO2.maxReading.read()
note

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

variant

Type of physical sensor and capabilities.

  • type: Register<number> (packing format u8)

  • optional: this register may not be implemented

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

  • read only

import { ECO2 } from "@devicescript/core"

const eCO2 = new ECO2()
// ...
const value = await eCO2.variant.read()
note

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