Skip to main content

Cross-Device dependencies

A Device may depend on the current value of an Operation from another Device in the same Project. This is a generic capability and is not limited to any specific product category.

Examples include a relay reacting to a separate temperature sensor, a touch panel displaying values from multiple sensors, or a curtain controller reacting to a light sensor.

Configure the dependency

A Dedicated Setting page can let the installer select:

Room → Device → Operation

Use the documented Project Place and Device APIs to build the selector, then persist the selected identifiers in your Device's saved setting payload.

Snapshot and live updates are complementary

RequestDeviceLastValue — snapshot

Use this to request the latest known value after boot, reconnect, manual refresh, or before local logic that requires a current dependency value.

Publish to:

projectCode/RequestDeviceLastValue

The response arrives on:

projectCode/DeviceLastValue/{deviceSerial}

If AirNgin has no valid value, keep the dependency state unknown. Do not invent a default.

ListenToDevice — live updates

ListenToDevice is a tag inside the General Data receive channel, not a separate MQTT topic.

Subscribe to:

projectCode/ReceiveGeneralData/{deviceSerial}

Logical envelope:

{"tag":"ListenToDevice","data":"...","deviceSerial":"..."}

A common implementation pattern is:

  1. request the last value for every configured dependency after boot/reconnect;
  2. cache valid results locally;
  3. continue processing live ListenToDevice updates.

Cross-Device access is server-authorized. Selecting a Device in the settings UI does not itself grant permission.