SynapSteward ClimateCore

ClimateCore module for SynapSteward

First shot at this. The plan is to have a simple NATS consumer that listens for messages on the sensor stream, and if the values are outside of specified bounds, it will talk to an LLM and decide what to do. If the LLM reponds with a call to action, the module will send a message to the actuator stream.

The bounds for the sensors will also be picked up from a NATS stream, so that it can be changed on the fly. This will allow for “learning” to be handled by a higher-level system, and any resulting bounds updates to be pushed dynamically to the module.

So, first step is to create a NATS stream for the configuration of the sensors.

 1nats stream add config_climatecore \
 2  --subjects "config.climatecore" \
 3  --storage file \
 4  --retention limits \
 5  --discard old \
 6  --dupe-window 2m \
 7  --max-msgs 10 \
 8  --max-msgs-per-subject 10 \
 9  --max-msg-size 1024 \
10  --defaults

The message format will be a JSON object with a list of subjects and their bounds.

 1{
 2  "sensor.environmental.temperature": {
 3    "min": 20,
 4    "max": 30
 5  },
 6  "sensor.environmental.humidity": {
 7    "min": 40,
 8    "max": 60
 9  },
10  "sensor.environmental.co2": {
11    "min": 400,
12    "max": 1000
13  }
14}

Each message will be a full update of the configuration, so the module will not need to build up a state.

And for now, just push a single message to the stream with essentially a hard-coded config:

 1nats pub config_climatecore -f <<EOF
 2{
 3  "sensor.environmental.temperature": {
 4    "min": 20,
 5    "max": 30
 6  },
 7  "sensor.environmental.humidity": {
 8    "min": 40,
 9    "max": 60
10  },
11  "sensor.environmental.co2": {
12    "min": 400,
13    "max": 1000
14  }
15}
16EOF

And finally, the very first cut of the NATS consumer is here: https://github.com/venkytv/synapsteward-climatecore/tree/2fe5618

All it does is listen for messages on the sensor stream, and if the values are outside the bounds, it logs a message. The next step is to get it to talk to the LLM and actuator streams.

#synapsteward   #climatecore   #nats