Use Cases

This page lists some real-world examples about WOSH system and its services.

See also Using WOSH


Use Cases - Assumptions

All of these examples have been tested by WOSH creator in order to automate his home.

Each example usually have some hardware/software requirements must be fullfilled, refer to my equipment.

In short, we generally assume to have a WOSH Server running, some bundles and software/hardware packages installed.


Control and Monitor Appliances

This kind of use-case (device control) is documented in Using WOSH: Devices page, let's just summarize requirements and benefits.

wosh::bundles::HeyuBundle service will monitor X10 events (piping 'heyu monitor'), keep an updated cache of all devices and provide standard interface for controlling them.


Control Home remotely (GTalk)

This kind of use-case (remote control) is documented in Using WOSH: Communication page, let's just summarize requirements and benefits.

wosh::bundles::JabberGlooxBundle service will act as a bot (dummy human-fake) in a Jabber network (such as Google GTalk), so you will need to setup an account for this entity and add each other as friends (so you may exchange messages).

This account is reserved to bot and will behave as the WOSH system personification, turning the chat into a shell similar to the command line.

Thanks to WOSH Security architecture it will identify/authorize friends (as you) and map them to validated WOSH accounts.

Voila.. we control our home from anywhere in the world using the most standard instant messaging protocol! Well, there is more, since the JabberGlooxBundle service is a Communicator implementation, the WOSH system will be able to contact us for notification, reports, messages routed from other users..


Whole-House Music Control

Refer Using WOSH: Multimedia for a background. Here we focus on benefits of wosh::bundles::PlayerMPDBundle (MPD server).

The WOSH player is synchonized against the server, just like any other MPD client (such as mpc shell client, ..). In short, WOSH will be avare of changes made by our netbook running qmpdclient client.

Since player support zone selection, we can setup automations which switch a zone on/off on some event (see Music follows You).


Music follows You

Refer to wosh::bundles::PlayerMPDBundle and Using WOSH: Multimedia for a background. Here we focus on the "music follows you" automation, which requires a PlayerMPD service running and properly configured.

Moreover, since the automation's trigger is the user's presence event, some sort of sensor or hardware-trigger is also required. My equiment includes many X10 Motion Sensors (MS13) and wosh::bundles::HeyuBundle service.

It should be clear enough how automations' flow works:

Let's make it a little bit smart.. the automation will enable/disable outputs only (to and) if a Player is playing. This task comes out to be trivial using regex expression in the target address (URI).

Here is the configuration dump:

    <wosh::automations::Automation name="autoplay_bathroom_nord" id="88" enabled="true">
      <permission owner="alex" group="inhabitans" mask="754" />
      <monitored-busses>
        <bus>wosh.Bus.Devices</bus>
      </monitored-busses>
      <triggers>
        <wosh::MessageFilter>
          <source bus="wosh.Bus.Devices" uri="*:Devices/sensor_m_bathroom_nord" />
          <content class="wosh::Fact" event="MotionDetected">
            <data class="wosh::Variant" type="integer" data="1" />
          </content>
        </wosh::MessageFilter>
        <wosh::MessageFilter>
          <source bus="wosh.Bus.Devices" uri="*:Devices/sensor_m_bathroom_nord" />
          <content class="wosh::Fact" event="MotionDetected">
            <data class="wosh::Variant" type="integer" data="2" />
          </content>
        </wosh::MessageFilter>
      </triggers>
      <effects>
        <wosh::Message>
          <destination bus="wosh.Bus.Core" uri="*:Bundles/PlayerMPD[PlayerState=Playing]" />
          <content class="wosh::Request" method="output" omit-response="true">
            <data class="wosh::List" size="2" >
             <li class="wosh::Variant" type="string" data="doccia" />
             <li class="wosh::Variant" type="boolean" data="true" />
            </data>
          </content>
        </wosh::Message>
        <wosh::Message>
          <destination bus="wosh.Bus.Core" uri="*:Bundles/PlayerMPD[PlayerState=Playing]" />
          <content class="wosh::Request" method="output" omit-response="true">
            <data class="wosh::List" size="2" >
             <li class="wosh::Variant" type="string" data="doccia" />
             <li class="wosh::Variant" type="boolean" data="false" />
            </data>
          </content>
        </wosh::Message>
      </effects>
      <properties>
        <property key="description">turn on/off music in bathroom if the PlayerMPD is already playing (somewhere else)</property>
      </properties>
    </wosh::automations::Automation>

DayLight Automation

Executing a set of actions on sun-rise and sun-set is a very useful feature and an entry-point requirement for an home-automation system.

The wosh::automations::AutomationDayLightEvent raises such events daily and reconfigure itself evaluating Weather informations provided by (wosh::bundles::WeatherBundle).

So it won't ever need any (re)configuration during the year. AutomationDayLightEvent's configuration is:

    <wosh::automations::AutomationDayLightEvent name="auto_daylight" id="37" enabled="true">
      <permission owner="alex" group="inhabitans" mask="754" />
      <auto-update>true</auto-update>
      <apply-always>true</apply-always>
      <auto-update-period>180</auto-update-period>
      <properties>
        <property key="description">raise light/night event</property>
      </properties>
    </wosh::automations::AutomationDayLightEvent>

Once enabled, other automations may use such events as trigger.

The following XML snippet will turn on/off garden light on sun-set/sun-rise events.

    <wosh::automations::Automation name="gdaylights_onoff" id="78" enabled="true">
      <permission owner="alex" group="inhabitans" mask="754" />
      <triggers>
        <wosh::MessageFilter>
          <source bus="wosh.Bus.Automation" />
          <content class="wosh::Fact" event="WeatherDayLight_Changed">
            <data class="wosh::Variant" type="integer" data="2" />
          </content>
        </wosh::MessageFilter>
        <wosh::MessageFilter>
          <source bus="wosh.Bus.Automation" />
          <content class="wosh::Fact" event="WeatherDayLight_Changed">
            <data class="wosh::Variant" type="integer" data="1" />
          </content>
        </wosh::MessageFilter>
      </triggers>
      <effects>
        <wosh::Message>
          <destination bus="wosh.Bus.Devices" uri="*:Devices/light_garden_door" />
          <content class="wosh::Request" method="on" omit-response="true" />
        </wosh::Message>
        <wosh::Message>
          <destination bus="wosh.Bus.Devices" uri="*:Devices/light_garden_door" />
          <content class="wosh::Request" method="off" omit-response="true" />
        </wosh::Message>
      </effects>
      <properties>
        <property key="description">turn on/off garden lights daily</property>
      </properties>
    </wosh::automations::Automation>

Generated on Sat Feb 26 2011 11:28:29 for WOSH system 0.8.888 [phoenix] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework