Results 1 to 8 of 8

Thread: Running a Cortex Macro for xAPFlash

  1. #1
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    124

    Default Running a Cortex Macro for xAPFlash

    Can anybody give me some guidance on how to set this up.

    At present I can run the macro by pressing a physical button, which is not ideal, or I can press a button on a remote that is captured by Idratek/Cortex. What I would like to do is either emulate pressing the button or emulate pressing the remote control button or run the macro direct from xAPFlash. I've tried to 'push' the button and 'press' the remote button without success that leaves me with controlling the macro direct but I don't know where to start to be honest. Any help would be appreciated.

    - Neil

  2. #2
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    553

    Default

    Hi Neil, I'm just away for a week at the moment so I can't easily provide/check a step by step for this but if you're still struggling I'll do so when I get back.

    However the best approach would be to create a virtual device like a relay or light in Cortex and xAP enable it so it is turned on and off by the xAPFlash button (you can either set the button up to just send the 'on' or 'off' or you could send a 'toggle' which is the default although probably not as wanted here). Make sure this works exactly as intended. Now within Cortex take the output connection from the relay or lamp and use it to trigger the macro. If you are using on/off rather than toggle then you will need to reset the trigger state , either with some timed pulse action or I would think that within the macro itself is ideal. This will then ensure that the button on xAPFlash indicates a momentary 'on' state as the macro is run. This will provide good visual feedback to the user and is a guarantee it was performed.

    (You don't actually have to go via a virtual device - you could just receive/recognise an appropriate xAP message in Cortex and use the xAP message connection output to trigger the macro but then there will be no visual indicator within Cortex and also the button on xAPFlash will not show the state change)
    Last edited by Kevin; 17th June 2012 at 01:44 PM.

  3. #3
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    124

    Default

    Kevin,

    I hope you're on holiday and not working.

    That's a good idea I'd not thought of that. Will be getting it working later today.

    - Neil

  4. #4
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    124

    Default

    Kevin,

    Don't bother replying to this until you get back as it's not important.

    I'm having a little problem with getting the virtual device to work. I've set up a light and created a button to control it but it's not working. I've filled in all the details correctly but for some reason when the button is pressed nothing happens. If I toggle within Cortex its status gets updated in xAPFlash. I've put it's details in a button that I know works but still nothing, and I've put the details of another working light in the new button and that one works. I've checked and double checked the settings in Cortex comparing them with another known light that works and everything is the same. I'm confused !!!! Any ideas?

    - Neil

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

    Default

    OK I'm back Neil and, assuming it's still not working I'll try and provide a step by step...

    First a couple of questions..

    Do you have xAPFlash controlling anything in Cortex (not just tracking status) ?
    You do have a xAP hub running on the machine that Cortex is running on ?
    Could you paste me the content of a xAPBSC.event message from Cortex as it changes state from within Cortex (use xFX Viewer)
    Also a copy of the xAPBSC.cmd message from xAPFlash to Cortex when you press the button.

    K

  6. #6
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    124

    Default

    Hi Kevin,

    Quote Originally Posted by Kevin View Post
    Do you have xAPFlash controlling anything in Cortex (not just tracking status) ?
    K
    - Yes, lot's of things succesfully.

    Quote Originally Posted by Kevin View Post
    You do have a xAP hub running on the machine that Cortex is running on ?
    K
    - Yes.


    I haven't had chance to update this thread since I posted it. I got involved with removing an internal wall here over the weekend as phase two has now started and I've been to a funeral today, It's all fun !!!

    It's working now but it wouldn't for a couple of days. I hadn't changed anything but I noticed it had started working either after a network stop & start or it could of been a reboot of the Cortex PC after an update.

    However a persistant problem that I have had is that I can't get my Outside Light Level to dispaly in a text box because xAPFlash is reporting it as a missing device.

    It's strange as I can display the Outside Temperature and Outside Humidity, they are on the same module.

    I think that it may be something on the Cortex side so I think I'll drop Vivian an email and see if he can investigate.

    Anyway back to the topic in hand. I've got the virtual light working (somehow) and now just need to make it run the macro.

    I would prefer to be able to run the macro direct though as I have some other uses for macros that invlove the Motor Control and HVAC objects that aren't xAP enabled in Cortex. I've been looking into those objects and I can't see how they can be easily exposed to xAP as they have a multitude of control options.

    - Neil

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

    Default

    Glad it's all mostly working and you're further down the path than I had anticipated :-)

    If xAPFlash complains that it has a missing device it will repeatedly send xAPBSC.query messages to it, with an increasing back off delay. Do you see these messages going from xAPFlash to Cortex and does Cortex respond with a xAPBSC.info message ?

    Obviously you've checked that the UID and source value in xAPFlash is correct. The source is used by Cortex to know which device is being 'queried' but xAPFlash actually recognises the response based on matching the UID value. An example of both these messages would help eliminate this as a problem but I'm thinking you'll have triple checked it.

    Vivian is xAP enabling objects pretty much based on demand, obviously the more frequent ones are already implemented. You can always chain a virtual on/off device (relay) that is xAP enabled into one of the other objects should you need. You can also create xAP automation schema objects that will recognise certain xAP messages directly giving connection outputs directly. This way you don't rely on the xAPBSC schema implementation of specific objects, indeed you could use any schema. You often need two such schema - one for recognising the incoming message and one for generating a response when the Cortex object changes state.

    Be a little wary of toggling dimmers as when they are 'on' at level=0 this will not actually produce a visual change - relays OTOH will always change state as they have no level.

    Keep me posted - I haven't actually yet played with triggering macros via xAP but it is something I will be wanting to do so I'm keen to ensure it works. I suppose Vivian could xAP enable the macro directly , as an output binary device that pulsed 'on' as the macro ran and then 'off' when it completed, although I think we can achieve the same via the virtual device... post back as you progress or if you get stuck...

    K

  8. #8
    Automated Home Guru neilhooper's Avatar
    Join Date
    Oct 2008
    Location
    Hereford, United Kingdom
    Posts
    124

    Default

    This is being sent by xAPFlash

    xap-header
    {
    v=13
    hop=1
    uid=FF.0738:0000
    class=xAPBSC.query
    source=UKUSA.xAPFlash.ahscs5
    target=Idratek.Cortex.DYLAN1:World.OutsideLightLev el
    }
    request
    {
    textBox=Outside Light Level
    }

    and this is received

    xap-header
    {
    v=13
    hop=1
    uid=FF.8546:0094
    class=xAPBSC.info
    source=Idratek.Cortex.DYLAN1:World.OutsideLightLev el
    }
    input.state
    {
    State=Off
    Level=0/100
    }


    On the macro front I want my cake and eat it. I'm already controlling four macros using a remote control and an ITR. The only problem is that an ITR can only recognise 16 frames (buttons) so where required I'd like to control the macros directly using xAPFlash. I understand the use of using virtual devices but my structure view is starting to get quite cluttered and this is only the first room !!!

    The current thing I'm trying to get working is the 'Watch TV' button. At the moment when I run this macro the ITR in the lounge turns on the AV amp then after 8 seconds the TV gets turned on and then SKY HD which is located at Node 0 with another ITR in front of it. From an xAPFlash point I'd like to press the 'Watch TV' button and it register as pressed then press it again to turn everything off and the button change its state accordingly. With that in mind I personally wouldn't want a macro xAP enabled the way you've described it, but that's only my point of view.

    Another one of my ideas is; as I'm having at least three or more, probably four, tablets running xAPFlash throughout the house I'll be displaying the room temperature on each room's page and also have a 'Turn Temperature Up' button and 'Turn Temperature Down' button and a 'Temperature set to:' text box to give local control for when you're feeling a bit cold or hot if you know what I mean. All those parameters are available in the HVAC object but as I mentioned earlier I don't think xAP enabling that object will be simple for Vivian to do but I think I could do it all with macros. The problem that I see with using virtual devices is that I'm going to need, in this case, one device for the up button and another for the down button and so on.

    I've had a look at the xAP Controller Network Object, at the moment most of it is gobblydegook as I don't understand what information goes where and where to get it from. That's the bit I need the most help with.

    - Neil

Posting Permissions

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