Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HubitatDeviceTrigger

A hubitat device trigger definition builder. Used when describing trigger definitions in automations.

Hierarchy

  • HubitatDeviceTrigger

Index

Methods

Methods

Static for

  • Creates a trigger accepting user-automations-module from specified devices. You need to specify at least one device id.

    example

    Accept all device events from one device:

    readonly triggers = [
      HubitatDeviceTrigger.for(68),
    ];
    example

    Accept events from 3 devices but only about the level or 'switch' attribute being changed:

    const DESK_LAMP = 61;
    const DRESSER_LAMP = 62;
    const TABLE_LAMP = 65;
    
    readonly triggers = [
      HubitatDeviceTrigger
        .for(DESK_LAMP, DRESSER_LAMP, TABLE_LAMP)
        .where('level', 'switch').changes(),
    ];

    Parameters

    • deviceId: number

      An ID of the device to accepts events from. You can specify more allowed device IDs using the otherDevicesIds.

    • Rest ...otherDevicesIds: number[]

      Other device IDs in case you want to allow device events from more than one device. Optional.

    Returns WithoutAttributesDefinition

Static forAllDevices

Generated using TypeDoc