Skip to content

Set Device

Category: Action

Controls a HomeKit device — turn a light on/off, set brightness, adjust thermostat temperature, lock a door, or change any writable characteristic.

When to use

  • Turn lights on or off
  • Set brightness, colour temperature, or hue
  • Adjust thermostat target temperature
  • Lock or unlock a door
  • Control any HomeKit device characteristic

Configuration

  • Device — Select the accessory to control
  • Characteristic — Choose which property to set (e.g. power_state, brightness, target_temperature)
  • Value — The value to set. Supports:
    • Fixed values: 1, 80, 22.5
    • Template expressions: {{ trigger.to_value }}, {{ nodes.code1.data.result }}

The value input adapts to the characteristic type:

  • On/off characteristics show a toggle switch
  • Numeric ranges show a slider
  • Enum values show a dropdown

Output data

  • {{ nodes['<id>'].data.success }}true if the device was set successfully
  • {{ nodes['<id>'].data.value }} — The value that was sent
  • {{ nodes['<id>'].data.accessoryId }} — The device ID
  • {{ nodes['<id>'].data.characteristicType }} — The characteristic that was set

Examples

Set brightness from an HTTP response:

  1. HTTP Request → GET weather API
  2. Code → calculate brightness based on time of day
  3. Set Device → living room light, brightness = {{ nodes.code1.data.brightness }}

Mirror one device to another:

  1. Device Changed → switch A turns on
  2. Set Device → switch B, power_state = {{ trigger.to_value }}

Tips

  • The value field supports template expressions — use {{ }} to reference data from upstream nodes
  • If the device is unreachable, the action will fail — use onError: continue to proceed anyway
  • Setting a device takes a moment — HomeKit operations are asynchronous