mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 01:37:23 +00:00
Adding example for doing a search (#8431)
* Adding example for doing a search Not intuitive and it took me a while but I worked it out so I'm documenting here. * Minimize the conf sample and move search to full sample
This commit is contained in:
parent
35abeebf0f
commit
2f29fd458f
@ -24,8 +24,7 @@ To enable this sensor, add the following lines to your `configuration.yaml` file
|
|||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
sensor:
|
sensor:
|
||||||
- platform: imap
|
- platform: imap
|
||||||
server: imap.gmail.com
|
server: YOUR_IMAP_SERVER
|
||||||
port: 993
|
|
||||||
username: YOUR_USERNAME
|
username: YOUR_USERNAME
|
||||||
password: YOUR_PASSWORD
|
password: YOUR_PASSWORD
|
||||||
```
|
```
|
||||||
@ -72,3 +71,15 @@ By default, this component will count unread emails. By configuring the search
|
|||||||
* `FROM`, `TO`, `SUBJECT` to find emails in a folder (see [IMAP RFC for all standard options](https://tools.ietf.org/html/rfc3501#section-6.4.4))
|
* `FROM`, `TO`, `SUBJECT` to find emails in a folder (see [IMAP RFC for all standard options](https://tools.ietf.org/html/rfc3501#section-6.4.4))
|
||||||
* [Gmail's IMAP extensions](https://developers.google.com/gmail/imap/imap-extensions) allow raw Gmail searches, like `X-GM-RAW "in: inbox older_than:7d"` to show emails older than one week in your inbox. Note that raw Gmail searches will ignore your folder configuration and search all emails in your account!
|
* [Gmail's IMAP extensions](https://developers.google.com/gmail/imap/imap-extensions) allow raw Gmail searches, like `X-GM-RAW "in: inbox older_than:7d"` to show emails older than one week in your inbox. Note that raw Gmail searches will ignore your folder configuration and search all emails in your account!
|
||||||
|
|
||||||
|
#### {% linkable_title Full configuration sample with search %}
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
sensor:
|
||||||
|
- platform: imap
|
||||||
|
server: imap.gmail.com
|
||||||
|
port: 993
|
||||||
|
username: YOUR_USERNAME
|
||||||
|
password: YOUR_PASSWORD
|
||||||
|
search: FROM <sender@email.com>, SUBJECT <subject here>
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user