home-assistant.io/source/_components/sensor.imap.markdown
Marcelo Moreira de Mello 10317da550 Updated documentation to match with voluptuous config validation
--
After the upgrade to use voluptuous to parse the configuration, sensor.imap needs to pass username instead user. Note that user also works, but to keep it coherent, we are updating the documentation.

(home_assistant) ↪ hass --script check_config
Testing configuration at /home/hass/.homeassistant
16-08-28 00:49:35 ERROR (MainThread) [homeassistant.bootstrap] Invalid config for [sensor.imap]: required key not provided @ data['username']. Got None
Failed config
  sensor.imap:
    user: <redacted>
    port: 993
    platform: imap
    password: <redacted>
    server: imap.gmail.com
    name: Gmail Alerts

Successful config (partial)
  sensor.imap:

   After replacing ```user``` by ```username```, ```hass --script check_config``` works as expected.
2016-08-28 00:53:11 -04:00

38 lines
1016 B
Markdown

---
layout: page
title: "IMAP Unread E-mail"
description: "Instructions how to integrate IMAP unread email into Home Assistant."
date: 2016-07-11 06:00
sidebar: true
comments: false
sharing: true
footer: true
ha_category: Sensor
ha_release: 0.25
---
The `imap` sensor platform is observing your [IMAP server](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) and reporting the amount of unread emails.
To enable this sensor, add the following lines to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
sensor:
- platform: imap
server: imap.gmail.com
port: 993
name: Emails
username: USERNAME
password: PASSWORD
```
Configuration variables:
- **server** (*Required*): The IP address or hostname of the IMAP server.
- **port** (*Required*): The port where the server is accessible.
- **name** (*Optional*): Name of the IMAP sensor.
- **username** (*Required*): Username for the IMAP server.
- **password** (*Required*): Password for the IMAP server.