Create / change / delete Flow rules
myio_flow_saveSaves or updates myIO flow rules, variables, hooks, or the full flows.jsn file, validates changes first, and reloads the engine without restarting.
Instructions
Edit flows.jsn and reload the engine (no restart). Give ONE of: flow (a whole rule object; replaces the rule with the same id or adds it), delete (flow id), variable {id,name,init} / delete_variable, hook {id,name,met,url,body,err,gap} / delete_hook, or file (the complete flows.jsn). The rule is validated against the controller's card rules first; nothing is written on error. dry_run=true only validates. Card format (keys are short): WHEN t=sens{src:thermo|hum|usens, ch|id, op:gt|lt, val x10, hyst x10} | scmp | out{id, dir 0 off/1 on/2 any} | time{min, days} | sun{ev:rise|set, off} | var{id, op, val} | boot; AND t=sens | scmp | out{id, on 0|1} | twin{from, to, days} | var; THEN t=rel|grp{id, act 0 off/1 on/2 toggle} | pca|fet{id, val 0..255} | delay{s|m} | var{id, op:set|inc|dec, val} | log{val} | msg | http{id: webhook slot, val}. days = bitmask bit0=Mon..bit6=Sun (127 = every day); minutes of day for time/twin; temperatures x10 (21.5 °C = 215). Full reference: myio_reference topic=flow. Editor/admin level.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "myio_flow_save"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | the complete flows.jsn (replaces everything) | |
| flow | No | {"id":1,"name":"...","en":1,"when":{...},"and":[...],"then":[...]} | |
| hook | No | ||
| delete | No | flow id to delete | |
| server | No | controller name (default Ground floor) | |
| dry_run | No | ||
| variable | No | ||
| delete_hook | No | ||
| delete_variable | No |