Item Storage Input Source ​
lua
telem.input.itemStorage (peripheralID: string)
This adapter produces a metric for each item ID in an item storage peripheral (chest, barrel, etc.), with the metric name being the item ID and the value being the total number of that item in storage.
Usage ​
lua
local telem = require 'telem'
local backplane = telem.backplane()
:addInput('my_items', telem.input.itemStorage('minecraft:chest_2'))
:cycleEvery(1)()
Given a chest peripheral with the ID minecraft:chest_2
and the following inventory:
This appends the following metrics to the backplane:
Name | Value | Unit |
---|---|---|
storage:minecraft:redstone | 45 | item |
storage:minecraft:spruce_planks | 8 | item |