Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

HomeLYnk - Timestamp issue for Energy Counter

SpaceLogic KNX Forum

Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • Light and Room Control
  • SpaceLogic KNX Forum
  • Re: HomeLYnk - Timestamp issue for Energy Counter
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Thomas_Rohde
Sisko Thomas_Rohde Sisko
121
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
54
Heribert_Dölger
Lt. Commander Heribert_Dölger Lt. Commander
30
FZetina
Lt. Commander FZetina Lt. Commander
27
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to SpaceLogic KNX Forum
Solved
DK-Michael
Commander DK-Michael Commander
Commander

Posted: ‎2015-12-22 04:19 AM . Last Modified: ‎2024-07-14 11:56 PM

0 Likes
9
1051
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2015-12-22 04:19 AM

HomeLYnk - Timestamp issue for Energy Counter

I have found a problem in the HomeLYnk when using the trend logger with counter values.

The data from "today" is marked as "yesterday" in the trends when viewing the data. I expect that this happens because the summations is made at midnight and therefore timestamped with the day after.

I have attached two pictures to show what I mean. As you can see on one picture, the total sum of Nov 18 is 3.2kWh but this is logged as Nov 19 on the "monthly" picture.

Does anyone have a solution to this?

//Michael

________________________________
Michael Johansen
Solution Architect
M +4528991535
E michael.johansen@se.com
LinkedIn https://www.linkedin.com/in/mich4el/
  • Thumbnail of SpaceLogic KNX - 4ʺ Touch Unit
    SpaceLogic KNX - 4ʺ Touch Unit
  • Thumbnail of KNX Push Button Dynamic Labeling, universal
    KNX Push Button Dynamic Labeling, universal
  • Thumbnail of Wiser for KNX : logic controller
    Wiser for KNX : logic controller
View products (3)
Attachments
Tags (5)
  • Tags:
  • energy server
  • gateway
  • gateways
  • homelynk
  • spacelynk
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
Sisko

Posted: ‎2015-12-24 12:49 PM

1 Like
5
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2015-12-24 12:49 PM

Hi Michael,

This is a know item and should be fixed in FW 1.4.

BR,

Erwin

See Answer In Context

Reply
Replies 9
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
Sisko

Posted: ‎2015-12-24 12:49 PM

1 Like
5
935
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2015-12-24 12:49 PM

Hi Michael,

This is a know item and should be fixed in FW 1.4.

BR,

Erwin

Reply
DK-Michael
Commander DK-Michael Commander
Commander

Posted: ‎2015-12-27 11:47 PM

0 Likes
4
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2015-12-27 11:47 PM

Hi Erwin

Thanks for the response. Is there an estimated time for the new firmware and will it fix the already logged values?

BR, Michael

________________________________
Michael Johansen
Solution Architect
M +4528991535
E michael.johansen@se.com
LinkedIn https://www.linkedin.com/in/mich4el/
Reply
sesa189443
sesa189443 Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2016-01-04 05:46 AM

1 Like
3
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-04 05:46 AM

Hi Michael

Some time in February and yes it will fix old trends. There will be new trend engine and old trends will be converted to new one during upgrade. We will also have lower sampling rate.

Regards

Daniel

Reply
DK-Michael
Commander DK-Michael Commander
Commander

Posted: ‎2016-01-10 10:37 PM

0 Likes
2
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-10 10:37 PM

Hi Daniel

Thanks! That sounds great. Will we also get an easy way to export the data from the trends to some external system. E.g. if a customer have used the HomeLYnk/SpaceLYnk as a small energy server but wants to migrate to PME?

Kind regards, Michael

________________________________
Michael Johansen
Solution Architect
M +4528991535
E michael.johansen@se.com
LinkedIn https://www.linkedin.com/in/mich4el/
Reply
sesa189443
sesa189443 Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2016-01-14 02:48 AM

1 Like
1
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-14 02:48 AM

This you can do already by scripts but in new fw we will need new script as data will be stored in different place. In new FW there will be new possibility we integrated cloud connector and via cloud we can export data to 3rt party as csv. For now this will be available in France but other countries can join on request. 

Reply
DK-Michael
Commander DK-Michael Commander
Commander

Posted: ‎2016-01-14 07:26 AM

0 Likes
0
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-14 07:26 AM

Hej Daniel

Can you share a template script for this with me?

Best regards, Michael

________________________________
Michael Johansen
Solution Architect
M +4528991535
E michael.johansen@se.com
LinkedIn https://www.linkedin.com/in/mich4el/
Reply
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
Sisko

Posted: ‎2016-01-15 05:27 AM

2 Likes
0
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-15 05:27 AM

Hi Michael,

Use this for reading trends with script and export to CSV on internal FTP server: You need to enable the server first and check credentials and IP address in the scrip (default ftp:ftp)

require('socket.ftp')

require('genohm-scada.trends')

-- ftp file

ftpfile = string.format('ftp://ftp:ftp@192.168.10.200/' .. 'All trends last month data export' .. '_%s.csv', os.date('%Y-%m-%d_%H-%M', timestamp))

-- csv buffer

buffer = {}

-- Get all trend names from DB

trends_table = db:getall('SELECT name FROM trends ORDER BY name DESC')

