Is it possibile to set actual value of device from rule?
Just in my case set ping fails to zero.
J want to count number of fails in period of time and than reset this value (from rule).
Set value of device
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Set value of device
You can call TaskValueSet.
However, if you want to run this on something other than a Dummy, you need to also check the checkbox on tools->Advanced "Allow TaskValueSet on all plugins"
N.B. this then only sets the output value, but it isn't guaranteed the plugin actually uses this value for its next update after it is initialized.
However, if you want to run this on something other than a Dummy, you need to also check the checkbox on tools->Advanced "Allow TaskValueSet on all plugins"
N.B. this then only sets the output value, but it isn't guaranteed the plugin actually uses this value for its next update after it is initialized.
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Set value of device
THX, will try
Re: Set value of device
The ping plugin has a command to (re)set the value, but the command structure is bit different:
NB: The value should be in range -1023 .. 1023.
NB2: When enabling TaskValueSet for all devices, then the TaskValueSet command will also work, as the plugin increments the currently set 'Fails' value.
I was just thinking of how this can be simplified, and still be backward compatible with older scripts, to be used like:
For addressing a specific task we have, for quite some time already, that "[taskname]." prefix, where the square brackets are optional.
Code: Select all
pingset,<taskname|tasknumber>,<value>
NB2: When enabling TaskValueSet for all devices, then the TaskValueSet command will also work, as the plugin increments the currently set 'Fails' value.
I was just thinking of how this can be simplified, and still be backward compatible with older scripts, to be used like:
Code: Select all
pingset,<value>
// with multiple instances:
[ping1].pingset,<value1>
[ping2].pingset,<value2>
/Ton (PayPal.me)
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Set value of device
OK, works!
THX once more.
THX once more.
Who is online
Users browsing this forum: Google [Bot] and 120 guests