User:Gangsta/MiiHome

From WiiBrew
Jump to navigation Jump to search
MiiHome
MiiHomeLogo.jpg
General
Author(s)Gangsta
TypeMedia player
Version0.0.1a
LicenceFree for non-commecial use
Links
Discussion
Peripherals
Internet Wiimote1.svg SensorBar.svg

What is MiiHome

MiiHomeLogoBig.jpg
MiiHome is a virtual interface to my real world house. It is a fancy remote control that allows me to modify my little world all from my favourite reclining armchair. The GUI is very Wii, using the Mii's stored on the system to represent the occupants of the home, nice bright colours (think mario) and the bouncy feel to everything. All this is controlled using the Wiimote - with gestures representing the real world controls of the appliances controlled by the system.

Important Notes

Requirements

Hardware

  • MiiHome will run on any Wii running HBC
  • MiiHome requires a working network connection, either a USB Ethernet Adapter or the Wii built in WiFi

Software

  • MiiHome has no special requirements on the Wii and should run directly off the SD Card via the HBC
  • MiiHome requires an external server to process and respond to data/events generated both in MiiHome and in the RealWorld

Other

MiiHome cannot, and most probably will not ever connect or control any additional hardware connected directly to the Wii, via USB or otherwise. I am not great with programming USB devices, I don't have many USB capable PIC processors and don't want to kill my Wii's. MiiHome operates only as a controller for for my pre-existing Home Automation equipment, using the Wii's built-in networking capabilities.

MiiHome will NOT control 'Off-The-Shelf' Home Automation equipment, for example X10. Although this could change in the future - if there is time and assistance available to make the program fully modular.

Background

The basis of my HA system is described in a bit more detail at Automated Home, but a few bits and pieces have changed/been dropped/been added since I wrote that.

Concept

A 3D Model of my home in the middle of the screen, including the surrounding driveway and gardens etc. The sky above coloured to reflect the current time of day/night, and modified based on information scraped from one of the many weather providers that cover my area. For example if the forcast is snow, then snow will be falling on the screen.

Using the nunchuck to rotate/zoom around the house and garden, and the wiimote to select and control the on-screen action, users can interact with various elements of the house. When interacting with the various dynamic elements of the house, the wiimote is used to create gestures that are as close as possible to the actions you would normally perform to create the desired effect.

As soon as MiiHome is launched it begins to update itself (and the on-screen representation) with the latest data available over the network until it is fully synchronised with the server. Once the update is complete, the on-screen house maintains a real-time representation of the physical house including attributes such as which doors/windows are open, which rooms are occupied, the temperature and lighting level of the rooms as well as the weather and temperature outside the house.

Rooms that are occupied in the house will contain a Mii that represents that person, and you can watch the Mii's walking from room to room as people move about the house. A generic Mii with a '?' for a face is used to denote people in the house who the system cannot identify. Throughout the house there are many objects that you can interact with, although not all of them you can control independantly. An example of such an object would be the 'Master Bed'. Interacting with this object runs the 'Bedtime' macro function - which in this instance turns off all the main house lights, sets the hall and loo lights to 25%, and turns the exterior and driveway lights to 'automatic' (movement detection). Facial recognition (performed on the server - still a bit flakey) identifies our most common visitors and assigns a Mii to them when they arrive within CCTV range.

As the external input changes, the on-screen representation of the house uses various colours and sounds to give a visual (and in some cases audio) hints as to the current status of the house. This will take the form of changing the floor colours from blue through red to indicate a rooms temperature and adjusting the colour of lighting within the rooms to indicate the light status.

Screenshots

MiiHomeConceptZoomOut.jpg
This is a concept drawing rendered in a 3d program showing a zoomed out view of the house. Where the cursor is located - the walls are transparent so that you can see inside the room. There will need to be serious work on this part to ensure that the cursor shows you what you actually wanted to see. When interactive objects appear within your view - a balloon will appear to clarify what you are looking at.