for _, trend_names in ipairs(trends_table) do

  -- Get current timestamp

  timestamp = os.time()

  now = os.date('*t', timestamp)

 

  trend_name = trend_names.name

 

  -- Get last month for data and determine number of days in this month

  trenddatamonth = trends.fetch(trend_name, 'month', now)

  -- Add to buffer

  table.insert(buffer, '"Average usage a month (' .. trend_name .. ')"')

  -- Add empty line

  table.insert(buffer, '""')

  -- Add header

  table.insert(buffer, trend_name .. ',"Day","Average day value"')

  for _, row in ipairs(trenddatamonth) do

    -- format csv row

    csv = string.format('%q,%q,%q', "", "" .. string.format("%02d", row[1]) .. "-" .. string.format("%02d", now.month) .. "-" .. now.year, row[2])

    -- add to buffer

    table.insert(buffer, csv)

  end

  -- Add empty line

  table.insert(buffer, '""')

  table.insert(buffer, '"Average usage a day (' .. trend_name .. ')"')

  -- Add empty line

  table.insert(buffer, '""')

  for i = 1, now.day, 1 do

    now.day = i

    average_value = 0

    trenddata = trends.fetch(trend_name, 'day', now)

    -- Add header

    table.insert(buffer, trend_name .. ',' .. string.format("%02d", i) .. '-' .. string.format("%02d", now.month) .. '-' .. now.year .. ',"Average hour value"')

    for _, row in ipairs(trenddata) do

      -- format csv row

      csv = string.format('%q,%q,%q', "", "" .. string.format("%02d", (row[1]-1)) .. ":00:00", row[2])

      -- add to buffer

      table.insert(buffer, csv)

      average_value = average_value + row[2]

    end

    -- Add empty line

    table.insert(buffer, "")

    -- add to buffer

    table.insert(buffer, "Average value month (" .. string.format("%02d", now.month) .. "-" .. now.year .. ")," .. trenddatamonth[i][2])

    -- Add empty line

    table.insert(buffer, "")

  end

end

-- upload to ftp only when there's data in buffer

if #buffer > 1 then

  result, err = socket.ftp.put(ftpfile, table.concat(buffer, '\r\n'))

  -- error while uploading

  if err then

    alert('FTP upload error: %s', tostring(err))

  end

else

  log('No data found inside trend ' .. trend_name)

end

Good luck (:

BR,

Erwin van der Zwart

Reply
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
Sisko

Posted: ‎2016-01-15 05:31 AM

2 Likes
1
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-15 05:31 AM

Hi Michael,

Use this script to read and export a single trend :

require('socket.ftp')

require('genohm-scada.trends')

trend_name = 'Your trend name to export'

-- Get current timestamp

timestamp = os.time()

now = os.date('*t', timestamp)

-- ftp file

ftpfile = string.format('ftp://ftp:ftp@192.168.10.200/' .. trend_name .. '_%s.csv', os.date('%Y-%m-%d_%H-%M', timestamp))

-- Get last month for data and determine number of days in this month

trenddatamonth = trends.fetch(trend_name, 'month', now)

log(trenddatamonth)

-- csv buffer

buffer = { '"Average usage a month"' }

-- Add empty line

table.insert(buffer, '""')

-- Add header

table.insert(buffer, trend_name .. ',"Day","Average day value"')

for _, row in ipairs(trenddatamonth) do

  -- format csv row

  csv = string.format('%q,%q,%q', "", "" .. string.format("%02d", row[1]) .. "-" .. string.format("%02d", now.month) .. "-" .. now.year, row[2])

  -- add to buffer

  table.insert(buffer, csv)

end

-- Add empty line

table.insert(buffer, '""')

table.insert(buffer, '"Average usage a day"')

-- Add empty line

table.insert(buffer, '""')

for i = 1, now.day, 1 do

  now.day = i

  average_value = 0

  trenddata = trends.fetch(trend_name, 'day', now)

  -- Add header

  table.insert(buffer, trend_name .. ',' .. string.format("%02d", i) .. '-' .. string.format("%02d", now.month) .. '-' .. now.year .. ',"Average hour value"')

  for _, row in ipairs(trenddata) do

  -- format csv row

  csv = string.format('%q,%q,%q', "", "" .. string.format("%02d", (row[1]-1)) .. ":00:00", row[2])

    -- add to buffer

    table.insert(buffer, csv)

    average_value = average_value + row[2]

  end

  -- Add empty line

  table.insert(buffer, "")

  -- add to buffer

  table.insert(buffer, "Average value month (" .. string.format("%02d", now.month) .. "-" .. now.year .. ")," .. trenddatamonth[i][2])

  -- Add empty line

  table.insert(buffer, "")

end

-- upload to ftp only when there's data in buffer

if #buffer > 1 then

  result, err = socket.ftp.put(ftpfile, table.concat(buffer, '\r\n'))

  -- error while uploading

  if err then

  alert('FTP upload error: %s', tostring(err))

  end

else

  log('No data found inside trend ' .. trend_name)

end

BR,

Erwin van der Zwart

Reply
DK-Michael
Commander DK-Michael Commander
Commander

Posted: ‎2016-01-17 11:42 PM

1 Like
0
934
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-01-17 11:42 PM

Hi Erwin

That's awesome! Thanks a lot! I will try it later this week (:

BR, Michael

________________________________
Michael Johansen
Solution Architect
M +4528991535
E michael.johansen@se.com
LinkedIn https://www.linkedin.com/in/mich4el/
Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of