--- layout: page title: "Developers" date: 2014-12-21 13:32 sidebar: false comments: true sharing: true footer: true --- Home Assistant can be extended by components. Components can listen for- or trigger events and offer services. Components are written in Python and can do all the goodness that Python has to offer. Home Assistant offers [built-in components]({{site_root}}/components/) but it is easy to built your own. An example component can be found in [`/config/custom_components/example.py`](https://github.com/balloob/home-assistant/blob/master/config/custom_components/example.py).
Note
Home Assistant will use the directory that contains your config file as the directory that holds your customizations. By default this is the config
folder in your current work directory. You can use a different folder by running Home Assistant with the --config argument python3 homeassistant --config /YOUR/CONFIG/PATH/
.
<config directory>/custom_components/<component name>
* homeassistant/components/<component name>
(built-in components)
Once loaded, a component will only be setup if all dependencies can be loaded and are able to setup. Keep an eye on the logs to see if loading and setup of your component went well.
Warning
*Warning:* You can override a built-in component by offering a component with the same name in your custom_components folder. This is not recommended and may lead to unexpected behavior!
hass
| The Home Assistant object. Call its methods to track time, register services or listen for events: [Overview of available methods.](https://github.com/balloob/home-assistant/blob/master/homeassistant/__init__.py#L38) |
| config
| A dict containing the configuration. The keys of the config-dict are component names and the value is another dict with configuration attributes. |
### Guidance on using the Home Assistant object
The Home Assistant object contains three objects to help you interact with the system.
| Object | Description |
| ------ | ----------- |
| hass.states
| This is the StateMachine. The StateMachine allows you to see which states are available and set/test states for specified entities. [See available methods](https://github.com/balloob/home-assistant/blob/master/homeassistant/__init__.py#L473). |
| hass.events
| This is the EventBus. The EventBus allows you to listen and trigger events. [See available methods](https://github.com/balloob/home-assistant/blob/master/homeassistant/__init__.py#L308). |
| hass.services
| This is the ServiceRegistry. The ServiceRegistry allows you to register services. [See available methods](https://github.com/balloob/home-assistant/blob/master/homeassistant/__init__.py#L589). |
### Example on using the configuration parameter
If your configuration file containes the following lines:
```
[example]
host=paulusschoutsen.nl
```
Then in the setup-method of your component you will be able to refer to `config['example']['host']` to get the value `paulusschoutsen.nl`.