Interfaces

Lighting

The lighting in my home is currently controlled by a bank of 4 x 12 Channel 10kW DMX Dimmer Packs. These are in turn controlled by a USB -> 512 Channel DMX Interface. This interface is connected to the server. On the server there is some custom code that responds to requests over the network, including on/off/fade ect for each light, as well as some macro functions such as 'bedtime' which causes all the main lights to turn off, and the hallway/loo lights to dim to 5% (Just bright enough to see where you are going)

Wiimote.svg Action
Wii Remote Aim Locate the light
Wiimote A Button Popup with current light setting
Wiimote B Button Activate the light controls
Wiimote 2 Button Popup favourite views list
Wiimote B Button + Wiimote A Button Set light to Auto
Wiimote B Button + Twist CCW Turn light down
Wiimote B Button + Twist CW Turn light up
Wiimote B Button + Flick Up Turn light on
Wiimote B Button + Flick Down Turn light off
Wiimote B Button + Wiimote 2 Button Popup lighting group list
Wiimote HOME Button Quit

All XML generated by MiiHome will be considered as:

<?xml version="1.0" encoding="UTF-8" ?>
<Room>
  7
  <Light>
    1
    <TargetIntensity>
      50%
    </TargetIntensity>
    <TargetDuration>
      2Sec
    </TargetDuration>
  </Light>
</Room>

Heating

The heating in my home...

Wiimote.svg Action
Wii Remote Aim Locate the radiator
Wiimote A Button Popup with current radiator setting
Wiimote B Button Activate the radiator controls
Wiimote 2 Button Popup favourite views list
Wiimote B Button + Wiimote A Button Set radiator to Auto
Wiimote B Button + Twist CCW Turn temperature down
Wiimote B Button + Twist CW Turn temperature up
Wiimote B Button + Flick Up Turn radiator on
Wiimote B Button + Flick Down Turn radiator off
Wiimote B Button + Wiimote 2 Button Popup radiator group list
Wiimote HOME Button Quit

All XML generated by MiiHome will be considered as:

<?xml version="1.0" encoding="UTF-8" ?>
<Room>
  3
  <TargetTemp>
    22C
  </TargetTemp>
</Room>

Curtains/Blinds

The curtains/blinds in my home...

Wiimote.svg Action
Wii Remote Aim Locate the curtain/blind
Wiimote A Button Popup with current curtain/blind setting
Wiimote B Button Activate the curtain/blind controls
Wiimote 2 Button Popup favourite views list
Wiimote B Button + Wiimote A Button Set curtain/blind to Auto
Wiimote B Button + <<-- -->> Open or close the curtain/blind
Wiimote B Button + Twist Open or close the blind slats
Wiimote B Button + Wiimote 2 Button Popup curtain/blind group list
Wiimote HOME Button Quit

Television

The heating in my home...

Alarm System

The alarm system

CCTV

The CCTV

Media System

The Media System

Picture In Picture

th pip

Macro Functions

Example Bedtime Macro

All XML generated by MiiHome will be considered as:

<?xml version="1.0" encoding="UTF-8" ?>
<Room>
  5
  <TargetTemp>
    22C
  </TargetTemp>
  <Light>
    1
    <TargetIntesity>
      0%
    </TargetIntesity>
    <TargetDuration>
      5Sec
    </TargetDuration>
  </Light>
    2,3
    <TargetIntesity>
      0%
    </TargetIntesity>
    <TargetDuration>
      60Sec
    </TargetDuration>
  </Light>
</Room>
<Room>
  2
  <Light>
    1
    <TargetIntesity>
      5%
    </TargetIntesity>
    <TargetDuration>
      30Sec
    </TargetDuration>
  </Light>
  <Light>
    2
    <TargetIntesity>
      5%
    </TargetIntesity>
    <TargetDuration>
      30Sec
    </TargetDuration>
  </Light>
</Room>

Features

Help Needed

