ericdmoore / casitaAzul

Casita Azul
MIT License
1 stars 0 forks source link

Automation Decision Network #3

Open ericdmoore opened 4 months ago

ericdmoore commented 4 months ago

Expected Schedule

Thermostat

Heating

Cooling

Water Cleaning

Lights

Interior + Exterior

Constraint Based Planning

Base Cases

ericdmoore commented 4 months ago

Perhaps want a heat, cool, collar mode?

Prioritize:

The decisions seem to really center on:

ericdmoore commented 4 months ago

Goal Stack

Rough Estimate of the meta algorithm

Some goals might be to

ericdmoore commented 4 months ago

Seems related to:

And potentially other types of control theory.

Consider looking for python packages or js packages that implement some type of solver for this style of problem

ericdmoore commented 4 months ago

See #2 as related inputs and outputs

ericdmoore commented 4 months ago

Heating alone is subject to PID controller style control problems.

ericdmoore commented 4 months ago

Constraints

ericdmoore commented 4 months ago

Isn't this a feedback loop with inputs of:

State(T-1) + ActionSet = State(T)

Then repeat indefinitely?

Kinda - it does not incorporate loss functions or maximization efforts to move the state towards an objective.

ericdmoore commented 4 months ago

// Assume functions for sensing, prediction, and actuation are defined elsewhere function senseCurrentState() { // Returns current system state, e.g., temperatures, power levels }

function predictFutureStates(currentState, forecasts) { // Use models to predict future states based on current state and forecasts (weather, solar) }

function determineOptimalActions(predictedStates) { // Determine the best actions to take based on predicted states to achieve objectives // This could involve solving an optimization problem }

function actuateControls(actions) { // Apply the determined actions to the system, e.g., turning relays on/off }

function mainControlLoop() { while (true) { // Main loop const currentState = senseCurrentState(); // Get current system state const forecasts = getForecasts(); // Assume this function gets weather and solar forecasts const predictedStates = predictFutureStates(currentState, forecasts); // Predict future states const optimalActions = determineOptimalActions(predictedStates); // Determine optimal actions actuateControls(optimalActions); // Actuate controls based on optimal actions

// Wait for a specified interval before next loop iteration
// This wait time depends on the specifics of your system and control requirements
sleep(timeInterval);

} }

// Start the main control loop mainControlLoop();

ericdmoore commented 4 months ago

Determine optimal actions is the same as saying minimize error or maximize objective.

ericdmoore commented 4 months ago

Perhaps the objective function includes terms like:

maximize the inside air degree-minutes below outside-ambient temperature.

But in actuality if it gave up on cooling during the hottest part of the day, and sand-bagged during the cooler parts - this would be an unsatisfactory outcome.

So potentially it's more like minimize the accumulated degree-minutes. Or Maximize the difference in projected vs actual accumulated degree minutes.

ericdmoore commented 4 months ago

Predict future states - requires some model of what various actions will do to the state.

And model updating can happen after the sleep timer.

Where updatemodel(currentState, actionsToStart, actuallyHappenedState) can all happen after the sleep and by sensing the state before the loop starts again.

Perhaps the sensor can be proxied through a memoize function to save time and battery.