Logic
icon: list-tree
Logic
Building blocks
Declaring conditions in YAML
conditions:
- if: "#attr(temperature) > 80"
actions:
- set: "#attr(fan_state)"
value: "HIGH"
- elif: "#attr(temperature) > 60"
actions:
- set: "#attr(fan_state)"
value: "MEDIUM"
- else:
actions:
- set: "#attr(fan_state)"
value: "LOW"{
"conditions": [
{
"if": "#attr(temperature) > 80",
"actions": [
{ "set": "#attr(fan_state)", "value": "HIGH" }
]
},
{
"elif": "#attr(temperature) > 60",
"actions": [
{ "set": "#attr(fan_state)", "value": "MEDIUM" }
]
},
{
"else": {
"actions": [
{ "set": "#attr(fan_state)", "value": "LOW" }
]
}
}
]
}Expression syntax
Sequencing with IfChain
IfChainNesting logic and actions
Validation guarantees
Best practices
Last updated

