Giter VIP home page Giter VIP logo

bistable-smart-switch's Introduction

Hi there πŸ‘‹

  • πŸ”­ I’m currently working on making hardware PCB adapters
  • 🌱 Learning more C, C++ and Symfony framework UX Live (PHP 8)
  • πŸ‘― Looking to collaborate on interesting embedded products and funding open source libraries that make our work easier
  • πŸ’¬ Ask me about eink controllers and Espressif chips (epdiy open source epaper controller)
  • πŸ“« How to reach me: martin AT cale.es
  • πŸ’­ If you want to generate dynamic images for your displays try CALE.es

martinberlin GitHub stats

bistable-smart-switch's People

Contributors

martinberlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lemp1102 iecomm

bistable-smart-switch's Issues

Rainmaker integration

Add this device to be paired to the ESP-Rainmaker phone app

  • Add 2 input forms: Device watts, Price per kilowatt
  • Save the updated values in NVSe
  • Make the calculation reset itself every 1st day of the month at 00:00 hours saving previous_month total in NVS
  • Design an UX that either will be present below all the time (Or a resume) and that gives extra info with a small button

Rainmaker UX preview:
Rainmaker UX preview

About time sync:
Rainmaker already does a time sync with NTP. Try to use that instead of reinventing the wheel. Problem:

/** Get printable local time string
 *
 * Get a printable local time string, with information of timezone and Daylight Saving.
 * Eg. "Tue Sep  1 09:04:38 2020 -0400[EDT], DST: Yes"
 * "Tue Sep  1 21:04:04 2020 +0800[CST], DST: No"
 *
 *
 * @param[out] buf Pointer to a pre-allocated buffer into which the time string will
 *                  be populated.
 * @param[in] buf_len Length of the above buffer.
 *
 * @return ESP_OK on success
 * @return error on failure
 */
esp_err_t esp_rmaker_get_local_time_str(char *buf, size_t buf_len);

It looks like it only returns a string butter instead of a time struct.

Another things to save in NVS and retrieve in app_main:
int type
I (292358) esp_rmaker_param: Received params: {"EPD Switch":{"Device Watts":"85"}}

float type
I (387998) esp_rmaker_param: Received params: {"EPD Switch":{"Cost of each KW":"0.46"}}

But this is not only meant to be WiFi driven for the people that do not want that. Also offer to add this stored in the Firmware without being associated to Rainmaker.

Kickstart TODOs

  • Add ESP-Rainmaker example(s)
  • Start WiKi documenting those examples and making a getting started section
  • Move C3-controller with touch PCB to this repo Hardware section

Update about this point: We will move C3 PCB when the new revision is tested. For now we copied the C3 PCB here but making a PRO version with a more powerful MCU:
ESP32-S3-WROOM-1-N8R2 (with 2MB RAM and 8MB flash) albeit more expensive at 3.9 USD this will be a more powerful option for those who want to research adding more complex Firmware or using LVGL to draw UX.

The WiKi will start soon when we have the first users of the repository.

Hardware PCB improvements

Let’s make a list of things that can be made better:

  • Move C3 design here once it’s validated
  • Add ESD protection diodes to USB
  • Research about how to add optocoupler to check that light is really consuming in main power PCB
  • Reroute things more wisely in 1.1 S3 and further C3 revisions
  • Make average consumption tests with and without WiFi in both PCB models (Rainmaker version)
  • Make sure deepsleep is a < 1.5 mA deepsleep in worst case scenario. This idea is meant to be plugged 24/7 to 220AC so we are not going to be demanding in this topic. But considering someone might use it all day connected to USB we should keep that in mind

S3 test scenario with DS3231 RTC is 50 mA avg with very short 90 mA peaks when SPI transmission takes place:
21CF4045-16B2-4BF3-962E-EFD16834FA3E

more tests added in the WiKi

Further notes:
In master now, S3 pro version, the DS3231 backup is not anymore capacitive as @Uspizig mentioned it will only keep the time a few seconds so why care spending 2 u$ in capacitors?
This is updated by a standard and available at around 0.9$ CR1220 battery connector. In hardware branch there is still the old version in case there is the need to compare something.

Kw measurements and cost calculation

In this issue we can discuss, plan, and mention it in the commits where the formula is modified.

  • DS3231 second tick calculation
  • PCF8563 second tick calculation. This one will require additional libraries modified for ESP-IDF. Pending to be merged in master

Main task will be to build a simple CPP main program that counts how much seconds the switch is on and based on this inputs:

#define DEVICE_CONSUMPTION_WATTS 100
double  DEVICE_KW_HOUR_COST    = 0.4;

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.