Fix temp outside display
This commit is contained in:
parent
0c0020547b
commit
6b11226ac0
|
@ -50,8 +50,8 @@ void display_setup(bool set_show_temp_outside, char lang[2]) {
|
||||||
set_display_language(lang);
|
set_display_language(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_globals(float temperature_outside) {
|
void display_temp_outside(float mqtt_temp_outside) {
|
||||||
temperature_outside = temperature_outside;
|
temperature_outside = mqtt_temp_outside;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_begin() {
|
void display_begin() {
|
||||||
|
@ -107,10 +107,11 @@ void display_header(char* TEXT) {
|
||||||
display.setFont(u8g2_font_6x10_tr);
|
display.setFont(u8g2_font_6x10_tr);
|
||||||
display.drawStr(2,7,TEXT);
|
display.drawStr(2,7,TEXT);
|
||||||
display.drawLine(0, 8, 128, 8);
|
display.drawLine(0, 8, 128, 8);
|
||||||
display.drawLine(100, 0, 100, 8);
|
display.drawLine(94, 0, 94, 8);
|
||||||
|
display.drawLine(62, 0, 62, 8);
|
||||||
if (show_temp_outside)
|
if (show_temp_outside)
|
||||||
{
|
{
|
||||||
display.setCursor(70,7); display.print(temperature_outside,1);
|
display.setCursor(70,7); display.print(temperature_outside,1); display.print("C");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
; THE SOFTWARE.
|
; THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
void display_setup(bool set_show_temp_outside,char lang[2]);
|
void display_setup(bool set_show_temp_outside,char lang[2]);
|
||||||
void display_globals(float temperature_outside);
|
void display_temp_outside(float temperature_outside);
|
||||||
void display_begin();
|
void display_begin();
|
||||||
void display_init(char* VERSION);
|
void display_init(char* VERSION);
|
||||||
void display_logo();
|
void display_logo();
|
||||||
|
|
|
@ -37,6 +37,6 @@ void set_display_language(char lang[2])
|
||||||
{
|
{
|
||||||
title_pv = (char*)"PV modules";
|
title_pv = (char*)"PV modules";
|
||||||
title_battery = (char*)"Battery";
|
title_battery = (char*)"Battery";
|
||||||
title_grid = (char*)"Grid overview";
|
title_grid = (char*)"Grid";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -60,7 +60,7 @@ char address_grid_meter[6] = "";
|
||||||
char address_inverter[6] = "";
|
char address_inverter[6] = "";
|
||||||
char address_battery[6] = "";
|
char address_battery[6] = "";
|
||||||
char address_outside_temperature[6] = "";
|
char address_outside_temperature[6] = "";
|
||||||
char display_lang[2] = "";
|
char display_lang[6] = "";
|
||||||
long unsigned int DISPLAY_REFRESH_INTERVAL;
|
long unsigned int DISPLAY_REFRESH_INTERVAL;
|
||||||
long unsigned int DISPLAY_SCREEN_INTERVAL;
|
long unsigned int DISPLAY_SCREEN_INTERVAL;
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ void callback(char* topic, byte* message, unsigned int length) {
|
||||||
if (String(topic) == mqtt_temp_outside) {
|
if (String(topic) == mqtt_temp_outside) {
|
||||||
DynamicJsonDocument json(512);
|
DynamicJsonDocument json(512);
|
||||||
deserializeJson(json, messageTemp);
|
deserializeJson(json, messageTemp);
|
||||||
display_globals(json["value"]);
|
display_temp_outside(json["value"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//System - AC Load Phase 1
|
//System - AC Load Phase 1
|
||||||
|
@ -353,7 +353,7 @@ void setup() {
|
||||||
WiFiManagerParameter custom_address_inverter("address_inverter", "Address of vebus inverter", address_inverter, 6);
|
WiFiManagerParameter custom_address_inverter("address_inverter", "Address of vebus inverter", address_inverter, 6);
|
||||||
WiFiManagerParameter custom_address_battery("address_battery", "Address of can battery", address_battery, 6);
|
WiFiManagerParameter custom_address_battery("address_battery", "Address of can battery", address_battery, 6);
|
||||||
WiFiManagerParameter custom_address_outside_temperature("address_outside_temperature", "Address of outside temperature", address_outside_temperature, 6);
|
WiFiManagerParameter custom_address_outside_temperature("address_outside_temperature", "Address of outside temperature", address_outside_temperature, 6);
|
||||||
WiFiManagerParameter custom_display_lang("display_lang", "Display language en, de", display_lang, 2);
|
WiFiManagerParameter custom_display_lang("display_lang", "Display language en, de", display_lang, 6);
|
||||||
WiFiManager wm;
|
WiFiManager wm;
|
||||||
|
|
||||||
wm.setSaveConfigCallback(saveConfigCallback);
|
wm.setSaveConfigCallback(saveConfigCallback);
|
||||||
|
|
Loading…
Reference in a new issue