🚜 Merges/Redirect Hangouts component pages (#9045)

This commit is contained in:
Klaas Schoute 2019-03-26 23:31:46 +01:00 committed by Fabian Affolter
parent 4da52e2cd0
commit 24677c7a94
2 changed files with 77 additions and 79 deletions

View File

@ -8,19 +8,28 @@ comments: false
sharing: true sharing: true
footer: true footer: true
logo: hangouts.png logo: hangouts.png
ha_category: Hub ha_category:
- Hub
- Notifications
ha_release: 0.77 ha_release: 0.77
redirect_from:
- /components/notify.hangouts/
--- ---
This component allows you to send messages to [Google Hangouts](https://hangouts.google.com) conversations, as well as to react to messages in conversations. Reacting to commands is accomplished by firing an event when one of the configured commands is triggered. Home Assistant will impersonate a Smartisan YQ603 phone which will then show up in your Google devices. This component allows you to send messages to [Google Hangouts](https://hangouts.google.com) conversations, as well as to react to messages in conversations. Reacting to commands is accomplished by firing an event when one of the configured commands is triggered. Home Assistant will impersonate a Smartisan YQ603 phone which will then show up in your Google devices.
There is currently support for the following device types within Home Assistant:
- [Notifications](#notifications)
## {% linkable_title Setup the component via the frontend %} ## {% linkable_title Setup the component via the frontend %}
Menu: *Configuration* -> *Integrations* Menu: *Configuration* -> *Integrations*
Configure the integration: Configure the integration:
* Enter your **Google Mail Address** and **Password**
* If you secured your account with 2-factor authentication you will be asked for a 2-factor authentication token. - Enter your **Google Mail Address** and **Password**
- If you secured your account with 2-factor authentication you will be asked for a 2-factor authentication token.
<p class='note'> <p class='note'>
You can't write messages to yourself or get notifications in a group, if "you" write the message. The best way is to create a new Google Hangouts account for this integration.<br> You can't write messages to yourself or get notifications in a group, if "you" write the message. The best way is to create a new Google Hangouts account for this integration.<br>
@ -49,8 +58,8 @@ hangouts:
- id: CONVERSATION_ID1 - id: CONVERSATION_ID1
error_suppressed_conversations: error_suppressed_conversations:
- id: CONVERSATION_ID2 - id: CONVERSATION_ID2
``` ```
{% configuration %} {% configuration %}
intents: intents:
description: "Intents that the hangouts component should understand." description: "Intents that the hangouts component should understand."
@ -106,6 +115,7 @@ The intent `HangoutsHelp` is part of the component and return a list of all sent
## {% linkable_title Adding sentences %} ## {% linkable_title Adding sentences %}
{% raw %} {% raw %}
```yaml ```yaml
# The Hangouts component # The Hangouts component
hangouts: hangouts:
@ -126,6 +136,7 @@ intent_script:
speech: speech:
text: I know {{ states.hangouts.conversations.state }} conversations text: I know {{ states.hangouts.conversations.state }} conversations
``` ```
{% endraw %} {% endraw %}
This configuration will: This configuration will:
@ -139,14 +150,15 @@ Sentences can contain slots (marked with curly braces: `{name}`) and optional wo
The following configuration can handle the following sentences: The following configuration can handle the following sentences:
- Change the lights to red - Change the lights to red
- Change the lights to green - Change the lights to green
- Change the lights to blue - Change the lights to blue
- Change the lights to the color red - Change the lights to the color red
- Change the lights to the color green - Change the lights to the color green
- Change the lights to the color blue - Change the lights to the color blue
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
hangouts: hangouts:
@ -167,6 +179,7 @@ intent_script:
- "{% if color == 'green' %}255{% else %}0{% endif %}" - "{% if color == 'green' %}255{% else %}0{% endif %}"
- "{% if color == 'blue' %}255{% else %}0{% endif %}" - "{% if color == 'blue' %}255{% else %}0{% endif %}"
``` ```
{% endraw %} {% endraw %}
## {% linkable_title Services %} ## {% linkable_title Services %}
@ -189,7 +202,6 @@ Sends a message to the given conversations.
| message | List of message segments, only the "text" field is required in every segment. [Required] | [{"text":"test", "is_bold": false, "is_italic": false, "is_strikethrough": false, "is_underline": false, "parse_str": false, "link_target": "http://google.com"}, ...] | | message | List of message segments, only the "text" field is required in every segment. [Required] | [{"text":"test", "is_bold": false, "is_italic": false, "is_strikethrough": false, "is_underline": false, "parse_str": false, "link_target": "http://google.com"}, ...] |
| data | Extra options | {"image_file": "path"} / {"image_url": "url"} | | data | Extra options | {"image_file": "path"} / {"image_url": "url"} |
### {% linkable_title Service `hangouts.reconnect` %} ### {% linkable_title Service `hangouts.reconnect` %}
Reconnects the hangouts bot. Reconnects the hangouts bot.
@ -205,6 +217,7 @@ Reconnects the hangouts bot.
The hangouts component can't detect if your ip address changes, so it can't automatic reconnect to the Google servers. This is a workaround for this problem. The hangouts component can't detect if your ip address changes, so it can't automatic reconnect to the Google servers. This is a workaround for this problem.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: rest - platform: rest
@ -212,7 +225,7 @@ sensor:
name: External IP name: External IP
value_template: '{{ value_json.ip }}' value_template: '{{ value_json.ip }}'
scan_interval: 10 scan_interval: 10
automation: automation:
- alias: Reconnect Hangouts - alias: Reconnect Hangouts
trigger: trigger:
@ -226,4 +239,56 @@ automation:
action: action:
- service: hangouts.reconnect - service: hangouts.reconnect
``` ```
{% endraw %} {% endraw %}
## {% linkable_title Notifications %}
The `hangouts` platform allows you to deliver notifications from Home Assistant to [Google Hangouts](http://hangouts.google.com) conversations. Conversations can be both direct as well as group chats.
To enable Hangouts notifications in your installation, you first need to configure the Hangouts component. Then, add the following to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
notify:
- name: NOTIFIER_NAME
platform: hangouts
default_conversations:
- id: CONVERSATION_ID1
- id: CONVERSATION_ID2
```
{% configuration %}
name:
description: "Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`."
required: false
type: string
default_conversations:
description: "The conversations all messages will be sent to, when no other target is given."
required: true
type: [map]
keys:
id:
description: "Specifies the id of the conversation. *The conversation id can be obtained from the `hangouts.conversations` entity.*"
required: true
type: string
{% endconfiguration %}
### {% linkable_title Finding the conversation ID %}
The conversations has to be precreated, the conversation id can be obtained from the `hangouts.conversations` entity, this can be found in with the states developer tool that is shown as this icon <img src='/images/screenshots/developer-tool-states-icon.png' class='no-shadow' height='38' /> in the side bar. Using your web browsers search tool to find the `hangouts.conversations` entity. You will find something like below.
```json
0: {
"id": "<Hangout ID>",
"name": "A simple hangout",
"users": [
"Steve",
"Jo"
]
}
```
This may have more if the account is in multiple hangout conversations, for configuring the bot to be in a conversation you will need the ID that would be where `<Hangout ID>` is in that example. Make sure to use quotes around the conversation id or alias to escape special characters (`!`, and `#`) in YAML.
To use notifications, please see the [getting started with automation page](/getting-started/automation/).

View File

@ -1,67 +0,0 @@
---
layout: page
title: "Google Hangouts"
description: "Instructions on how to add Google Hangouts notifications to Home Assistant."
date: 2018-08-18 20:00
sidebar: true
comments: false
sharing: true
footer: true
logo: hangouts.png
ha_category: Notifications
ha_release: 0.77
---
The `hangouts` platform allows you to deliver notifications from Home Assistant to [Google Hangouts](http://hangouts.google.com) conversations. Conversations can be both direct as well as group chats.
## {% linkable_title Configuration %}
To enable Hangouts notifications in your installation, you first need to configure
the [Hangouts component](/components/hangouts/). Then, add the following to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
notify:
- name: NOTIFIER_NAME
platform: hangouts
default_conversations:
- id: CONVERSATION_ID1
- id: CONVERSATION_ID2
```
{% configuration %}
name:
description: "Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`."
required: false
type: string
default_conversations:
description: "The conversations all messages will be sent to, when no other target is given."
required: true
type: [map]
keys:
id:
description: "Specifies the id of the conversation. *The conversation id can be obtained from the `hangouts.conversations` entity.*"
required: true
type: string
{% endconfiguration %}
### {% linkable_title Finding the conversation ID %}
The conversations has to be precreated, the conversation id can be obtained from the `hangouts.conversations` entity, this can be found in with the states developer tool that is shown as this icon <img src='/images/screenshots/developer-tool-states-icon.png' class='no-shadow' height='38' /> in the side bar. Using your web browsers search tool to find the `hangouts.conversations` entity. You will find something like below.
```
0: {
"id": "<Hangout ID>",
"name": "A simple hangout",
"users": [
"Steve",
"Jo"
]
}
```
This may have more if the account is in multiple hangout conversations, for configuring the bot to be in a conversation you will need the ID that would be where `<Hangout ID>` is in that example. Make sure to use quotes around the conversation id or alias to escape special characters (`!`, and `#`) in YAML.
To use notifications, please see the [getting started with automation page](/getting-started/automation/).