# Starter

# Starter


```
class Starter : Node, HasOutput
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.home.automation.Node](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node) ||
|   | ↳ | [com.google.home.automation.Starter](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter) |

*** ** * ** ***

Defines the initial triggers that activate an automation, such as a change to a trait.

Either `trait` or `event` must be set.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#Starter(com.google.home.automation.Expression,com.google.home.TraitFactory,kotlin.String)( entityExpression: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression, trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>, output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html )` Create a `Starter` instance from an entity expression, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and a `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#Starter(com.google.home.automation.Expression,com.google.home.EventFactory,kotlin.collections.List,kotlin.String)( entityExpression: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression, event: https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Event>, parameters: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/Parameter>, output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html )` Create a `Starter` from an entity expression, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and an `https://developers.home.google.com/reference/kotlin/com/google/home/Event`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#Starter(com.google.home.HasId,com.google.home.DeviceTypeFactory,com.google.home.TraitFactory,kotlin.String)( entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId, deviceType: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>?, trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>, output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html )` Create a `Starter` instance from an entity, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and a `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#Starter(com.google.home.HasId,com.google.home.DeviceTypeFactory,com.google.home.EventFactory,kotlin.collections.List,kotlin.String)( entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId, deviceType: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>?, event: https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Event>, parameters: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/Parameter>, output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html )` Create a `Starter` from an entity, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and an `https://developers.home.google.com/reference/kotlin/com/google/home/Event`. |

| ### Public properties |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#deviceType()` The device type associated with this `Starter`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HasId?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#entity()` The unique ID for the entity associated with the `Starter`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#entityExpression()` An expression that selects an entity or a list of entity associated with the `Starter` at runtime. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Event>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#event()` The `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#output()` The output. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/Parameter>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#parameters()` The Parameters for the `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#trait()` The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Starter#traitId()` The ID for the `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`. |

| ### Inherited properties |
|---|
| From [com.google.home.automation.Node](https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Node#nodeId()` String identifier of this node. | |

## Public constructors

### Starter

```
Starter(
    entityExpression: Expression,
    trait: TraitFactory<Trait>,
    output: String
)
```

Create a `Starter` instance from an entity expression, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and a `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. An entity may be a `Device` or a `Structure`.

| Parameters |
|---|---|
| `entityExpression: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` | An expression that selects an entity or a list of entities associated with the `Starter`. |
| `trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>` | The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`. |
| `output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The output. |

### Starter

```
Starter(
    entityExpression: Expression,
    event: EventFactory<Event>,
    parameters: List<Parameter> = emptyList(),
    output: String
)
```

Create a `Starter` from an entity expression, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and an `https://developers.home.google.com/reference/kotlin/com/google/home/Event`. An entity may be a `Device` or a `Structure`.

| Parameters |
|---|---|
| `entityExpression: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` | An expression that selects an entity or a list of entities associated with the `Starter`. |
| `event: https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Event>` | The `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. |
| `parameters: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/Parameter> = emptyList()` | The parameters for the `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. If no `https://developers.home.google.com/reference/kotlin/com/google/home/Event` is associated with this `Starter`, `parameters` is set to `null`. |
| `output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The output. |

### Starter

```
Starter(
    entity: HasId,
    deviceType: DeviceTypeFactory<DeviceType>? = null,
    trait: TraitFactory<Trait>,
    output: String
)
```

Create a `Starter` instance from an entity, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and a `https://developers.home.google.com/reference/kotlin/com/google/home/Trait`. An entity may be a `Device` or a `Structure`.

| Parameters |
|---|---|
| `entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId` | The unique ID for the entity associated with the `Starter`. |
| `deviceType: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>? = null` | The device type associated with this `Starter`. |
| `trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>` | The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`. |
| `output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The output. |

### Starter

```
Starter(
    entity: HasId,
    deviceType: DeviceTypeFactory<DeviceType>? = null,
    event: EventFactory<Event>,
    parameters: List<Parameter> = emptyList(),
    output: String
)
```

Create a `Starter` from an entity, a `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType`, and an `https://developers.home.google.com/reference/kotlin/com/google/home/Event`. An entity may be a `Device` or a `Structure`.

| Parameters |
|---|---|
| `entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId` | The unique ID for the entity associated with the `Starter`. |
| `deviceType: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>? = null` | The device type associated with this `Starter`. If the entity is a `Structure`, this is set to `null`. |
| `event: https://developers.home.google.com/reference/kotlin/com/google/home/EventFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Event>` | The `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. |
| `parameters: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/Parameter> = emptyList()` | The parameters for the `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`. If no `https://developers.home.google.com/reference/kotlin/com/google/home/Event` is associated with this `Starter`, `parameters` is set to `null`. |
| `output: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The output. |

## Public properties

### deviceType

```
val deviceType: DeviceTypeFactory<DeviceType>?
```

The device type associated with this `Starter`.

### entity

```
val entity: HasId?
```

The unique ID for the entity associated with the `Starter`. If the target is not a static entity, this is set to `null`.

### entityExpression

```
val entityExpression: Expression
```

An expression that selects an entity or a list of entity associated with the `Starter` at runtime.

### event

```
val event: EventFactory<Event>?
```

The `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`.

### output

```
open val output: String
```

The output.

### parameters

```
val parameters: List<Parameter>
```

The Parameters for the `https://developers.home.google.com/reference/kotlin/com/google/home/Event` associated with this `Starter`.

### trait

```
val trait: TraitFactory<Trait>?
```

The `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`.

### traitId

```
val traitId: String
```

The ID for the `https://developers.home.google.com/reference/kotlin/com/google/home/Trait` associated with this `Starter`.