Edge rule in rules engine fails to trigger when device sends telemetry data

We’ve configured an edge rule in Watson IoT Platform v25 that should trigger when temperature exceeds threshold, but it’s not activating when our edge gateway sends device data. The rule works fine when we test it through the platform UI with sample payloads.

Our edge gateway uses a custom CA certificate for MQTT TLS connections, and devices are publishing telemetry every 30 seconds. The rule is supposed to generate critical alerts for values above 85°C, but we’re seeing temperatures of 92°C in the device registry without any rule triggers.

We’re concerned about the MQTT TLS configuration and whether the event schema from edge devices matches what the rules engine expects. Has anyone encountered issues with custom certificates affecting rule processing at the edge?

Before marking this resolved, document one more critical aspect that often gets missed with edge rules and custom certificates.


// Edge Gateway MQTT Configuration
mqtt.tls.version=TLSv1.2
mqtt.tls.cipherSuites=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
mqtt.eventType=temperature

The issue isn’t just event type matching - it’s the complete event schema validation chain:

1. Custom CA Certificate Handling: Your custom CA must be registered in Watson IoT Platform under Security > Connection Security > CA Certificates. The edge gateway’s client certificate must chain back to this CA. If the CA isn’t properly registered, the platform accepts the TLS connection but marks the device as ‘untrusted’ internally, which causes the rules engine to skip processing events from that source as a security measure.

Verify CA registration:

  • Navigate to Security > Connection Security
  • Confirm your CA certificate is listed and status shows ‘Active’
  • Check the certificate expiration date
  • Ensure ‘Allow Rules Processing’ is enabled for this CA

2. MQTT TLS Configuration: For edge gateways with custom certificates, the MQTT topic structure must include the correct device type and event type. Your corrected topic should be:


iot-2/type/{deviceType}/id/{deviceId}/evt/temperature/fmt/json

The TLS handshake must complete successfully AND the client certificate must be validated before the rules engine processes any events. Enable debug logging on your edge gateway:


mqtt.debug.level=TRACE
rules.engine.debug=true

This will show you exactly when the rules engine receives events and whether they’re being filtered out due to certificate trust issues.

3. Edge Rule Event Schema Matching: The rules engine validates three layers for edge deployments:

  • Event type (must match rule condition exactly - case sensitive)
  • Payload schema (JSON structure must match defined device type schema)
  • Source authentication (device must be trusted based on certificate validation)

Your rule condition should explicitly reference the event type:

{
  "condition": {
    "eventType": "temperature",
    "expression": "$event.d.temp > 85"
  }
}

The $event.d.temp path assumes your JSON payload structure is:

{"d": {"temp": 92}}

If your device publishes a flat structure like {"temp": 92}, change the expression to $event.temp > 85.

Verification Steps:

  1. Confirm CA certificate is registered and ‘Allow Rules Processing’ is enabled
  2. Verify MQTT topic includes correct event type ‘temperature’
  3. Check payload JSON structure matches rule expression path
  4. Enable debug logging to see rule evaluation attempts
  5. Test with a single device first before deploying to fleet

Common Pitfall: When you tested through the UI, it bypassed the certificate validation layer entirely - that’s why it worked. The UI test injects events directly into the rules engine with a ‘trusted’ flag. Real device events go through the full authentication and validation pipeline.

After making these changes, you should see rule triggers within one message cycle (30 seconds in your case). If critical alerts are still missing after confirming all three areas, check the rules engine logs for schema validation errors - that’s usually the final piece.

Good catch on the certificate CN! I verified and it matches. I’ve updated our edge gateway configuration to publish with event type ‘temperature’ instead of ‘temp_reading’. Testing now to see if rules trigger correctly.

Check your edge rule event type configuration. When using custom CA certificates, the edge gateway might be publishing events with a different event type identifier than what your rule is listening for. Go to Device Types > Your Device Type > Event Schemas and verify the event ID matches exactly what your rule condition specifies.

The UI test uses the rules engine’s internal event format which is different from actual device events. For edge rules specifically, the event schema matching is strict. Your custom CA cert setup is fine - that’s just for transport security. The real issue is the event type mismatch you found.

Also check if your MQTT topic structure includes the event type correctly. Should be: iot-2/type/device_type/id/device_id/evt/temperature/fmt/json

If your gateway is using ‘temp_reading’ in the topic path, that’s what the rule needs to match against.