Skip to main content
Version: 1.0

BTHomeSensor

The BTHomeSensor component stands for a single sensor/object from a BTHomeDevice. It uses BTHomeSensor as RPC namespace and has the following methods:

BTHomeSensor.SetConfig

PropertyTypeDescription

id

number

Id of the component instance

config

object

Configuration that the method takes

Find more about the config properties in config section

BTHomeSensor.GetConfig

Properties:

PropertyTypeDescription

id

number

Id of the component instance

Find the BTHomeSensor.GetConfig response properties in config section

BTHomeSensor.GetStatus

Properties:

PropertyTypeDescription

id

number

Id of the component instance

Find more about the status response properties in status section

Configuration

The configuration of the BTHomeSensor component contains information about the device's mac address, display name, id, and meta data, object id and object index. To Get/Set the configuration of the BTHomeSensor component its id must be specified.

Properties:

PropertyTypeDescription

id

number

Id of the component instance

name

string or null

Name of the component instance

obj_id

number

BTHome object id in decimal

idx

number

BTHome object index

addr

string

MAC address of the physical device (a BTHomeDevice must be added first)

meta

object

Object for storing meta data

ui

object

Properties of how the component will be rendered in the UI

icon

string or null

Allows setting custom icon for the component's card by providing an external hosted image via link.

Status

The status of the BTHomeSensor component contains information about its id, the sensor value and a timestamp for when the value is received. To obtain the status of the BTHomeSensor component its id must be specified.

Properties:

PropertyTypeDescription

id

number

Id of the component instance

value

number, string or boolean

Latest sensor value

last_update_ts

number

Unix timestamp of the latest received value

Webhook Events

Available events from BTHomeSensor component that can trigger webhooks:

  • bthomesensor.value_change - produced when the value changes, supported for BTHomeSensor of type sensor.
  • bthomesensor.state_change - produced when the value changes, supported for BTHomeSensor of type binary_sensor.
  • bthomesensor.single_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.double_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.triple_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.long_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.long_double_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.long_triple_push - produced when the value changes, supported for BTHomeSensor of type button.
  • bthomesensor.rotate_left - produced when the value changes, supported for BTHomeSensor of type dimmer.
  • bthomesensor.rotate_right - produced when the value changes, supported for BTHomeSensor of type dimmer.
info

The sensor type can be checked using BTHome.GetObjectInfos method.

Examples

BTHomeSensor.SetConfig example

http://192.168.33.1/rpc/BTHomeSensor.SetConfig?id=200&config={"name":"Door status","obj_id":45}

Response

{
"restart_required": false
}

BTHomeSensor.GetConfig example

http://192.168.33.1/rpc/BTHomeSensor.GetConfig?id=200

Response

{
"id": 200,
"addr": "3c:2e:f5:71:d5:2a",
"name": "Door status",
"meta": null,
"obj_id": 45,
"idx": 3
}

BTHomeSensor.GetStatus example

http://192.168.33.1/rpc/BTHomeSensor.GetStatus?id=200

Response

{
"id": 200,
"value": false,
"last_updated_ts": 1706593991.91
}