YAML in Home Assistant

automation = [
{
'id' = '1234',
'alias' = 'my automation'
'trigger' = [
{
'entity_id' = 'sensor.foo',
'platform' = 'state',
'to' = 'off'
},
{
'entity_id' = 'sensor.bar',
'platform' = 'numeric_state',
'above' = 100
}
],
'condition' = [
{
'condition' = 'state',
'entity_id' = 'device_tracker.paulus',
'state' = 'home'
}
],
'action' = [
{
'delay' = {
'minutes' = 1,
'hours' = 0,
}
},
{
'service' = 'script.my_script',
'data_template = {
'foo' = 'bar',
'baz' = '{{ jinja2-template }}'
}
}
]
},
{
'id' = '4567',
'alias' = 'other automation'
'trigger' = [
{
'entity_id' = ....
....
}
],
'condition' = [
...
],
'action' = [
...
]
},
]
automation:
- id: 1234
alias: my automation
trigger:
- entity_id: sensor.foo
platorm: state
to: 'off'
- entity_id: sensor.bar
platform: numeric_state
above: 100
condition:
- condition: state
entity_id: device_tracker.paulus
state: home
action:
- delay:
minutes: 1
hours: 0
- service: script.my_script
data_template:
foo: bar
baz: "{{ jinja2-template }}"
- id: 4567
alias: other automation
trigger:
- entity_id: ...
...
condition:
...
action:
...
foo:
bar: baz
foo:
bar: baz
foo:
- bar: baz
foo:
- bar
- baz
{ 
'foo': None,
'bar': 'baz'
}
{
'foo': {
'bar': 'baz'
}
}
{
'foo': [
{
'bar': 'baz'
}
]
}
{
'foo': [
'bar',
'baz'
]
}
trigger:
- entity_id: xxxxxx
trigger:
- entity_id: xxxxxx
- entity_id: yyyyyy
data_template:
foo: bar
baz: "{{ jinja2 template }}"
data_template:
foo: bar
foo: baz

Adding confusion

automation: 
- alias: 'Enciende Despacho'
trigger:
platform: state
entity_id: sensor.mini_despacho
to: 'on'
automation: 
- alias: 'Enciende Despacho'
trigger:
- platform: state
entity_id: sensor.mini_despacho
to: 'on'

--

--

--

Noe over gjennomsnittlig interessert. Kjentmann i IP- og nettverksjungelen, og jobber i nLogic AS.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

From Pints to Programming:

Understanding streams in java 8

Main things you need to know about the Agile methodology and Scrum

How To Send An Email Using Amazon Simple Email Service (SES) Part-(1/3)

Streamflow on mainnet!

Kentico And Azure Integration Possibilities — Part 3 — Application Insights

Amazon S3 Storage Classes

Building a CLI application using Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ola Thoresen

Ola Thoresen

Noe over gjennomsnittlig interessert. Kjentmann i IP- og nettverksjungelen, og jobber i nLogic AS.

More from Medium

Azure DevOps Cost Savings

A Digital “Spring Cleaning”

THE BEST WAY TO KEEP YOUR PHOTOS FOREVER

Delay Buying a New Windows Development Machine