Configure Device
Once the device has been created, the only remaining task is to configure it — set the connection parameters and device-specific settings declared in the manifest's configuration section.
At this level we use programmatic tools — Enapter CLI and HTTP API. For graphical approaches, see Level 2.
You will need an API Token for both approaches.
- Enapter CLI
- HTTP API
- Enapter CLI configuration commands are not yet supported. For the most up‑to‑date usage instructions, please refer to
enapter3 --helpor the Enapter CLI repository. - This documentation will be updated once configuration support becomes available.
Ensure you're using the correct API base URL. The examples below use the Enapter Gateway hostname.
Set Configuration
Use the PATCH method to update configuration parameters for a specific group.
Update 'connection' configuration:
curl -X PATCH \
http://enapter-gateway.local/api/v3/devices/{device_id}/configuration/connection \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"set": {
"conn_str": "port://rs485",
"address": 1
}
}'
Response:
{
"configuration": {
"address": 1,
"conn_str": "port://rs485"
}
}
Update 'sensor' configuration:
Let's set a new hydrogen concentration limit:
curl -X PATCH \
http://enapter-gateway.local/api/v3/devices/{device_id}/configuration/sensor \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"set": {
"h2_limit": 3.0
}
}'
Response:
{
"configuration": {
"h2_limit": 3.0
}
}
Read Configuration
Use the GET method to read current configuration values for a group:
curl http://enapter-gateway.local/api/v3/devices/{device_id}/configuration/connection \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}'
Response:
{
"configuration": {
"address": 1,
"conn_str": "port://rs485"
}
}
Reset Configuration
Use the PATCH method with a reset array to restore parameters to their default values:
curl -X PATCH \
http://enapter-gateway.local/api/v3/devices/{device_id}/configuration/sensor \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d '{
"reset": ["h2_limit"]
}'
Response:
{
"configuration": {
"h2_limit": 4.0
}
}
The parameter is reset to its default value declared in the manifest.