I think this device can also be used in real life to benefit other users, so i decided to add it to the production repository. And it makes my life easier because now it is always available on any sensor that i run.
It uses a special rule command to set the values:
Code: Select all
TaskValueSet <task nr>, <variable nr>, <value>
Just some rule samples where the first two values are set during boot and all four values are incremented each minute, using the system clock event. The dummy device is set for task nr 1, named "Dummy" and the valuenames are Dummy1, Dummy2, etc:
Code: Select all
on System#Boot do
TaskValueSet 1,1,123.45 // default value at boot
TaskValueSet 1,2,234.56 // default value at boot
endon
On Clock#Time do // this event comes in every minute
TaskValueSet 1,1,[Dummy#Dummy1]+1 // you can use a template and use things like +1 or -1 or /1000 or *100
TaskValueSet 1,2,[Dummy#Dummy2]+1
TaskValueSet 1,3,[Dummy#Dummy3]+1
TaskValueSet 1,4,[Dummy#Dummy4]+1
endon
And you can also use it to simulate something like a DHT22 when you do not have one. The required sensor data type can be set within the task.
Some people have requested variables within rules. And maybe some day we will have stuff like that. In the mean time, you may be able to use a Dummy Device for the requested purpose as it brings 4 floating number values that can be manipulated using rules. Using a dummy device also means that you can see the actual values from within the ESP web gui and you can have them send automatically like any other sensor.