Logic Machine Forum
Visualization on Failure - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Visualization on Failure (/showthread.php?tid=1129)



Visualization on Failure - Mrinj - 06.12.2017

Hi there,

I'm newbie and probably will ask dum questions but ...

Need to make failure visualization and warning on a project with 85 emergency ECGs connected to DALI and HL for wrong searching ECGs and battery change need.
Any suggestions, recommendations or guide lines?
Will touch visualization be the easiest?
Will the HL DALI app help?
How about alerts and logs?

Kind regards!


RE: Visualization on Failure - Erwin van der Zwart - 06.12.2017

Hi,

Yes DALI app shows status but does not generate alerts, you can use the alert manager app for that.

The GW has error object that you can use to trigger alert manager and there you can notify to check the DALI app for detailed information.

BR,

Erwin


RE: Visualization on Failure - Mrinj - 06.12.2017

Thank you for your replay and guides, Erwin!

The DALI app does not show any ECGs og Groups no matter that I imported ESF file from ETS and object are shown. What did I miss?
Is there any manual for these apps online?
Sorry for this but: what is GW?


RE: Visualization on Failure - Erwin van der Zwart - 06.12.2017

Hi,

What brand DALI gateway (GW) do you use? If you use our MTN6725-0001 then you can connect it to IP and add the used IP address in the DALI app, then you can see all info from the GW. The DALI app doesn't use any ETS information. The app does not work on other brand GW's

BR,

Erwin


RE: Visualization on Failure - Mrinj - 06.12.2017

I use MTN6725-0001 with IP, accessible and configured with ECGs and Groups via browser. The app finds the GW, name and IP, but there are no ECGs or DALI Groups present in the app.


RE: Visualization on Failure - Mrinj - 07.12.2017

I solved the problem and ECGs are shown in the DALI app now. Thank you!

Erwin, you say: "The GW has error object that you can use to trigger alert manager and there you can notify to check the DALI app for detailed information."
Do I need to create an Alert script that will be active in the Alert App notifying when errors at the DALI ECGs?
Does the Alert app send email or other modifications? How does the Alert app notify the user or programmer?


RE: Visualization on Failure - Mrinj - 09.12.2017

Hello again,

Did some more testing, reading and forum search. Made scripts for email warning and alerts as Erwin described. Great Apps!!!
Thank you Erwin for your support! Thank you all for at this place exists!

Kind regards!


RE: Visualization on Failure - Erwin van der Zwart - 09.12.2017

Hi,

Good to hear you got it up and running.

