Announcement

Collapse

Contacting HomeSeer This Week

HomeSeer is open and operational this week. All orders are being processed and shipped as usual. However, some staff are working from home. If you need to contact HomeSeer for support or customer service, please use our Email or Chat options. https://homeseer.com/contact-us/
See more
See less

Working at Asterisk, Homeseer and XAP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Working at Asterisk, Homeseer and XAP

    Ok so im diving in with both feet here. ill be the first to say I know extremely little about xap and also the plugin. thus far ive just just xap as a conduit for 1 wire temp sensors that are located both on my HS PC and on another PC. I use the hubconsole, and all that works great.

    so now I have decided to take the next step and a bit of a big one at that and delve into the idea of beginnings of integration between the asterisk open source PBX, xap and homeseer.

    on the lowest level right now what im tryingto do is be able to dial an extension on a telephone and have it turn a light on or off.. in the crudest form im not even yet worried about confirming the light actually did turn on...

    so I have a script written by one of the biggies in xap and runs as an AGI on asterisk. I dial an extension, the script runs and sends a simple string of data over the conduit, right now it sends the strings "execx9" and "execx10". if I dial 4799 on my phone I infact see the string "execx10" come across the conduit, homeseer plugin sees it, I set it to work in raw xap mode as basic control wasnt an option given to me, when I dial 4798 it sends execx9 over the conduit.. the homeseer device created by the plugin changes its display in the HS GUI correctly so I know im doing something right with configuring stuff.

    now here is where I run into a bit of a block.. trying to get a xap variable to set and trigger a homeseer event to occur.

    so I wrote a simple homeseer script to turn on a light a2. seems really easy

    then I went into the xap plugin and created an event called lighton, the sequence name is lighton I made it a homeseer command triggerscript and put lighton.txt in the data1 field.

    then I created a xap variable using the xap message I got below from the asterisk box
    PHP Code:
     xap-header 
    {
    v=12
    hop
    =1
    uid
    =FF000100
    class=command.external
    source
    =Asterisk.AGI.Perl
    }
    command.external
    {
    command=execx10

    ok seems simple enough so I opened the create variable dialog and gave it a name I put the source under source and the class under class however I have no section or item in my message above so I didnt put that in, I left those fields blank, then under event to run for update and variable change I put in lighton and saved it all.

    I dial 4798 from the phone I see the HS device in the gui change to execx9 but my event doesnt fire.. same with 4799.. no good...

    any help on where I went wrong would be greatly appreciated. and also I do have the source to the file that asterisk runs so if I need to add something to the xap message i can do that.. im not a great perl programmer but I can figure out a few things with it on the asterisk PBX end.
    -christopher
    PerfecTemp - the Most advanced HVAC system I've ever Built - and its in my House

  • #2
    I know people on the xAP mailing list are trying to xAP-enable asterisk.. but I have not seen anything released. I think there is basic xPL support for asterisk (asterisk@home) but it seems very limited. Do you know if anyone have released a xAP connector for asterisk?

    Comment


    • #3
      none of the true xap connectors are released yet... ive been following the yahoo group for xap and there is work going on. patrick lidstone supposedly has his asterisk fully xap enabled however nothing out there is released.. on the xap wiki it just talked about " I expect this is a niche group.. if there is enough interest I may release it" but as of yet nothing.. there is another writing a connector.. but it seems his main interest is not as much using the phone system to execute commands but in reporting back to asterisk..

      im partially there with mine as I do have asterisk sending data to the conduit and I do see the device change in homeseer.. but cant seem to act on it in the HS plugin. obviously the next natural step will be to have homeseer report back to asterisk via xap...

      xPL im not even sure what xPL is.. I am running the asterisk@home version.. although ive abandoned using AMP and I edit my configs myself since it is unlimited this way.
      -christopher
      PerfecTemp - the Most advanced HVAC system I've ever Built - and its in my House

      Comment


      • #4
        I'm totally guessing on this, but it may be that the trigger is based upon a status change and the raw mode may only update strings.

        If using mcsXap then there are two ways to do the trigger. One is to setup a xap trigger that looks for wildcarded message fields such as class, section, and key. The second is to tag the message to generate a 10 second status change when the message is received and use the standard HS trigger on the status change of a device code.

        Comment


        • #5
          I havent been lucky enough to get a copy of McsXap yet.. im not sure where I might find it.


          the xap messages being generated as shown above dont state a section and an item, merely just a class and a source...

          I do believe that the xap plugin im using does just change the device string in homeseer.. however james has a method for triggering a homeseer event within his plugin and thats where im having the issue is getting it to trigger.. probably just a case of user error on my part.. or the trigger wont work unless I have a section and an item to fill in the xap message. if those 2 "fields" are required I think I can get my way through the perl program on the asterisk PBX end and add them.. since the deivce string does change in homeseer I know james plugin acknwledges the messages...
          -christopher
          PerfecTemp - the Most advanced HVAC system I've ever Built - and its in my House

          Comment


          • #6
            mcsXap snapshots are posted where all my other xAP apps are posted.

            The section for this message is "command.external", but it does not matter since the message trigger needs to only specify fields of interest so any of class, source, or section would be sufficiently unique for this message.

            It is lilkely that James' plugin will generate the trigger since that is a normal thing a typical user would want to do. Hopefully he or something that knows how to set it up will chime in.

            Comment


            • #7
              Originally posted by cadillackid
              I put the source under source and the class under class however I have no section or item in my message above so I didnt put that in, I left those fields blank, then under event to run for update and variable change I put in lighton and saved it all.

              I dial 4798 from the phone I see the HS device in the gui change to execx9 but my event doesnt fire.. same with 4799.. no good...

              any help on where I went wrong would be greatly appreciated.
              Hi Chris - you do have section and and item in the message above - the section name is 'command.external' and the item is 'command' - then any value associated with command will update a HS variable - and you can trigger events based on the variable change or update. Also, make sure you use the latest xAP plugin that James posted to his site last night as some changes were made to the variable handling routines.
              http://www.mi4.biz

              Kevin

              Comment


              • #8
                Any progress here?

                I'm interested.....
                ______________________________
                Skibumsplace - Locate Me

                Comment


                • #9
                  Originally posted by Skibum
                  Any progress here?

                  I'm interested.....
                  Hi - which aspect were you looking for 'progress' on , It might be here already ?

                  The HS plugin has been revised and posted a long while back on the authors website http://www.mi4.net and I am not aware of any current issue with the triggers/events . Is this still a problem ??

                  The Asterisk side is ongoing with Patrick having released his code a while back (http://patrick.lidstone.net). Another author (Greg) is also writing an Asterisk plugin. These are being ongoingly discussed on the xAP Yahoo groups at

                  http://groups.yahoo.com/group/xap_automation/
                  http://groups.yahoo.com/group/xAP_developer/

                  If it's neither of these then remind me and I'll see where we're at.

                  Kevin

                  Comment


                  • #10
                    Hi Kevin

                    Thanks for the answers!
                    I've never played with Xap, but was looking for an excuse!
                    I was hoping for a plug and play kind of thing with asterisk to pique my interest.
                    ______________________________
                    Skibumsplace - Locate Me

                    Comment


                    • #11
                      Well, welcome to xAP - you had me worried I thought there was some 'buglet' outstanding from a while back.

                      xAP is a great thing to get into if you want your devices/info 'networked' and distributed. Basically anything can be anywhere on your network and everything can hear its information and control it. However it's still a tad off being true plug and play and has a bit of a familiarisation curve - we're getting there and I know there are various todo's on my list with regard to documentation to help newcomers. The BSC schema in xAp is there to get plug and play as achievable as possible.

                      Asterisk I have to say is probably not the easiest way into xAP (although having xAP and Asterisk integrated is a delightful combination). I don't use Asterisk myself as I'm not a Linux bod, but Patrick (who wrote one of the Asterisk xAP plugins) monitors the main xAP list quite frequently nowadays ,although not this one.

                      If you're already familiar with Asterisk why not give xAP a try and shout away with any Q's on the xAP Automation group, everybody learns from everyones experiences getting something going.

                      K

                      Comment


                      • #12
                        Thanks again!

                        Could you suggest what might be the EASIEST thing to Xap using the Homeseer plug-in?

                        Something that I could use to verify correct operation, and to get comfortable?
                        ______________________________
                        Skibumsplace - Locate Me

                        Comment


                        • #13
                          Have a look at the applications on www.mi4.biz and see if there's anything that interests you. A good starting point is something like xAP Weather as it works for most people around the world. News and TV listings possibly too. I'm not sure whereabouts you are located and what hardware you might have that may have xAP conduits already written. You will also need to download and install a xAP hub (as the very FIRST xAP application you launch. Whilst starting I would recommend either the GUI hub or xAP Viewer from www.xapframework.net as they allow you see all the xAP messages flyinga round. I am assuming you're running Windows and HS2 (ie already using .Net)

                          Kevin

                          Comment


                          • #14
                            Actually there are some really simple xAP 'test' applications that the (other) Kevin wrote - just switches/LED displays that use the 'BSC' (Basic Status and Control) schema . BSC is the closest we can get to plug and play in xAP - HomeSeer automatically recognises BSC devices (using the xAP plugin) and it will reflect their status in realtime and knows how to control them - no programming at all required - just click on the web based buttons.

                            http://www.mi4.biz/modules.php?name=...ownload&cid=28

                            Comment


                            • #15
                              I downloaded the hub gui, and the news xap thing... very cool

                              then downloaded the hs interface.. even cooler... not sure how to configure the hs interface... looking for docs now..
                              ______________________________
                              Skibumsplace - Locate Me

                              Comment

                              Working...
                              X