I have a trend that I only want to plot some of the time.  This is for an A/C's set point, which I only want to plot when the A/C is actually turned on.   I'd rather not plot it as zero when it's off because that affects the Y-axis scaling.  To achieve this I'm trying to clear or nil the object's value, similar to when it's first created.
Note, this is for a C-Bus Automation Controller. The SetCBusMeasurement function doesn't accept a nil value, but can this be achieved through the standard LM libraries?
Here is my (non-working) code. The grp.find call successfully retrieves an object, but I cannot get it to clear the value:
	
	
	
	
Note, this is for a C-Bus Automation Controller. The SetCBusMeasurement function doesn't accept a nil value, but can this be achieved through the standard LM libraries?
Here is my (non-working) code. The grp.find call successfully retrieves an object, but I cannot get it to clear the value:
Code:
    if ( ac["SystemOn"] == true ) then
        SetCBusMeasurement(0, CBUS_MEASUREMENT_DEVICE, CBUS_MEASUREMENT_CHANNEL_SETPOINTACTIVE, ac["Setpoint"], CBUS_MEASUREMENT_UNIT_CELSIUS) 
    else
      log("Setpoint Active : trying to set set to nil so it doesn't plot on trend")
      local obj = grp.find("0/"..CBUS_MEASUREMENT_APP.."/"..CBUS_MEASUREMENT_DEVICE.."/"..CBUS_MEASUREMENT_CHANNEL_SETPOINTACTIVE)
      if ( obj ~= nil ) then
        obj.value = nil        
        obj.data = nil   
        obj.datahex = ""
      end
    end