Here is another thing you probably would like to use in combination with the DALI app (:
.lua   Mail DALI report as attachment version 1_0.lua (Size: 3.22 KB / Downloads: 43)


Create a scheduled script on the 1th of the month and attach this script to it, you will automatically get a report of the burning hours, failures, etc once a month.

BR,

Erwin


RE: Visualization on Failure - Mrinj - 10.12.2017

Wow! Thanks a lot, Edwin!!!


RE: Visualization on Failure - FatMax - 22.02.2018

@Erwin:

Will the Dali app support the new 2x64 gateway from Schneider?


RE: Visualization on Failure - Erwin van der Zwart - 22.02.2018

Hi,

No it won't as the new DALI gateway's have no IP so there is no API to fetch the data from.

So the app is only usable with the Premium gateway MTN6725-0001 and not with MTN6725-0003 or MTN6725-0004

BR,

Erwin


RE: Visualization on Failure - FatMax - 22.02.2018

Oh, I didn’t know it doesn’t have IP. Is it set up through ETS only then?


RE: Visualization on Failure - Erwin van der Zwart - 22.02.2018

Hi,

Yes it works with ETS app, you can download the application and app from our website:

https://www.schneider-electric.com/en/download/search/MTN6725-0003/?

BR,

Erwin


RE: Visualization on Failure - manos@dynamitec - 05.03.2024

Hello Erwin, Daniel, admin

We have a project in Brussels (Gare Maritime) where we are using 109 Dali gateways from Schneider (MTN6725-0001, 0003, 0004).
There are 11 buildings with 4 floors each and we have a Spacelynk per building.

The maintenance company asked us if it's possible to check all Dali GWs for errors and send them a report by mail every two weeks.

According to the manual (see attachement), we have made available object 20/22 1byte central diagnostics value 238.600 per Dali channel.

Since my lua skills very basic, could you help me implement this function in a sophisticated way?

Kind regards,


RE: Visualization on Failure - admin - 05.03.2024

238.600 1 byte DALI diagnostics data type is supported out of the box. In scripts you will get the diagnostics value as a table with 3 fields: address (number), ballasterror (bool) and lamperror (bool)

You can use this solution for CSV export: https://kb.logicmachine.net/scripting/export-last-hour-csv/

Currently grp.decodevalue() does not support 238.600 conversion to a readable string value so an additional conversion function is needed:
Code:
function dalidiagtostring(value)
  local stat

  if value.ballasterror then
    stat = 'ECG error'
  elseif value.lamperror then
    stat = 'Lamp error'
  else
    stat = 'OK'
  end

  return string.format('Address %d %s', value.address, stat)
end



RE: Visualization on Failure - manos@dynamitec - 05.03.2024

(05.03.2024, 10:50)admin Wrote: 238.600 1 byte DALI diagnostics data type is supported out of the box. In scripts you will get the diagnostics value as a table with 3 fields: address (number), ballasterror (bool) and lamperror (bool)

You can use this solution for CSV export: https://kb.logicmachine.net/scripting/export-last-hour-csv/

Currently grp.decodevalue() does not support 238.600 conversion to a readable string value so an additional conversion function is needed:
Code:
function dalidiagtostring(value)
  local stat

  if value.ballasterror then
    stat = 'ECG error'
  elseif value.lamperror then
    stat = 'Lamp error'
  else
    stat = 'OK'
  end

  return string.format('Address %d %s', value.address, stat)
end


Hello admin,

Where should I include the function above in the following script?
Code:
require('socket.ftp')

-- ftp file
url = '/home/ftp/%s.csv'
date = os.date('%Y-%m-%d_%H-%M')
ftpfile = string.format(url, date)
-- get past 12 hours data (43200 seconds)
logtime = os.time() - 12 * 3600

-- csv buffer
buffer = {
  '"date","type","destination","name","datatype",' ..
  '"value","source","sender","login/meta"'
}

-- get object logs
query = [[
  SELECT ol.*, o.name, o.datatype
  FROM objectlog ol
  LEFT JOIN objects o ON ol.address=o.id
  WHERE logtime >= ?
  ORDER BY id DESC
]]

function fmtdpt(dpt)
  if dpt >= 1000 then
    dpt = string.format('%0.3f', dpt / 1000)
  end

  return dpt
end

for _, row in ipairs(db:getall(query, logtime)) do
  id = tonumber(row.address) or 0
  ia = tonumber(row.src) or 0

  logdate = os.date('%Y.%m.%d %H:%M:%S', math.floor(row.logtime))
  etype = row.eventtype
  textdpt = nil

  if (etype == 'write' or etype == 'response') and row.datatype then
    textdpt = fmtdpt(row.datatype)
    value = grp.decodevalue(row.datahex, row.datatype)
  else
    value = ''
  end

  buffer[ #buffer + 1 ] = string.format('%q,%q,%q,%q,%q,%q,%q,%q,%q',
    logdate,
    etype,
    buslib.decodega(id),
    row.name or '',
    tostring(textdpt or ''),
    tostring(value),
    ia > 0 and buslib.decodeia(ia) or 'local',
    row.sender or '',
    row.meta or ''
  )
end

if #buffer > 1 then
  data = table.concat(buffer, '\r\n')
  io.writefile(ftpfile, data)
end

Since we log other objects also can we implement this but only for Tagged with  'Dali Error' objects?

P.S. Is there a known issue with email notifications subscription on threads? It seems that I cannot get emails for the last month or so.


RE: Visualization on Failure - admin - 05.03.2024

1. Place the function definition after require('socket.ftp')

2. Replace this line:
Code:
value = grp.decodevalue(row.datahex, row.datatype)

With these:
Code:
if row.datatype == dt.dalidiag then
  value = busdatatype.decode(row.datahex, row.datatype)
  value = dalidiagtostring(value)
else
  value = grp.decodevalue(row.datahex, row.datatype)
end

Thanks for letting us know, we will take a look into email notifications issue.


RE: Visualization on Failure - manos@dynamitec - 06.03.2024

Hello Admin,

When I look into the object value of  238.600 1 byte DALI diagnostics data type, I see that the address starts from 0 but the numbering in the Dali gateway and then on the as built plans starts from 1. I know this is a detail but is there an easy way to visually overcome this issue? It's because once the logs are exported to the CSV file, the maintenance person has to remember to add +1 on each device showing error to point out the correct light in the end.

Kind Regards


RE: Visualization on Failure - admin - 06.03.2024

Use this:
Code:
function dalidiagtostring(value)
  local stat

  if value.ballasterror then
    stat = 'ECG error'
  elseif value.lamperror then
    stat = 'Lamp error'
  else
    stat = 'OK'
  end

  return string.format('Address %d %s', value.address + 1, stat)
end