title | linkTitle | weight |
---|---|---|
Parameters to Handler |
Parameters to Handler |
21 |
Parameters used to send a configuration to handlers.
Based on the the given configuration(via parameter) handler reacts
Parameter has two fields,
- to add new parameter click
+
icon - to remove a parameter click
-
icon Name
of the field should be unique. There is no special meaning for the name. use it as your reference.Value
- value can be one of the type mentioned here. To update a value click on edit icon
In YAML view, the data is encoded with base64 format to avoid syntax issues.
handlerParameters:
run_backup: >-
{"type":"backup","disabled":"","data":"cHJvdmlkZXJUeXBlOiBkaXNrCnNwZWM6CiAgc3RvcmFnZUV4cG9ydFR5cGU6IHlhbWwKICByZXRlbnRpb25Db3VudDogNQogIHRhcmdldERpcmVjdG9yeTogJycKICBwcmVmaXg6ICcnCg=="}
turn_on_light: >-
{"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiB0YXNtb3RhLnRhc21vdGFfODg3NDIxLkNvbnRyb2wuUE9XRVIKcGF5bG9hZDogJ29uJwpwcmVEZWxheTogMTBzCg=="}
Parameter types are based on the supported handlers.
Disabled is a common field across all type of parameters.
- a parameter can be enabled or disabled dynamically.
- can be disabled by setting this field as
true
- default value for this field is
false
{{< alert title="Note" >}}
All the parameter values supports template.
With template we can update the value or part of the value dynamically.
Template Guide
{{< /alert >}}
Resource can be selected by their QuickID.
- Select a
Resource Type
- enter the
id
of the resource, you will get a list of matching resources. Select a resource. - on the payload update the action or value you want to set to the selected resource
Pre Delay
is used to wait some time and perform the action.10s
- Resource handler waits 10 seconds and sets this value.
{{< alert title="Note" >}}
Pre delay parameters will be lost on the intermediate restart of the MyController server.
Example:
- You passed a resource parameter with pre delay as 1 hour.
- The parameter passed to resource handler service and this handler can perform the resource action exactly after 1 hour.
- This data is in resource handler service memory.
- If you restart your MyController service, that particular action will be lost and will not be executed. {{< /alert >}}
disabled: ''
type: resource_by_quick_id
data:
resourceType: field
quickId: tasmota.tasmota_887421.Control.POWER
payload: 'on'
preDelay: 10s
- This is exactly same as Resource By Quick ID.
- The only different is, selecting resources by Labels
- When filtering with labels it possible to get more than on resource.
- Particular action will be applied to all the resources filter by labels.
disabled: ''
type: resource_by_labels
data:
resourceType: field
labels:
group: lights
payload: 'on'
preDelay: 0s
TBD
- All the fields in email parameter is optional.
- If non of the fields entered here, taking all the fields from the Email Handler
- The field enter here is taken, for empty values updates from the Email Handler
disabled: ''
type: email
data:
from: example@example.com
to:
- example1@example.com
- example2@example.com
subject: 'Alert: Overheat detected on CPU'
body: |-
Alert: Overheat detected on CPU.
Check the status of the CPU Fan.
- other than the
Text
all the fields are optional - empty values are taken from Telegram Handler
- telegram supports different
Text
parse modes,Text
,Markdown
,Markdown V2
,HTML
.
{{< alert title="Important" color="warning" >}}
All the syntax are supported from Markdown
, Markdown V2
, HTML
.
Refer Telegram API Guide for the detailed format options.
{{< /alert >}}
disabled: ''
type: telegram
data:
chatIds:
- '20000000'
- '-4000000'
parseMode: Text
text: |-
Alert: Overheat detected on CPU.
Check the status of the CPU Fan.
Backup parameter used to execute a backup via a schedule or from a task.
- Other than the
Provider
andRetention Count
, all other inputs are optional - empty values are taken from the Backup Handler
- If you enter
Retention Count
as0
, the value will be taken from the Backup Handler
{{< alert title="Restore" >}} To restore a backup follow the Restore Guide {{< /alert >}}
disabled: ''
type: backup
data:
providerType: disk
spec:
storageExportType: yaml
targetDirectory: /mc_home/backups
prefix: scheduled
retentionCount: 10