in

HTTP call for eventMapping

Last post 07-30-2008 9:15 AM by engineering.team. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-29-2008 11:43 PM

    HTTP call for eventMapping

     Hi,

     I have an event mapped to an internal source for the ease of normalising actions. This is working well for the capture of all my light switches, etc and I'll extend as I get the PIR's wired up for the same effect. (to that point I've written an excel sheet that creates my event mapping XML configs)

     However, what I want to know is whether it is possible to use a similar model to capture URL's to capture these events as well. e.g. http://gateway/sendevent/light/kitchen/cabinet to trigger the same light/kitchen/cabinet event and therefore any corresponding actions.

     Thanks

     Paul

     

     

            <eventtype type="http://id.webbrick.co.uk/events/webbrick/TD">
                <eventsource source="webbrick/1/TD/2" >
                    <event>
                        <newEvent type="internal" source="light/kitchen/cabinet" />                   
                    </event>
                </eventsource>
            </eventtype>

            <eventtype type="http://id.webbrick.co.uk/events/webbrick/Td">
                <eventsource source="webbrick/1/Td/2" >
                    <event>
                        <newEvent type="internal" source="light/kitchen/cabinet" />                   
                    </event>
                </eventsource>
            </eventtype>

     

    Filed under:
  • 07-30-2008 9:15 AM In reply to

    Re: HTTP call for eventMapping

    You have already got nearly there.

     

    http://gateway/sendevent/...

    Will issue an event into the event distribution network.

    The event source is the remains or the URI.

    http://sendevent/switch/my/lights

    would send an event with an event source of switch/my/lights

    The event type in this case would be http://id.webbrick.co.uk/events/uri

    If you add a parameter of type to the uri then you can override the event type.

    i.e.

    http://gateway/sendevent/switch/my/lights?type=my/type

     
    Any other parameters on the URI are added to the event payload

     

    http://gateway/sendevent/switch/my/lights?type=my/type&amplifier=lounge

    Would send event with

    eventtype= my/type

    eventsource=switch/my/lights

    payload { amplifer=lounge } 

    So anything that is capable of issuing an http request on significant data can be integrated with the gateway.

    If you look in the sample page templates for one called HomeInt.kid you will see sendevent being used to do the home away states. 


     

Page 1 of 1 (2 items)
(c) WebBrick Systems