thorrak / tiltbridge

Tilt Hydrometer to WiFi Bridge
http://www.tiltbridge.com/
Other
61 stars 27 forks source link

Initial Bierbot Bricks support #262 #263

Open trmccart opened 6 months ago

trmccart commented 6 months ago

Initial support for Bierbot Bricks

trmccart commented 6 months ago

Good question! I saw it in the tilt app output as well as the Brewstatus code, I assumed it was necessary. I can try and confirm with the Bierbot folks. Thanks. On May 20, 2024, at 9:43 PM, John @.***> wrote: @thorrak commented on this pull request.

In src/sendData.cpp:

  • // Using https://www.timeanddate.com/date/durationresult.html?m1=12&d1=30&y1=1899&m2=1&d2=1&y2=1970 gives
  • // us 25,569 days from the start of Google Sheets time to the start of the Unix epoch.
  • // Bierbot is like Bierstatus and wants local time, so we allow the user to specify a time offset.
  • // Loop through each of the tilt colors cached by tilt_scanner, sending data for the configured tilt
  • for (uint8_t i = 0; i < TILT_COLORS; i++)
  • {
  • if (tilt_scanner.tilt(i)->is_loaded() && config.bierbotTiltColor == i)
  • {
  • Log.verbose(F("Starting Bierbot send.\r\n"));
  • char gravity[10];
  • char temp[6];
  • tilt_scanner.tilt(i)->converted_gravity(gravity, sizeof(gravity), false);
  • tilt_scanner.tilt(i)->converted_temp(temp, sizeof(temp), true); // Always in Fahrenheit since we don't send units
  • snprintf(payload, payload_size, "SG=%s&Temp=%s&Color=%s&Timepoint=%.11f&Beer=%s&Comment=",
  • gravity, temp, tilt_color_names[i], ((double)std::time(0) + (config.TZoffset * 3600.0)) / 86400.0 + 25569.0, config.bierbotKey);

Is the timepoint strictly required by Bierbot or is it optional? I ask, as I don't recall setting the local time in the code (and most ESP32s lack RTC hardware which would maintain time settings between reboots). I know that this is in the brewstatus code - but this was also a user contribution (and therefore it may not work 100% properly!).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>