I am always open to assistance, especially in the following areas

  • Graphics & Textures
    • Mii Rendering
    • Cartoon/Mario Style Modelling
  • Sound Effects
    • None yet - but really needs them
  • Networking/Network Reliability
    • The network code is VERY simple (and unreliable) just now
  • Suggestions on thing TO control
    • This could be things like the Dishwasher
  • Suggestion on HOW to control things (eg Gestures)

Current Status

As of now MiiHome (although without any GUI at the moment) can

  • Adjust any light in the home on/off/fade to any level
  • Adjust the heating of any room on/off/specific temperature
  • Open or close the vertical blinds - or any position in-between
  • Adjust the slat angle of the vertical blinds
  • Change the TV channel or volume on any TV in the home
  • Fully control the XBMC media players in each room
  • Initiate phone calls from or to the phones in each room
  • Notify any movement detected by the motion detectors
  • Respond to changes in light level outside the home

Changelog

Changelog Goes here

Contact Me

If you would like to contact me regarding this project (or anything else for that matter) please use the Discussion link at the top of the page. I am terrible at checking my email - and most stuff gets lost between the spam, but if you really want to email me - you can at gowens(insert the a with hoop)gtectuning(dot)co(dot)uk.

Credits

WiiBrew - for giving me some place to host this (and some great info on the Wii)


My Notes for editing my wiki

from the main screen of MiiHome, you will see a 3D view of the house (My house in this case, but I will try and code in flexibility so that it can be customized, maybe XML? Im hoping to get a Mario style look to it, eg nice bright colours, the trees in the background doing a 'Nintendo' sway.

using the wiimote, you can rotate around, and zoom inside the house. When hovering over a wall, the wall will become semi-transparent to allow you to see into the rooms.

If you move over certain items within the rooms, a balloon will pop up telling you that the is over an object that you can interact with, probably change the cursor too.

I would like to retain what is fun about the Wii, so I will include some mii's to indicate room occupancy, and also the gestures that the wii is most famous for.

Examples of object which you can interact with - and control in the REAL WORLD

TVs, by clicking on a TV, a TV channel can be chosen by 'Tuning' it with a flicks left+right, volume by twisting, on off by up/down flicks.

The sky and lighting of the scene will be determined by the inputs to the Wii, such as time of day, and the available light. During the day it will be nice and bright, getting darker as it gets later. And with a bit of scripting - will pull in the weather for my area, and overlay that over the scene.

So if you get rainclouds on the display, it means thats what the weatherman thinks. The sensors I currently have are either Light or Dark, so I will either need to upgrade to a proper light sensor, or implement some cool maths that I found on a university website that calculates all that stuff, eg the suns position in the sky, and how bright it should be. (possibly a nicer option as that would mean I can cast shaddows properly????)

Pressing 'A' on the wii_mote will cause the required system to enter 'Automatic' mode, which will turn on light when its dark, close the curtains, or set the heating to a temperature based on a pre-determined algorithm.

I would like to be able to use colour to highlight the monitored parameters of the room, eg as a room gets colder, the floor changes more blue, and turning more red as the rooms gets warmer. The room itself going from dark to light based on the current light settings, and the curtains opening and closing on the screen as required.

Other features to include are Visitor detection (which can include face recognition) - and using a suitable Mii if required,and car detection - which cars are currently at home and where are they parked.

It would possibly be better to have to the the actual house model stored on the server and transmitted to the Wii when starting MiiHome, with some kind of Cache, and version check to speed things up. Transmit the drawing as an XML.

Doing so will allow the user to draw their own house in a 3d package and have some kind of converter/importer on the PC. If the detail aspects of the home are also transmitted, it would leave the Wii code nice and clean. By using a self naming system like XML for input to and from the Wii - it can be totally device independant, able to control anything. eg. if I add a model to my house 'Dishwasher', I could include xml detail like <ControlType>OnOff</ControlType><OnGesture>FlickUp</OnGesture><OffGesture>FlickDown</OffGesture>