Automation
With the automation module, simple rules can be executed. A rule consists of an action to be executed and a condition that must be met for the action to be executed.
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
{
"registered_triggers": [1, 2, 3, 5, 6, 9, 10, 11, 18],
"registered_actions": [1, 2, 3, 4, 5, 6, 7, 8],
"enabled_triggers": [1, 2, 6, 11, 18, 10, 5],
"enabled_actions": [1, 3, 4, 5, 6, 8, 7]
}
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. warp-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
{
"registered_triggers": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18],
"registered_actions": [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14],
"enabled_triggers": [1, 2, 4, 6, 7, 8, 11, 18, 10, 5],
"enabled_actions": [1, 3, 4, 5, 6, 8, 9, 7]
}
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. warp2-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp2/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
{
"registered_triggers": [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 16, 17, 18],
"registered_actions": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14],
"enabled_triggers": [1, 2, 4, 6, 7, 11, 18, 3, 10, 5],
"enabled_actions": [1, 3, 4, 5, 6, 8, 2, 7]
}
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. warp3-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp3/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
{
"registered_triggers": [1, 3, 12, 13, 14, 15, 16, 17, 18],
"registered_actions": [1, 2, 5, 11, 12, 13, 14, 15],
"enabled_triggers": [1, 12, 13, 14, 15, 18, 3, 16, 17],
"enabled_actions": [1, 5, 13, 15, 2, 12, 14]
}
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. wem-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. wem/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. wem2-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. wem2/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|
automation/state
The state of the automation. Indicates which conditions and actions are supported by this firmware and which of the supported conditions and actions can currently be executed. Depending on the configuration, certain conditions and actions cannot be executed, for example, MQTT messages cannot be responded to if no MQTT connection is configured.
{
"registered_triggers": [1, 2, 3, 5, 6, 9, 10, 11, 18],
"registered_actions": [1, 2, 3, 4, 5, 6, 7, 8],
"enabled_triggers": [1, 2, 6, 11, 18, 10, 5],
"enabled_actions": [1, 3, 4, 5, 6, 8, 7]
}
| Name | Description |
|---|---|
registered_triggersint[19] | Conditions known to this firmware (union tags of the trigger of a rule from
|
registered_actionsint[16] | Actions known to this firmware (union tags of the action of a rule from
|
enabled_triggersint[19] | Currently executable conditions (union tags of the trigger of a rule from
|
enabled_actionsint[16] | Currently executable actions (union tags of the action of a rule from
|
automation/config
The configuration of the automation.
# $HOST e.g. warp-AbCd
Read
curl http://$HOST/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
curl http://$HOST/automation/config -d '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
curl http://$HOST/automation/config -d '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/automation/config
{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hello World!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}
Configure two tasks:
- (Trigger 1) On weekends (wday 9), 10 minutes (minute 10) after each full hour,
(Action 1) showHello World!in the event log. - (Trigger 18) When an HTTP-GET, POST or PUT request (method 4) with content "open" is received at URL
http://$HOST/automation_trigger/garage_door,
(Action 2) send MQTT message1to topicdoor/control.
Write
With MQTT on $PREFIX/automation/config_update
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '{
"tasks": [
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]
}'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/automation/config_update -m '[
{
"trigger": [1, { "mday": -1, "wday": 9, "hour": -1, "minute": 10 }],
"action": [1, { "message": "Hallo Welt!" }]
},
{
"trigger": [
18,
{ "method": 4, "url_suffix": "garage_door", "payload": "open" }
],
"action": [
2,
{
"topic": "door/control",
"payload": "1",
"retain": false,
"use_prefix": false
}
]
}
]'
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasksobject[14] | Configured rules
|