Back to prompt library
Build an Industrial Sensor Replacement Spare Parts Dispatcher — implementation
Linked challenge: Build an Industrial Sensor Replacement Spare Parts Dispatcher
Prompt source
implementation80 lines11 sectionsNo variables1 code block
## Build
Correlate open62541 OPC UA instrumentation diagnostic codes with enterprise spare parts inventories. Generate automated warehouse pick tickets for sensors scheduled for preventive replacement.
## User
Maintenance Inventory Coordinator
## Workflow
1. Parse open62541 sensor health status nodes and diagnostic trouble code variables.
2. Map degraded sensor models to required replacement manufacturer part numbers and accessories.
3. Check plant storeroom bin balances and evaluate stock availability against scheduled outages.
4. Generate structured warehouse pick tickets and alert purchasing when replacement stocks breach safety buffers.
## Interface
Web warehouse management queue showing sensor failure triage, bin locations, and pick status.
## Data
Create synthetic JSON dumps matching open62541 sensor diagnostic variables paired with mock inventory databases.
Starter examples below are synthetic. They are not downloaded records.
## Source
[open62541 OPC UA](https://raw.githubusercontent.com/open62541/open62541/master/README.md)
Extracts standardized sensor diagnostic variable structures from the open62541 OPC UA information model.
## Tools
ollama, pydantic, sqlite3.
Ollama runs efficient local open-source models on on-premise factory servers without external cloud dependencies.
Local model deployed on Ollama capable of fast JSON structured output.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Correctly maps OPC UA diagnostic fault codes to specific sensor part numbers.
- Produces verified warehouse bin pick lists for available inventory.
- Triggers reorder purchase flags when on-hand inventory drops below minimum balance.
- Handles unrecognized sensor models by creating an engineering investigation ticket.
## Starter Examples
```json
[
{
"input": {
"sensor_node": "ns=2;s=FlowSensor_FT201",
"diagnostic_code": "ERR_PIEZO_DEGRADATION",
"sensor_model": "FLOW-MASTER-500",
"storeroom_stock": {
"FLOW-MASTER-500": 3,
"GASKET_KIT_DN50": 12
},
"min_safety_stock": 2
},
"expected_output": {
"sensor_id": "FlowSensor_FT201",
"replacement_part": "FLOW-MASTER-500",
"bin_location": "STOREROOM-A-BIN-14",
"bill_of_materials": [
"FLOW-MASTER-500",
"GASKET_KIT_DN50"
],
"pick_ticket_ready": true,
"reorder_needed": false
}
},
{
"input": {
"sensor_node": "ns=2;s=PressureSensor_PT109",
"diagnostic_code": "ERR_DIAPHRAGM_RUPTURE",
"sensor_model": "PRESS-SENS-A2",
"storeroom_stock": {
"PRESS-SENS-A2": 1
},
"min_safety_stock": 2
},
"expected_output": {
"sensor_id": "PressureSensor_PT109",
"replacement_part": "PRESS-SENS-A2",
"bin_location": "STOREROOM-B-BIN-02",
"bill_of_materials": [
"PRESS-SENS-A2"
],
"pick_ticket_ready": true,
"reorder_needed": true
}
}
]
```
## Safety
Maintains passive warehouse logistics planning; does not place live commercial supplier orders.
Use mock external writes. Require human review before any real deployment.