Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rainmaker integration #7

Open
4 tasks done
martinberlin opened this issue Feb 27, 2023 · 1 comment
Open
4 tasks done

Rainmaker integration #7

martinberlin opened this issue Feb 27, 2023 · 1 comment
Assignees
Labels
Cloud Cloud devices

Comments

@martinberlin
Copy link
Owner

martinberlin commented Feb 27, 2023

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.

@martinberlin martinberlin added the Cloud Cloud devices label Feb 27, 2023
@martinberlin martinberlin self-assigned this Feb 27, 2023
martinberlin added a commit that referenced this issue Feb 27, 2023
@martinberlin
Copy link
Owner Author

@goran-mahovlic this is starting to take shape for when the S3 model is sent to fabrication.
To test it you should add any DS3231 cheap module in the same I2C than touch.

The round PCB is also done but that will need to wait until mid or end March, so there is time to review it. First prio for me would be to check that CP2102N cheaper model QFN28 works as expected before finishing S3 prototype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cloud Cloud devices
Projects
None yet
Development

No branches or pull requests

1 participant