Extend with a Custom Component
What you’ll build
1) Define the model in YAML
models:
pt100_sensor:
attributes:
temperature: 0.0
actions:
- { saw: $attr(temperature), stop_value: 14, period: 5 }
- { ramp: $attr(temperature), stop_value: 150, duration: 5, type: overshoot, overshoot: 5 }
- { noise: $ext(temperature), std: 0.01, mode: proportional }
- { contact_fault: $ext(temperature), spike_value: 500.0 } # custom extension
{
"models": {
"pt100_sensor": {
"attributes": {
"temperature": 0.0
},
"actions": [
{ "saw": "$attr(temperature)", "stop_value": 14, "period": 5 },
{ "ramp": "$attr(temperature)", "stop_value": 150, "duration": 5, "type": "overshoot", "overshoot": 5 },
{ "noise": "$ext(temperature)", "std": 0.01, "mode": "proportional" },
{ "contact_fault": "$ext(temperature)", "spike_value": 500.0 }
]
}
}
}
2) Implement the custom action (contact_fault.py)
contact_fault.py)3) Load the extension in a running SPX Server
4) Create a model and run a deterministic time simulation
Troubleshooting
Next steps
Last updated

