Welcome, Guest
Username: Password: Remember me

TOPIC: How to display consumption for a period.

How to display consumption for a period. 1 year 1 month ago #2678

  • Richter
  • Richter's Avatar
  • Offline
  • Junior Member
  • Posts: 25
  • Karma: 0
Thank you. But the resulting table makes rows not for days but once a day for all entries in the database.
it is stored frequently in the database. okay

But when the time comes when the resulting table calculates the difference. For example, once a day or once a month, differences will appear for everyone in the database.

I'm trying to make the counter grow in the database. It's OK. for example, write a counter to the database every 10 minutes or once an hour. That's enough. I can do that.

But the task of the daily table is to take the last entry of a specific day and subtract from it the first entry of the day. And display the result as one single line. That's the daily consumption.

The second table exactly the same, just subtract the first entry in the month from the last entry in the month. That would be the monthly status.
One column would have the month number and the other the result.

In this state, I would have to have one database for days and another for months, and save the daily database once per day and the monthly database once per month. But that would have to be exactly given the time and day when it should be saved.
I will try to read the functions for text programming to see if there is a function for this purpose.
Is there a function that can read the first and last record in a given time period from the database?

I honestly did not expect that such a simple and basic function, which is used in any applications that work with counters of supplied energy, water, fuel ... anything, would be so complicated.

Thank you very much for trying to help me.
The administrator has disabled public write access.

How to display consumption for a period. 1 year 1 month ago #2679

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 868
  • Thank you received: 126
  • Karma: -108
It's all possible to do only by using script functions: teslascada.com/HTML/database-library.html
There is no unfortunately other ways to do that.

Best regards,
Ruslan
The administrator has disabled public write access.

How to display consumption for a period. 1 year 1 month ago #2680

  • Richter
  • Richter's Avatar
  • Offline
  • Junior Member
  • Posts: 25
  • Karma: 0
I thought of using the reading of a specific value from the database via unix time.

I will try and thank you for your help
The administrator has disabled public write access.
Go to top