scripts/randomize_item_values
- Update items with random values.
Edit
Field | Type | Required | Description |
---|---|---|---|
item_names | table | – | If parameter specified, only items with specified names will be updated |
item_ids | table | – | If parameter specified, only items with specified ids will be updated |
timeout | number | – | Amount of time in milliseconds between every item update |
cyclicality | string | – | once – update every item single time, periodic – update items value until “scripts/stop_randomize_value” executed |
- If both “item_names” and “item_ids” parameters are specified, all items that are correspond to any of those params will be executed.
- If “timeout” parameter is not specified, all item values will be changed immediately.
- If “cyclicality” is not specified, it will be handles as “once”.
Edit
Supported items value types |
---|
int |
float |
bool |
token |
rgb |
all scalable types |
Edit
Edit
Edit
{
"method": "extensions.plugin.run",
"id": "_ID_",
"params": {
"script": "HUB:test_plugin/scripts/randomize_item_values",
"scriptParams": {
"item_names": [ "thermostat_setpoint", "switch" ]
}
}
}
{
"method": "extensions.plugin.run",
"id": "_ID_",
"params": {
"script": "HUB:test_plugin/scripts/randomize_item_values",
"scriptParams": {
"cyclicality": "periodic",
"timeout": 1000
}
}
}
Edit
{
"error": null,
"id": "_ID_",
"result": {}
}