Code Monkey home page Code Monkey logo

frosti's People

Contributors

mbtown01 avatar tgilino avatar

Stargazers

 avatar  avatar

Watchers

 avatar

frosti's Issues

Redesign around stateless device

Currently, the FROSTI device has a database and stores all of it's state and configuration there.

To build a more resilient device, we need to make the SD card completely read-only. To do this, we need to at a high level:

  • Remove our dependence on a database, keeping all local state in memory (with some reasonable buffer, say 1 month)
  • Remove grafana from the device as it requires a database to communicate w/ the device
  • Add a single-page app (hosted by the main FROSTI process) that lets the user interact with the device
  • Build a back-end API that lets the device push measurements somewhere else to be analyzed

If done well, the back-end API could be on the web of hosted locally. 1st pass would just include pushing measurements so if FROSTI reboots it can pick up where it left off, even with historic data.

We can also potentially leverage the on-board EEPROM for storing things like

  • A device UUID for the web API
  • Last known configuration (which shouldn't take too much space, not sure if this is necessary)

Optimize grafana postgres queries

Currently, we're pulling the entire window to get things like 'current temperature'. The scalar values need to have a static window of the past say 5 minutes... If the data isn't there, then something else is wrong.

Add a CLI for operating the screen and LEDs w/o running the software

Use case here is for setup where the main software isn't running, but we'd like to alert the user to what's going on. With the CLI, we can issue images to the display and operate the lights. Ideas were:

  • During setup, show progress and what the current step is
  • Clear all status at boot time

It may make sense to create a daemon service that owns both the LED ring and the epaper display (or maybe two daemons). With a simple API bound only to the local host, this daemon could run independently of the main logic and start early. This lets us do things like....

  • Simplify what's actually happening in the more critical thermostat logic
  • Separate python interpreter so that screen updates don't eat up event time

Integrate e-paper display into user interface

This should effectively replace the terminal-based version of the user interface. Even for a developer experience, the UI could be exposed via a simple python window or even an HTML page w/ some kind of refresh

Integrate a Dash-based front-end

Dash integration for a simple single-page app for configuration/setup

Guiding principles:

  • This may be the only web-based integration a user gets (e.g. w/o backend container)
  • Should some recent data, but not designed to keep all data over time, just from last boot (need back-end container)

Should expose the following:

  • General configuration (things like the setup constants, time zone?? )
  • Program (how many programs, when they run, how to respond to price)
  • Status/Insights (some simple charts showing price/temperature)
  • Controls (maybe even a web-based FROSTI w/ the buttons?!?!).

Relay open/close can cause a button to be 'pressed'

I'm pretty sure the Pi is looking for a hi->low edge. A power dip could cause enough of a voltage drop at the pi for this to look like a button press. Maybe simply looking for low->hi edges would be a better solution here.

Allow user to download full backup

We are creating the SD card to have a read-only partition (hopefully to avoid "bricking"), so we should allow the user to drop a backup to their local machine and later restore it after FROSTI comes back online and re-creates /var.

Name sucks, need a new one

thermostat
grid
power

curtailment
utilization

market
spot price
cost
bill
price
financial

open hardware, open source

warns / informs of power $$

What does it do??

  • watches the power market responds to power price
    • less cooling when power is $$, saves money
  • lights up with information on what's going on w/ price/temp
  • sees what the market is doing

Ideas:

  • Thermiser
  • COST, TOaSTy?, GHOST, really anything with OST
  • OUTPOST
  • FROSTI (Financially Responsive Open-Source Thermostat Initiative)

Integrate Influx directly into runtime via containers

Installation process should include an influx docker image so the local process can direct data here instead of somewhere off-board. Can also be used to log as events occur and not at a specific time interval. Would need to have some kind of data warehousing scheme to only keep x days/weeks/months/years of data.

Hardware fixes

  • .1 and 1 uF capacitors need redistributed for power filter near the LED drivers
  • the 4.8kOhm resistors are still NOT 0805?!?
  • cap C10 should be grouped w/ the other .1 uF caps
  • MOSI and SCLK are backwards
  • Potential issue w/ GPIO 7 and 8 being related to the SPI function??
    • Should be able to use GPIO 5 and 6 on pins 29 and 31

Add health check module to look for equipment issues

Combined with alerting, a health-check module could look at past trends and see whether the AC system is performing like it has previously.

Would probably want to combine this w/ a weather station as close to your home as possible so we can correlate outdoor/indoor temperatures.

Could potentially detect poor performance, but should be relatively easy to check for NO performance!

Design board v5

Item used to track feature requests for board v5

  • Relay feedback via GPIO so we know we've successfully opened each relay
  • Clear labels for each connection so it's obvious how to connect (includes board-to-board connections, jumpers, and even the connection to the thermostat wires to not just be color but also function)
  • Diagnostic LED header so it can be enabled/disabled
  • Encode a hardware 'version' somehow

Move data store to backend container

Currently, we're using postgres locally on the RPi to store data. This was already a fairly heavy solution, but if we want FROSTI to be as rugged as possible, frequent use of the local SD card as the backing store for Postgres is a weak spot.

If we can cache updates locally and then push data to Azure at some frequency, it would essentially eliminate the need for the local SD card to be anything but readonly.

Need to talk w/ some cloud folks on the right first steps here. A cloud-based DB with an API frontend may be ideal, but I'm sure there are lots of other ways.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.