Odczyt danych z falownika Afore

Masz pomysł na funkcjonalność lub koncepcję na rozwój projektu. Opisz wszystko tutaj.
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

W sumie chcę te dane po mqtt później pozyskać, a po włączeniu mqtt explorera, widzę dla tego kanału z falownika aż 17 topiców.... :shock:
Co tam można dostać za info?
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Przeanalizowałem te topiki i nie widzę dziennej produkcji.
Czyli wraca pytanie jak pobrać wartość kanału dla późniejszej obróbki?
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
klew
Posts: 13905
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

SOYER wrote: Sat Jul 26, 2025 4:16 pm Przeanalizowałem te topiki i nie widzę dziennej produkcji.
Czyli wraca pytanie jak pobrać wartość kanału dla późniejszej obróbki?
Z API Clouda możesz pobierać historię.
Możliwe że też bezpośrednio z falownika możesz odczytać dobową produkcję, bo to tam często jest, ale nie pamiętam czy afore miał to.

Możesz też po prostu w nocy zapamiętać stan i licząc różnicę pokazywać aktualną dobową produkcję.
Najlepsze suple dla Twojego domu :mrgreen:
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

klew wrote: Sat Jul 26, 2025 4:43 pm
SOYER wrote: Sat Jul 26, 2025 4:16 pm Przeanalizowałem te topiki i nie widzę dziennej produkcji.
Czyli wraca pytanie jak pobrać wartość kanału dla późniejszej obróbki?


Możesz też po prostu w nocy zapamiętać stan i licząc różnicę pokazywać aktualną dobową produkcję.
Dokładnie to chcę zrobić, ale nie wiem co wpisać by pobrać aktualny stan licznika...
chodzi mi o coś w stylu:
licznikEnergii->getValue();
...
o to pytam właśnie
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
klew
Posts: 13905
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

SOYER wrote: Sat Jul 26, 2025 4:51 pm
klew wrote: Sat Jul 26, 2025 4:43 pm
SOYER wrote: Sat Jul 26, 2025 4:16 pm Przeanalizowałem te topiki i nie widzę dziennej produkcji.
Czyli wraca pytanie jak pobrać wartość kanału dla późniejszej obróbki?


Możesz też po prostu w nocy zapamiętać stan i licząc różnicę pokazywać aktualną dobową produkcję.
Dokładnie to chcę zrobić, ale nie wiem co wpisać by pobrać aktualny stan licznika...
chodzi mi o coś w stylu:
licznikEnergii->getValue();
...
o to pytam właśnie
Zerknij do headera klasy afore czy tam coś jest. Jeśli nie to sprawdź klasy bazowe. Po nazwie powinieneś rozpoznać ;).
Będzie to coś z fwd/rvr active energy.
To czy fwd czy rvr to zależy jak to w tym afore było zaimplementowane.
Najlepsze suple dla Twojego domu :mrgreen:
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Jednak poproszę o pomoc kogoś kto ogarnia temat lepiej niż ja.
Potrzebuję w takim szkicu(przykład afore):

Code: Select all

#include <SuplaDevice.h>
#include <supla/pv/afore.h>

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
  // Arduino Mega with EthernetShield W5100:
  #include <supla/network/ethernet_shield.h>
  // Ethernet MAC address
  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
  Supla::EthernetShield ethernet(mac);

  // Arduino Mega with ENC28J60:
  // #include <supla/network/ENC28J60.h>
  // Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
  // ESP8266 and ESP32 based board:
  #include <supla/network/esp_wifi.h>
  Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif

void setup() {

  Serial.begin(115200);

  // Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
  char GUID[SUPLA_GUID_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

  /*
   * Having your device already registered at cloud.supla.org,
   * you want to change CHANNEL sequence or remove any of them,
   * then you must also remove the device itself from cloud.supla.org.
   * Otherwise you will get "Channel conflict!" error.
   */

  // CHANNEL0
  // Put IP address of your Afore inverter, then port, and last parametere is base64 encoded "login:password"
  // You can use any online base64 encoder to convert your login and password, i.e. https://www.base64encode.org/
  new Supla::PV::Afore(IPAddress(192, 168, 0, 59), 80, "bG9naW46cGFzc3dvcmQ=");

  /*
   * Server address is available at https://cloud.supla.org 
   * If you do not have an account, you can create it at https://cloud.supla.org/account/create
   * SUPLA and SUPLA CLOUD are free of charge
   */

  SuplaDevice.begin(GUID,              // Global Unique Identifier 
                    "svr1.supla.org",  // SUPLA server address
                    "email@address",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key
}

void loop() {
  SuplaDevice.iterate();
}
pobrać dane widoczne na obrazku poniżej, czyli "total_forward_active_energy"
Kto pomoże jak to napisać?
You do not have the required permissions to view the files attached to this post.
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Podbijam, może ktoś pomoże:)
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
Bania
Posts: 107
Joined: Wed Jul 24, 2024 5:03 pm
Location: Bielsko-Biała
Has thanked: 5 times
Been thanked: 5 times

Post

https://github.com/SUPLA/supla-device/b ... /afore.cpp

Code: Select all

if (strncmp(varName, "webdata_total_e", strlen("webdata_total_e")) ==
              0) {
            float totalProd = atof(varValue);

            totalGeneratedEnergy = totalProd * 100000;
          }
https://github.com/anarhbania/Supla
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Bania wrote: Fri Aug 01, 2025 9:18 am https://github.com/SUPLA/supla-device/b ... /afore.cpp

Code: Select all

if (strncmp(varName, "webdata_total_e", strlen("webdata_total_e")) ==
              0) {
            float totalProd = atof(varValue);

            totalGeneratedEnergy = totalProd * 100000;
          }
Dzięki za zainteresowanie, widziałem ten fragment kodu w repozytorium, domyślam się, że to on zapisuje do zmiennej stan globalnej produkcji, ale nadal nie wiem jak ten odczytany stan użyć w swoim szkicu do dalszej obróbki.
Jak w przykładzie afore pobrać wartość tej zmiennej by ją później obrobić?
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
Bania
Posts: 107
Joined: Wed Jul 24, 2024 5:03 pm
Location: Bielsko-Biała
Has thanked: 5 times
Been thanked: 5 times

Post

Spróbuj dodać funkcje:

W pliku afore.cpp dodaj

Code: Select all

unsigned _supla_int64_t getValue()
{
	return totalGeneratedEnergy;
}
W pliku afore.h dodaj

Code: Select all

unsigned _supla_int64_t getValue();
https://github.com/anarhbania/Supla

Return to “Pomysły i koncepcje”