# rule-engine-service (Go) Status: not implemented yet. Responsibility: - Consume "new reading" events from RabbitMQ (async — delivery reliability matters more than latency here). - Load active `automation_rules` for the relevant zone/device from PostgreSQL, caching in memory/Redis to avoid a DB round-trip per event. - Evaluate rule conditions generically: `sensor_type X operator value` against the reading — no hardcoded sensor/device names, everything comes from the `automation_rules` row. - On match: call device-control-service over gRPC (needs a fast pass/fail result) and publish an event to notification-service over RabbitMQ (not latency-critical). Not this service's job: talking to MQTT or Redis directly — device state changes always go through device-control-service's gRPC API.