Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Displaying alerts on the DFP2 (Traffic)

  1. #1
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default Displaying alerts on the DFP2 (Traffic)

    I've been playing with the LCD screen and some alert information on the DFP002 . From xAP you can write any information to any line (except the bottom button label one) . I now have the text from an overhead motorway gantry display connected to the bottom 2 lines on my idle screen. It updates near realtime with the sign display and allows me to know when I have to set off early based on any delay info. What I'm next going to do is add more interpretation of the data to word wrap/ save screen estate and also make use of the RSS traffic feed information as well. The possibility of RSS on the screen is interesting.

    I'm also thinking of attaching a small beeper to one of the outputs on the DFP - such that it alerts me when something changes - as it can be left bleeping until cancelled without tying up the audio bus.

    One thing I would like to do though is change the colour of the idle screen by some connection within Cortex.. so it could display red when there was a problem or an alert - is this a planned feature Vivian I wonder (set any colour for lcd) ?

    I need to think carefully about 'screens' and their purpose and remove lines that have no purpose eg if there are no emails waiting why display anything. Maybe replace informational lines with alert lines as circumstances change. Also more research into how to use the buttons to drive more custom screens or information/drill down levels. Another thought was to display just the alert information (until a cancel button was pressed).

    A rough representation below of my 'in progress' idle screen ,which is cluttered and needs pruning - Heating should be a button led really - currently second line alternates every 20 secs with the weather forecast "Forecast Rain". Please note I'm using xAP to achieve this functionality rather than the inbuilt screen connections within Cortex.

    Kevin


    Temp 22.4/3.5C 14:52
    Heating Off HW 54.2C
    emails */KH/PT 61/2/0
    TelCalls/Msgs 2/1
    13:20 Anna
    To J29 (FOR M1) 12 MI
    LES 11 MINS
    Last edited by Kevin; 29th December 2008 at 03:14 PM.

  2. #2
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    603

    Default

    Kevin,

    Can you give us an overview of how you have done this? What software are you using?

    Can I assume you are using Cortex v24, the DFP is HA Network enabled in Cortex and you are sending broadcast xap packets to Cortex / DFP?

    Paul

  3. #3
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default

    Ignoring the motorway signage link for the meantime (as that's something that I'm just hacking at just now).

    What's happening here is that I have xAP informational sources or devices that are generating the information - and they are linked into Cortex. Cortex itself can of course display information from its own sensor and state type information ie IDRANet just by the connection links.

    Basically Cortex has inbuilt handling for the three types of device that xAP represents via its BSC (Basic Status and Control) schema *. BSC is the most prevalent schema in use on xAP. These three types are binary (on/off) , level (eg 0-100) and text which can be any textual type information eg 'Wind 12mph Gusty'.

    As the first two types are usually sensor type information you would normally link these to similar 'virtual' objects in Cortex. A virtual object is a functionally similar IDRANet device (eg a DTS for a temp sensor) that you don't 'network enable'. Instead you connect it's 'alternative input' to a xAP network object/device and Cortex then treats this just as if it was a real sensor. This is the way to intergrate xAP sensors into the Cortex model.

    Cortex internally as yet doesn't have many objects that handle 'text' values but the DFP002 does have this capability. So first step - find a xAP device or application that can provide the text information that you wish to display using the xAP BSC schema *. For display on the DFP002 the maximum number of characters should be 21 as that is the width of one line.

    Now you add a xAP controller object to Cortex and you create a 'schema' within that object that will match the particular xAP device you want it to listen for. Creating a schema involves telling it the schema a device uses plus the address/name of the particular xAP device and which value to pick up from that device - in this case it would be the 'text=' value and it would be linked into Cortex using 'treat as text' . Once this is done basically you can make connections from this object to other Cortex objects and as the xAP objects updates it will propogate new values to the linked Cortex objects. Just FYI You can also originate xAP messages from Cortex in which case you would link to the text connection rather than from it - ie it would be an input rather than an output.

    So now using either the xAP controller's or DFP's connections menu , you create a connection between the xAP device and a line on the DFP002 - each of the 7 lines has a connection link available. Now as soon as a xAP device sends a message that text will be displayed on the linked display line on the DFP002.

    This does of course assume that you can get the text value as presented by xAP to be formatted correctly for the display - ie 21 characters or less - but that's another post.... Myself I'm doing some string handling outside of Cortex (in xAPLand) to achieve this. It's likely possible although I haven't tried, to use the script object to achieve this purely within Cortex.

    Some xAP BSC devices use the optional 'displaytext=' field instead of 'text=' to pull together a display string for informational purposes. It's ideal for this type of application as it can add more verbosity - and in my case was what I used. It can be present on binary or level devices as well to present as 'stopped'/'running' or the units of measurement.

    If you want even more step by step info then just holler....

    K

    * Although Cortex has inbuilt BSC handling it is actually capable of handling any xAP schema and so should you for example want to display the artist / album / trackname info from a xAP music player which uses the xap-audio schema, or a telephone number or callers name using the meteor.cid schema you can do this as well - just a little bit more work....

    PS Not sure if you can apply extra string formatting to an internal Cortex text value using the Cortex script object - something I still have to investigate is that object. If so you could maybe alter the screen formatting for the existing display - for example adding the degrees symbol in temperature displays as I have done for xAP, or putting two values on one line.

    What I would caution about though is that Cortex itself manages those displays in a very consistent way and as the display is honed over time you may end up impacting the natural functionality of the display . I for example was keen to be able to label those buttons below the screen but that is managed internally by Cortex and things could easily become messed up

    Here's an example of the xAP device (my heating controller) and the xAP message that generates my second line on the display

    xap-header
    {
    v=12
    hop=1
    uid=FF015702
    class=xAPBSC.event
    source=ukusa.heating.control:Boiler.HotWater.Statu s
    }
    input.state
    {
    state=Off
    level=542/1000
    displaytext=Heating Off HW 54.2C
    }

    The above used the displaytext parameter as it originated from a level rather than text based device but could equally well have been text= had it been such a device.
    Last edited by Kevin; 29th December 2008 at 04:49 PM. Reason: added xAP message example

  4. #4
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    603

    Default

    Ok the bit I am not getting is the mapping betwen the XAP device and the object in Cortex.

    Here's a fairly simple example I am trying to work through:
    - Speedfan running on remote laptop to report temperature
    - xfx Hub installed on same server as Cortex
    - xfx Viewer installed on same server as Cortex

    I can see the output from Speedfan in xfx Viewer, in the form:
    xAP-header
    {
    v=12
    hop=1
    uid=FF671100
    class=PC.status
    source=Almico.SpeedFan.PAUL-LAPTOP
    }
    temp.1
    {
    id=GPU
    curr=72.0
    want=40
    warn=50
    }
    temp.2
    {
    id=GPU
    curr=72.0
    want=40
    warn=50
    }
    temp.3
    {
    id=Core 0
    curr=36.0
    want=40
    warn=50
    }
    temp.4
    {
    id=Core 1
    curr=42.0
    want=40
    warn=50
    }

    Now do I add a DTS object or a XAP Controller object into Cortex? Then how do I map the Speedfan XAP output to the input of the Cortex XAP object?

  5. #5
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default

    OK - This ones slightly more awkward as it's not using the BSC schema but I'll show you how to get say the temp.1 (GPU - Graphics Processor) temperature into a Cortex object and also displayed on the DFP2 LCD display.

    Basically we're going to create a Cortex xAP object that will recognise the specific information from SpeedFan and we'll use that to transfer the value to a virtual DTS sensor for display within the Cortex plan and from there we will display it on a line on the DFP2. I've tried to detail every step even though this makes it look a long process....

    1) Choose a suitable place on the Cortex layout and add a xAP controller object (Tools > Design Network > Add Other Automation Network Object >xAP >xAP Controller) - name it say 'xAP SpeedFan' and to make things easy we'll make it visible so when it says ' Items checked in the list below can be made visible in plan view ' we will tick the xAP Control. TIP: I choose to add all my xAP objects to only the User4 Layer so I can then hide them easily.

    2) Now we need to add details of the specific xAP message (schema) we want to watch for so we double click (Behaviour...) the newly created object and open its properties window. Click on 'Add New' to being up the 'xAP Schema Edit' dialog and give this entry say a name of 'SpeedFan' and select 'Received into Cortex' which means we are listening for an incoming xAP message rather than wanting to build one to send out.

    We now need to fill in the various fields to match the particular message being watched for. Here is the first part of the xAP example message you provided and we need to fill in five bits of information (bold below)

    xAP-header
    {
    v=12
    hop=1
    uid=FF671100
    class=PC.status
    source=Almico.SpeedFan.PAUL-LAPTOP
    }
    temp.1
    {
    id=GPU
    curr=72.0
    want=40
    warn=50
    }


    so basically you should fill in the following information

    match UID FF671100
    class.type PC.status
    class.type.alias <leave this blank>
    match source Almico.SpeedFan.PAUL-LAPTOP :
    block identifier temp.1
    xAP BSC.cmd behaviour <do not tick this>

    The above tells the Cortex xAP object which message type from which xAP device to listen for and which block within that message has the value we are interested in. Now we just need to tell it which of the four parameters we want - you can add just one or many of these but in our case we're just wanting the current temperature of the GPU ie curr=

    So click 'Add' at the bottom of the dialog and then in the name box type curr , above this select 'Name is matched and value is treated as level' to tell Cortex to watch for the curr parameter name and to represent the value it finds as a level (analogue) for internal connections. Lastly give the connection a name to identify it like 'SpeedFan GPU Temp' and close the dialog and also the next (schema edit) dialog.

    Last step now for the xAP object - you must click 'Enabled' in the properties window

    You should now have a template displayed in the left hand pane of the properties dialog that the Cortex xAP object is matching against - something like this.. it should exactly match your message (ignore the v=13 rather than v=12 difference).

    xap-header
    {
    v=13
    hop=1
    uid=FF671100
    class=PC.status
    source=Almico.SpeedFan.PAUL-LAPTOP
    }
    temp.1
    {
    curr=?
    }


    Note that it displays curr=? because Cortex hasn't yet received a xAP message from SpeedFan - once it does receive a message it will display the correct value ie curr=72.0 . You have to close and re-open the window however to see the updated values.

    TIP The above is a good way to check your xAP receiving object is working correctly - you can send the SpeedFan message manually/repeatedly by selecting it in xAP viewer and clicking the resend button - the parameter value should be completed i.e. curr=72.0 and not curr=?

    So just to recap - now we have a created new Cortex object with a level based output connection linked to the xAP SpeedFan GPU temperature - If you wish to check this then right click the xAP object and click connections - there should now be five connections available and the last is an analog output (orange) called 'SpeedFan GPU temp'

    You could now just make a connection between this analog output and the DFP display object - say to line 1 and when the value updates it would display

    curr 72.0

    However unfortunately you can't edit the name that is displayed from within the xAP object in Cortex but we can get around this by using a virtual Cortex object to both display the value on the plan , create a true temp sensor device for use within Cortex and choose a better name for display on the DFP..... so


    3) Now add a virtual DTS object (Tools > Design Network > Add Idratek Network Object > Temperature sensor module (DTS)) and name it SpeedFan GPU. Right click the temp icon and you will see it is not network enabled and has an ID of 0000 - this is fine, dont chnage anything.

    Right click the temp icon and select the 'alternative temperature input' connection. These alternative inputs are how you feed xAP information in instead of a physical sensor. So make a connection to the 'xAP SpeedFan' object and its event port called 'SpeedFan GPU temp'. Now the icon on the plan will display the GPU temperature and you can use it just like any other Cortex temp sensor :-) It has the same connections and will log history and draw graphs etc. One thing to note is that it will also automatically create default connections to other temp sensor inputs on appropriate objects. You might want to not make these depending on the sensors purpose.

    4) Now just to complete the task we'll create a link from the SpeedFan temp sensor object to the DFP display. Double click the object (Behaviour...) and click the Annunciations icon (second along on the bottom row) and change the 'Displayed Name' to say "GPU temp" Close the annunciations and behaviour dialogs and select 'Connections' by a right click and create a connection from the 'Temperature Output' to the DFP display on line of your choice. When the temp value is updated (changes) it will display


    GPU Temp 72.0C


    Mission accomplished



    P.S.

    It appears a lot of steps but I've been very verbose and once you get used to it it's very easy.

    One thing I would mention is that the xAP object you have created can hold one or many different schema so you can add all your xAP schema to one xAP object or create many different xAP Control Objects. Likewise one schema can hold several parameters. I tend to create one xAP object for each xAP device or function eg temp sensors - given that a xAP device can have many endpoints (sensors)it keeps it tidy.

    There is also a button to duplicate (copy) a schema within a xAP object so you really don't have to complete each one individually when a lot of the data is common to each entry.
    Last edited by Kevin; 30th December 2008 at 01:58 AM.

  6. #6
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    603

    Default

    Kevin,

    Although I am reading this at work with no access to Cortex it is already making lots of sense. I had come across some of the dialogue boxes that you mentioned but when you are not entirely sure what you are doing it becomes a bit frustrating. Hence my cry for help.

    I'll give this a go tonight and I'll also try and take screenshots and update my own blog as I believe this is very useful.

    Many thanks for taking the time to explain the procedure.

    Paul

  7. #7
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default

    Quote Originally Posted by Paul_B View Post
    Kevin,

    and I'll also try and take screenshots and update my own blog as I believe this is very useful.
    I agree - a picture is worth the 1000 words - Unfortunately my Cortex setup was via an RDP session and so I couldn't easily do that at the time.. but I'll try and add some - or edit yours into the above post . I did work through it practically as I typed it up so it does work.

    I also looked briefly at the Cortex scripting object and that seems well up to string manipulations so I might try that out later.

    Came home last night (one glass of wine) and the bottom line on my DFP2 display was

    Don't Drink and Drive

    very moral these DFP2's

  8. #8
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    603

    Default

    I have followed your instructions but Cortex doesn't seem to be "listening" for incoming messages. The xAP object is staying on ? as opposed to showing the temperature.

    Here is a screenshot of what the xAP message looks like and the associated xAP object in Cortex (btw is xAP case-sensitive?)
    Attached Images Attached Images

  9. #9
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default

    Looks like you set the xAP schema details up fine so..

    Just checking (sorry I should have included a couple more bits) - firstly that you do have the xAP module option for Cortex and that you do have a xAP hub application (preferably the service version) installed and running on the PC that has Cortex installed ? If you do have to install it then quit Cortex and any other xAP application eg Viewer and then start it (check its running ok in 'services') and then restart Cortex and any other xAP applications. You can now just forget about it as it'll always be there when needed.

    [edit] A xAP hub is required to be installed and running as the very first xAP application launched on a PC ie before any other xAP services or xAP applications. The symptom that a xAP application appears deaf but can still send messages indicates a hub problem. The recommendation is the xFX Express service hub available from here
    http://www.edjo.pwp.blueyonder.co.uk.../hubs_main.htm


    Is the Viewer application running on the same PC as Cortex and if so what does it's title bar say (does it just say Message Viewer or does it indicate it is a hub too) ? Does it show xAP heartbeat messages from Cortex and an entry in the left hand devices pane for Idratek / Cortex ? If it doesn't check that you have the HA Network option enabled for xAP by right clicking HA Network (under PC > Communications > HA Network) and enabling the xAP schema checkbox. You may have to restart Cortex.. not sure...

    K

    Quote Originally Posted by Paul_B View Post
    btw is xAP case-sensitive?
    Always best to preserve case as xAP is case sensitive in some aspects (it shouldn't be in source or target addresses though)
    Last edited by Kevin; 30th December 2008 at 11:11 PM.

  10. #10
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    603

    Default

    firstly that you do have the xAP module option for Cortex
    Yes, I purchased the license upgrade for HA software module to Cortex

    do have a xAP hub application (preferably the service version) installed and running on the PC that has Cortex installed
    I have been using Ed's xFx hub for some time and can see messages from most xAP enabled applications, i.e. Blue 0.1, Speedfan, plus messages coming out from Cortex. It is also running on the same machine as Cortex software.

    However, from your edit I am not 100% sure that the hub was running before Cortex. I know I have subsequently stopped and started Cortex with the hub running, but I guess this may not be enough.

    I'll do a reboot of the server tonight with Cortex not set to auto-start and see what happens with just the hub and xFx Viewer (which is what I have been using to capture the xAP traffic)


    Cortex is definitely generating xAP messages as I have the logging turned on for HA server and set that all xAP enabled objects in Cortex output to the communications window. I am seeing heartbeats and message from the xAP enabled devices in both Cortex logging / communication window and the xFx viewer.

    From all of the above it is sounding like the hub wasn't started first.

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •