Question about history bar chart?

Hi there, I have a problem when I want to only left the bar chart for _sum/ConsumptionActiveEnergy, sometimes I choose the days or months unit, the _sum/ConsumptionActiveEnergy response shows null and sometimes shows the number, I want to know how to solve this problem?

Hi, to be able to help you, i need more information. Is your problem just a displaying problem? For which periods is the response null and for which not?

Hi there, there is two problem base on the current code repo.
1st, the bar chart doesn’t show up like line chart in the month period chosen like snap


2nd, when I choose the week period in the history page, the web page will be crushed like routers and header tag changes will be mixed, I snap the console error message, but the energy chart will show up, please help me
image

Hello,

Did you implement a new language? Can you take a look into defaulttypes.ts and jump to line 129, could it be that you do not have a translation for this string? If you are using Visual Studio Code as your editor, there is a helpful plugin available. Its called “i18n ally”. It gives you a overview over all translations at once and shows you which you still have to implement. It does look like a translation problem to me.

Thank you lukasrgr, I indeed implemented a new language but my problem is bar chart doesn’t show up in the history monitor quickly and after a while, it shows up the month data like July is wrong from every day _sum/ConsumptionActiveEnergy on this channel.

In fact I add a weekly code below to fix the snap crushed problem when choosing week period time . But in the end, I still need help showing the bar chart when I choose week or month period.

public getText(translate: TranslateService): string {
  if (isSameDay(this.from, this.to)) {
    if (isSameDay(this.from, new Date())) {
      // Selected TODAY
      return translate.instant('Edge.History.today') + ", " + format(new Date(), translate.instant('General.dateFormat'));

    } else if (isSameDay(this.from, subDays(new Date(), 1))) {
      // Selected YESTERDAY
      return translate.instant('Edge.History.yesterday') + ", " + format(this.from, translate.instant('General.dateFormat'));

    } else {
      // Selected one single day
      return HistoryPeriod.getTranslatedDayString(translate, this.from) + ", " + translate.instant('Edge.History.selectedDay', {
        value: format(this.from, translate.instant('General.dateFormat'))
      });
    }

  }
  else if (isSameISOWeek(this.from, this.to) && isSameDay(this.from, startOfISOWeek(this.from)) && isSameDay(this.to, endOfISOWeek(this.to))) {
    // Selected one week
    return  format(this.from, translate.instant('General.dateFormat')) + " - " + format(this.to, translate.instant('General.dateFormat'));
  }
  else if (isSameMonth(this.from, this.to) && isSameDay(this.from, startOfMonth(this.from)) && isSameDay(this.to, endOfMonth(this.to))) {
    // Selected one month
    return HistoryPeriod.getTranslatedMonthString(translate, this.from) + " " + getYear(this.from);
  }
  // Selected one year
  else if (isSameYear(this.from, this.to) && isSameDay(this.from, startOfYear(this.from)) && isSameDay(this.to, endOfYear(this.to))) {
    return getYear(this.from).toString();

  } else {
    return translate.instant(
      'General.periodFromTo', {
      value1: format(this.from, translate.instant('General.dateFormatShort')),
      value2: format(this.to, translate.instant('General.dateFormat'))
    })
  }
}

/**
 * Returns a translated weekd

Hi,

can you provide a branch or anything, otherwise it will take too long to understand the problem.

I think the surrent branch on the open repo is showing my problem, in history page , when you choose week or month period to show the bar chart, it will fail, just so problem.

Can you tell me the branchname, i cant find it

Sorry for non update of our OpenEMS repository, and I, now, realizes this communication.

Yes as a Japanese company, we made our language implementation partially it is not fully implemented but now I can say 60% progress as a Japanese native speaker. it can be open w/o any restrictions. Howerver, on our private repository, there is code it is under NDA especially on Edge components.

So we need to work carefully to update our public repository. Again sorry for late update but we do not do any freeriding and violation of AGPL.

Sincrely,
Hiro Ikegami, CTO of Girasol Energy INC.

Well if you have a NDA, and you can not share something to help you - you need to find the Problems aswell on yourself :wink:

openEMS is open Source for a Reason - even Fenecon - the Founder of the openEMS shares Code to produce Progress in the Development !

But i guess it is normal, that Companys like you which are only out for Money dont want to share Progress :wink:

Greetings and regards
John.

Let’s calm down and not react too harsh. I met Hiro personally in the past and can approve his strong enthusiasm for open source software and understanding of open source licenses.

Unfortunately the current structure with Backend, Edge and UI mixed in the same repository with different licenses makes it difficult to handle code under NDA. At FENECON we have the same problem, as there is also a small part of our software that we are not allowed to publish because of manufacturer NDA.

As a side note: my impression from the very low number of contributions for UI is, that there are quite a lot of commercial users of OpenEMS UI that currently do not comply with the AGPL license. While our higher mission is to lower the barriers for energy management and we want to help the society on the way to 100 % renewables, we (as OpenEMS Association e.V.) will certainly have to address this problem sooner or later with the help of a lawyer.


Back to the actual problem:

From the error message “Format string contains an unescaped latin alphabet character” I strongly believe that the problem is related to the Japanese translation. Till now there has not been a translation with a non-latin alphabet.

Regards,
Stefan

2 Likes

Thank you for your following up and warm reply.

As is, we still tested OpenEMS platform in our hand and do not provide any service to others. So I am confident we do not make any violations but I am sorry for my poor management that makes my teammate is gotten doubt from this community. I will somehow return value to this community.

And for Stefan thank you your advise for original question. It is really valuable answer for us.

Sincerely,
Hiro Ikegami

1 Like