Skip to content
Merged

sync #342

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion View Assist dashboard and views/dashboard/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
button_card_templates:
variable_template:
variables:
dashboardversion: 1.3.0
dashboardversion: 1.3.1
var_assistsat_entity: |-
[[[
return localStorage.getItem("view_assist_sensor")
Expand Down Expand Up @@ -769,6 +769,16 @@ button_card_templates:
service_data:
device: '[[[ return variables.var_assistsat_entity ]]]'
path: '[[[ return `${variables.var_dashboard}/camera` ]]]'
music:
type: custom:button-card
template: icon_template
icon: mdi:music
tap_action:
action: call-service
service: view_assist.navigate
service_data:
device: '[[[ return variables.var_assistsat_entity ]]]'
path: '[[[ return `${variables.var_dashboard}/music` ]]]'
wake:
type: custom:button-card
template: icon_template
Expand Down
110 changes: 58 additions & 52 deletions View Assist dashboard and views/views/music/music-alternative.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
- type: custom:button-card
variables:
musiccardalternativeversion: 1.1.0
template:
- variable_template
- body_template
styles:
card:
- background-color: black;
custom_fields:
message:
- font-size: '[[[ return variables.var_font_size ]]]'
- position: absolute
- text-align: start
- text-wrap: wrap
- justify-content: center
- align-self: center
- z-index: 0
custom_fields:
title: ''
message:
card:
type: custom:mod-card
card:
type: custom:mini-media-player
entity: '[[[ return variables.var_musicplayer_device ]]]'
artwork: cover
hide:
icon: true
info: false
name: true
volume: false
power: false
progress: true
card_mod:
style:
mmp-powerstrip $: |
ha-icon-button {
color: white !important;
}
.: |
ha-card {
--mmp-icon-color: white !important;
--mmp-text-color: white !important;
--mmp-unit: 1 !important;
--mdc-icon-size: 7vw !important;
font-size: 4vw !important;
font-weight: bold;
width: 100vw !important;
height: 100vh !important;
}
cards: []
type: custom:button-card
variables:
musiccardalternativeversion: 1.2.0
var_musicplayer_device: |-
[[[
var assistbid = localStorage.getItem("view_assist_sensor") ?? variables.default_satellite;
var musicdevice = hass.states[assistbid].attributes.musicplayer_device;
return `${musicdevice}`
]]]
template:
- variable_template
- body_template
styles:
card:
- background-color: black;
custom_fields:
message:
- font-size: "[[[ return variables.var_font_size ]]]"
- position: absolute
- text-align: start
- text-wrap: wrap
- justify-content: center
- align-self: center
- z-index: 0
custom_fields:
title: ""
message:
card:
type: custom:mod-card
card:
type: custom:mini-media-player
entity: "[[[ return variables.var_musicplayer_device ]]]"
artwork: cover
hide:
icon: true
info: false
name: true
volume: false
power: false
progress: true
card_mod:
style:
mmp-powerstrip $: |
ha-icon-button {
color: white !important;
}
.: |
ha-card {
--mmp-icon-color: white !important;
--mmp-text-color: white !important;
--mmp-unit: 1 !important;
--mdc-icon-size: 7vw !important;
font-size: 4vw !important;
font-weight: bold;
width: 100vw !important;
height: 100vh !important;
}
cards: []
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,44 @@ def search_wikipedia(searchterm=None, language="en"):
if searchterm is None:
return {"error": "Missing searchterm"}

# Construct the URL with the specified language
url = f"https://{language}.wikipedia.org/api/rest_v1/page/summary/{searchterm.replace(' ', '_')}?redirect=true"

# Custom User-Agent (required!)
headers = {
"User-Agent": "HA-WikipediaSearch/1.0 (HomeAssistant pyscript; your.email@example.com)"
}

# Step 1: Search Wikipedia to resolve canonical page title
search_url = f"https://{language}.wikipedia.org/w/api.php"
search_params = {
"action": "query",
"list": "search",
"srsearch": searchterm,
"format": "json"
}

search_r = task.executor(
requests.get,
search_url,
params=search_params,
headers=headers
)

if search_r.status_code != requests.codes.ok:
return {"error": "Search failed", "details": search_r.text}

search_data = search_r.json()
search_results = search_data.get("query", {}).get("search", [])

if not search_results:
return {"error": "No results found"}

# Use canonical Wikipedia title from search result
page_title = search_results[0]["title"]

# Step 2: Construct summary URL using canonical title
url = (
f"https://{language}.wikipedia.org/api/rest_v1/page/summary/"
f"{page_title.replace(' ', '_')}?redirect=true"
)

r = task.executor(requests.get, url, headers=headers)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,35 @@ This method works with **any language**, **any voice**, and **any number of cust
- If too long, the beginning of the user’s command might be missed.

---

# View Assist – Change Avatar (Quick Setup Tutorial)

If you want to **change the active View Assist avatar using voice commands**, you can download the blueprint here:

[![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](https://my.home-assistant.io/badges/blueprint_import.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https://github.com/dinki/View-Assist/blob/main/View_Assist_custom_sentences/community_contributions/Avatar_Prompt_Responses/blueprint-change_avatar)

## Setup instructions

1. **Import the blueprint** into Home Assistant and create a new automation from it.
2. Select the **Assist Satellites** you want to control.
3. Select the **avatar sensor(s)** used by View Assist (these update the avatar, GIFs, and prompts).
4. Configure up to **four avatars**. For each avatar, provide:
- **Name** – the display name of the avatar.
- **ID** – must match the avatar ID in `config/view-assist/custom_overlays/overlay.html` (e.g., `avatar_jarvis`).
- **Pipeline** – choose a pipeline corresponding to the avatar’s voice (male/female, specific voice model, etc.).
- **Wake word** – select an existing, functional wake word.
- **Custom Prompt Response automation** – a separate automation that handles responses for this avatar (e.g., using a matching voice/prompt).
- **Aliases (optional)** – alternative names for the avatar for easier voice recognition.
5. Define **trigger sentences** using `{avatar}` as a placeholder, for example:
- `I want to speak to {avatar}`
- `Vreau să vorbesc cu {avatar}`

Once configured, saying a sentence like *“I want to speak to Jarvis”* will:
- Switch the active avatar across all selected satellites
- Update the avatar sensor(s) in View Assist
- Enable the correct Custom Prompt Response automation for that avatar
- Disable other avatar automations

This setup ensures each avatar has a **dedicated voice, pipeline, wake word, and automation**, fully synchronized across your devices.
## ✅ Summary

Once set up, your system will:
Expand Down
4 changes: 2 additions & 2 deletions wiki/docs/extend-functionality/views/music/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Music View Alternative
- **Description**: Used for streaming music and radio. Two views exist. You can choose whichever you prefer.
- **Defaultname**: music
- **Current Version**: v1.0.0
- **Code link**: [Music View Raw Code](https://raw.githubusercontent.com/dinki/View-Assist/main/View%20Assist%20dashboard%20and%20views/views/music/music.yaml) | [Music View Alternative Raw Code](https://raw.githubusercontent.com/dinki/View-Assist/main/View%20Assist%20dashboard%20and%20views/views/music/music-alternative.yaml)
- **Code link**: [Music View Alternative Raw Code](https://raw.githubusercontent.com/dinki/View-Assist/refs/heads/main/View%20Assist%20dashboard%20and%20views/views/music/music-alternative.yaml)
- **Special Requirements**: None

## Installation

Views are automatically installed courtesy of the View Assist integration
Main views are automatically installed courtesy of the View Assist integration. You will need to create the alternative view manually if you choose to use it.

## Changelog

Expand Down
23 changes: 22 additions & 1 deletion wiki/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,26 @@
title: "Frequently Asked Questions"
sidebar_position: 8
---
Here's a list of frequently asked questions. More FAQs will be added.

# Frequently Asked Questions

<details>
<summary>What is View Assist?</summary>

View Assist provides visual feedback for the Home Assistant Assist voice assistant using a collection of different automations, custom sentences, scripts, and extensions with the view being displayed on any Android device. Multiple devices can join the View Assist satellite network and interact. This is not limited to Android devices as voice only ESPHome satellites like the Home Assistant Voice Preview Edition are also supported. Some users have even brought Linux devices in as View Assist satellites as well.

</details>

<details>
<summary>Why is the dashboard on my PC browser is showing a box telling me to register the device</summary>

You are trying to use View Assist on a PC or other nonView Assist satellite device. The dashboard is only for use on VA satellite devices. The dashboard is only used by View Assist satellites and will not work for general browsing outside of those registered devices

</details>

<details>
<summary>Why am I'm seeing an error or no data when I manually browse to a view on the View Assist dashboard?</summary>

View Assist relies on Assist voice automations to provide information dynamically to the views. When you browse to views manually you will not have the underlying data the view needs to display something worth seeing.

</details>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ View Assist includes ready-to-use templates:
| `home` | Navigate to clock view | home |
| `weather` | Navigate to weather view | weather-sunny |
| `camera` | Navigate to camera view | cctv |
| `music` | Navigate to music view | music |
| `menu` | Toggle menu display | menu | (This is used by the integration and shouldn't be included in your icon list.)

### Custom Templates
Expand Down