var Bacon = require('baconjs')
var _ = require('lodash')

var simulatorStream = Bacon.interval(2000)
  .map(() => _.sample([randomTemperature, randomPressure, randomCurrent])())


function randomTemperature() {
  return {
    tag:  't',
    instance: _.random(1, 5),
    temperature: _.random(0, 28, true),
    vcc: _.random(3500, 4200),
    previousSampleTimeMicros: _.random(2000, 25000),
    ts: new Date()
  }
}

function randomPressure() {
  return {
    tag:  'p',
    instance: _.random(1, 5),
    pressure: _.random(960, 1028, true),
    vcc: _.random(3500, 4200),
    previousSampleTimeMicros: _.random(2000, 25000),
    ts: new Date()
  }
}

function randomCurrent() {
  return {
    tag:  'c',
    instance: _.random(1, 5),
    rawMeasurement: _.random(-1000, 1000),
    shuntVoltageMilliVolts: _.random(-50, 50, true),
    current: _.random(-20, 40, true),
    vcc: _.random(3500, 4200),
    previousSampleTimeMicros: _.random(2000, 25000),
    ts: new Date()
  }
}

module.exports = simulatorStream
@@ -165,16 +165,33 @@
 mCurrent
+, randomTankLevel
 %5D)())%0A%0A%0A
@@ -989,16 +989,244 @@
 %0A  %7D%0A%7D%0A%0A
+function randomTankLevel() %7B%0A  return %7B%0A    tag:  'w',%0A    instance: _.random(1, 5),%0A    tankLevel: _.random(0, 100),%0A    vcc: _.random(3500, 4200),%0A    previousSampleTimeMicros: _.random(2000, 25000),%0A    ts: new Date()%0A  %7D%0A%7D%0A%0A
 module.e

Add simulator source for tank level