Updated Home (markdown)

Aalian Khan
2023-11-07 20:40:04 -05:00
parent 510a1d7249
commit c0a04d6170

80
Home.md

@ -1 +1,79 @@
Welcome to the mushroom-strategy wiki!
# Installation
## Prerequisites
You need to install these cards before using this strategy:
- [Mushroom cards][mushroomUrl]
- [Mini graph card][mini-graphUrl]
## HACS
Mushroom dashboard strategy is available in [HACS][hacsUrl] (Home Assistant Community Store).
1. Install HACS if you don't have it already.
2. Open HACS in Home Assistant.
3. Go to the "Frontend" section.
4. Click the button with the "+" icon
5. Search for "Mushroom dashboard" and install.
## Manual
1. Download `mushroom-strategy.js` file from
the [`dist`](https://github.com/AalianKhan/mushroom-strategy/tree/main/dist) directory.
2. Put `mushroom-strategy.js` file into your `config/www` folder.
3. Add a reference to `mushroom-strategy.js` in Dashboard.
There are two ways to do that:
- **Using UI:** _Settings__Dashboards__More Options icon__Resources__Add Resource_ → Set _Url_
as `/local/mushroom-strategy.js` → Set _Resource type_ as `JavaScript Module`.
**Note:** If you do not see the Resources menu, you will need to enable _Advanced Mode_ in your _User Profile_
- **Using YAML:** Add the following code to the `lovelace` section.
```yaml
resources:
- url: /local/mushroom-strategy.js
type: module
```
# Basic Setup
To add Mushroom Strategy to a dashboard:
1. In the UI of the dashboard, click the three dots in the top right corner.
2. Click _Edit Dashboard_.
3. Click 3 dots again
4. Click `Raw configuration editor`
5. Add the following lines:
```yaml
strategy:
type: custom:mushroom-strategy
views: []
```
You may see the following error
```
Error loading the dashboard strategy:
Error: Timeout waiting for strategy
element ||-strategy-mushroom-strategy to
be registered
```
This is mainly because of cache or HACs didn't create a reference.
Try clearing the cache on your browser and add a reference to mushroom-strategy.js in the Dashboard. There are two ways to do that:
- Using UI:
Settings → Dashboards → More Options icon (3 dots) → Resources → Add Resource →
Set Url to `/hacsfiles/mushroom-strategy/mushroom-strategy.js`
Set Resourcetype to `JavaScript-module`.
Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile
- Using YAML:
Add following code to lovelace section.
```yaml
resources:
- url: /hacsfiles/mushroom-strategy/mushroom-strategy.js
type: module
```
Use `/local/mushroom-strategy.js` as url if you followed the manual installation instructions.
[mushroomUrl]: https://github.com/piitaya/lovelace-mushroom
[mini-graphUrl]: https://github.com/kalkih/mini-graph-card