Thanks for the quick reply! The “constant value” block can only have a string or JSON value, but I need float (or at least integer).
Here’s the full code:
> {"id":"88456217","builderVersion":"10.18.0.4.20230828-1241-e470f1562","name":"Operating Hours (Variables)","description":"Reading out operating hours per device","builderModel":{"nodeDataArray":[{"blockType":"c8y_Output","location":"160 -456","id":"apama.analyticskit.blocks.cumulocity.CreateOperationStaticValue","type":"C8YDevice Block","parameters":[{"id":"deviceId","value":{"id":"MP_6byvp2wrl","type":"TemplateParameterReference"},"c8y_type":"c8y_deviceIdOrCurrentDevice"},{"id":"operationName","value":"c8y_Configuration"},{"id":"paramName","value":"config"},{"id":"paramValue","value":"{\"indx_read\":{\"542\":[{\"s\":0,\"l\":2}]}}"},{"id":"description","value":"Read Operating Hours","c8y_type":"pab_multiLine"}],"categoryId":"Output","key":-2},{"location":"-80 -336","id":"apama.analyticskit.blocks.core.Rounding","type":"Analytics Block","parameters":[{"id":"mode","value":"nearest"},{"id":"numDigits","value":0}],"categoryId":"Calculations","key":-6},{"blockType":"c8y_Output","location":"736 -168","id":"apama.analyticskit.blocks.cumulocity.CreateMeasurement","type":"C8YDevice Block","parameters":[{"id":"deviceId","value":{"id":"MP_6byvp2wrl","type":"TemplateParameterReference"},"c8y_type":"c8y_deviceIdOrCurrentDevice"},{"id":"fragment","value":"Operating_Hours"},{"id":"series","value":"OperatingHours"},{"id":"unit","value":"h"}],"categoryId":"Output","key":-7},{"location":"-296 -480","id":"apama.analyticskit.blocks.core.Pulse","type":"Analytics Block","parameters":[{"id":"mode","value":"on_every"}],"categoryId":"Flow Manipulation","key":-8},{"location":"-296 -336","id":"apama.analyticskit.blocks.core.ExtractProperty","type":"Analytics Block","parameters":[{"id":"propertyName","value":"c8y_Configuration.config"},{"id":"type","value":"float"},{"id":"clearOnMissing","value":false}],"categoryId":"Utilities","key":-9},{"blockType":"c8y_Input","location":"-552 -336","id":"apama.analyticskit.blocks.cumulocity.ManagedObjectInput","type":"C8YDevice Block","parameters":[{"id":"deviceId","value":{"id":"MP_6byvp2wrl","type":"TemplateParameterReference"},"c8y_type":"c8y_deviceOrGroupId"},{"id":"captureStartValue","value":false}],"categoryId":"Input","key":-11},{"location":"-552 -480","id":"apama.analyticskit.blocks.core.CronTimer","type":"Analytics Block","parameters":[{"id":"seconds","value":"0"},{"id":"minutes","value":"*"},{"id":"hours","value":"*"},{"id":"daysOfMonth","value":"*"},{"id":"months","value":"*"},{"id":"daysOfWeek","value":"*"}],"categoryId":"Utilities","key":-12},{"location":"-552 -72","id":"apama.analyticskit.blocks.core.CronTimer","type":"Analytics Block","parameters":[{"id":"seconds","value":"0"},{"id":"minutes","value":"0"},{"id":"hours","value":"2"},{"id":"daysOfMonth","value":"*"},{"id":"months","value":"*"},{"id":"daysOfWeek","value":"*"}],"categoryId":"Utilities","key":-13},{"location":"-304 -48","id":"apama.analyticskit.blocks.core.Counter","type":"Analytics Block","parameters":[],"categoryId":"Aggregates","key":-14},{"location":"-64 -72","id":"apama.analyticskit.blocks.core.Rounding","type":"Analytics Block","parameters":[{"id":"mode","value":"up"},{"id":"numDigits","value":0}],"categoryId":"Calculations","key":-15},{"blockType":"c8y_Output","location":"160 0","id":"apama.analyticskit.blocks.cumulocity.CreateMeasurement","type":"C8YDevice Block","parameters":[{"id":"deviceId","value":{"id":"MP_6byvp2wrl","type":"TemplateParameterReference"},"c8y_type":"c8y_deviceIdOrCurrentDevice"},{"id":"fragment","value":"Device Lifetime"},{"id":"series","value":"Days since first start"},{"id":"unit","value":"d"}],"categoryId":"Output","key":-16},{"location":"-296 -288","id":"apama.analyticsbuilder.blocks.ConstantValue","type":"Analytics Block","parameters":[{"id":"value","value":{"id":"MP_0yrk2ygpj","type":"TemplateParameterReference"},"c8y_type":"pab_multiLine"},{"id":"type","value":"string"}],"categoryId":"Utilities","key":-18},{"location":"-80 -288","id":"apama.analyticskit.blocks.core.ExtractProperty","type":"Analytics Block","parameters":[{"id":"propertyName","value":"text"},{"id":"type","value":"float"},{"id":"clearOnMissing","value":false}],"categoryId":"Utilities","key":-19},{"location":"136 -288","id":"apama.analyticskit.blocks.core.Rounding","type":"Analytics Block","parameters":[{"id":"mode","value":"nearest"},{"id":"numDigits","value":0}],"categoryId":"Calculations","key":-20},{"location":"408 -240","id":"apama.analyticskit.blocks.core.Expression","type":"Analytics Block","parameters":[{"id":"expression","value":"input1-input2"}],"categoryId":"Calculations","key":-17}],"linkDataArray":[{"inputId":"pulse","outputId":"createOperation","from":-8,"to":-2,"points":[-208,-480,-193,-480,-68,-480,-68,-480,57,-480,72,-480]},{"inputId":"value","outputId":"value","from":-11,"to":-9,"points":[-464,-336,-449,-336,-424,-336,-424,-336,-399,-336,-384,-336]},{"inputId":"extractedValue","outputId":"value","from":-9,"to":-6,"points":[-208,-336,-193,-336,-188,-336,-188,-336,-183,-336,-168,-336]},{"inputId":"tick","outputId":"value","from":-12,"to":-8,"points":[-464,-480,-449,-480,-424,-480,-424,-480,-399,-480,-384,-480]},{"inputId":"tick","outputId":"value","from":-13,"to":-14,"points":[-464,-72,-449,-72,-428,-72,-428,-72,-407,-72,-392,-72]},{"inputId":"count","outputId":"value","from":-14,"to":-15,"points":[-216,-72,-201,-72,-184,-72,-184,-72,-167,-72,-152,-72]},{"inputId":"roundedValue","outputId":"value","from":-15,"to":-16,"points":[24,-72,39,-72,48,-72,48,-72,57,-72,72,-72]},{"inputId":"output","outputId":"value","from":-18,"to":-19,"points":[-208,-288,-193,-288,-188,-288,-188,-288,-183,-288,-168,-288]},{"inputId":"extractedValue","outputId":"value","from":-19,"to":-20,"points":[8,-288,23,-288,28,-288,28,-288,33,-288,48,-288]},{"inputId":"roundedValue","outputId":"input1","from":-6,"to":-17,"points":[8,-336,23,-336,164,-336,164,-336,305,-336,320,-336]},{"inputId":"roundedValue","outputId":"input2","from":-20,"to":-17,"points":[224,-288,239,-288,272,-288,272,-288,305,-288,320,-288]},{"inputId":"value","outputId":"value","from":-17,"to":-7,"points":[496,-240,511,-240,572,-240,572,-240,633,-240,648,-240]}]},"c8y_analyticsModel":{},"type":"c8y_PublicAnalyticsBuilderModel","templateParameters":[{"id":"MP_6byvp2wrl","name":"In- and Output AI401","typeDisplayName":{"typeName":"c8y_deviceIdOrCurrentDeviceOrGroup","semanticType":"c8y_deviceIdOrCurrentDeviceOrGroup"},"description":"","type":"string","optional":false,"semanticType":"c8y_deviceIdOrCurrentDeviceOrGroup","defaultValue":"16437235"},{"id":"MP_0yrk2ygpj","name":"OperatingHoursZero","typeDisplayName":{"typeName":"string"},"description":"","type":"string","optional":false,"defaultValue":"0"}],"userInterfaceProperties":{"displayGrid":false},"tags":[]}