Skip to content

Commit 1e5c42b

Browse files
authored
Docs update (#146)
* Doc updates. * Doc updates.
1 parent a9d327e commit 1e5c42b

File tree

1 file changed

+95
-56
lines changed

1 file changed

+95
-56
lines changed

README.md

+95-56
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ _Virtual_ is a component that provides virtual entities for _Home Assistant_.
88
# !!!BREAKING CHANGES!!!
99

1010
Version 0.9 supports adding virtual devices using _config flow_. By default it
11-
will move your existing devices into a single file `virtual.yaml`. If you
12-
**DO NOT** want this behaviour add this to your `virtual` configuration.
11+
will move your existing devices into a single file `virtual.yaml`. If you **DO
12+
NOT** want this behaviour add this to your current `virtual` configuration.
1313

1414
```yaml
1515
virtual:
@@ -19,39 +19,46 @@ virtual:
1919
2020
# Table Of Contents
2121
22-
<!-- TOC -->
23-
* [**Virtual devices for Home Assistant**](#virtual-devices-for-home-assistant)
24-
* [!!!BREAKING CHANGES!!!](#breaking-changes)
25-
* [Table Of Contents](#table-of-contents)
26-
* [Introduction](#introduction)
27-
* [Notes](#notes)
28-
* [Version 0.8 Documentation](#version-08-documentation)
29-
* [New Features in 0.9.0](#new-features-in-090)
30-
* [Config Flow](#config-flow)
31-
* [What pieces are done](#what-pieces-are-done)
32-
* [What you need to be wary of](#what-you-need-to-be-wary-of)
33-
* [What pieces need doing](#what-pieces-need-doing)
34-
* [What if it goes wrong?](#what-if-it-goes-wrong)
35-
* [Thanks](#thanks)
36-
* [Installation](#installation)
37-
* [HACS](#hacs)
38-
* [Component Configuration](#component-configuration)
39-
* [Entity Configuration](#entity-configuration)
40-
* [Common Attributes](#common-attributes)
41-
* [Availability](#availability)
42-
* [Persistence](#persistence)
43-
* [Switches](#switches)
44-
* [Binary Sensors](#binary-sensors)
45-
* [Sensors](#sensors)
46-
* [Lights](#lights)
47-
* [Locks](#locks)
48-
* [Fans](#fans)
49-
* [Covers](#covers)
50-
* [Valves](#valves)
51-
* [Device Tracking](#device-tracking)
52-
* [Old Style Entity Configuration](#old-style-entity-configuration)
53-
* [Services](#services)
54-
<!-- TOC -->
22+
23+
<!--toc:start-->
24+
- [**Virtual devices for Home Assistant**](#virtual-devices-for-home-assistant)
25+
- [!!!BREAKING CHANGES!!!](#breaking-changes)
26+
- [Table Of Contents](#table-of-contents)
27+
- [Introduction](#introduction)
28+
- [Notes](#notes)
29+
- [Version 0.8 Documentation](#version-08-documentation)
30+
- [New Features in 0.9.0](#new-features-in-090)
31+
- [Config Flow](#config-flow)
32+
- [What pieces are done](#what-pieces-are-done)
33+
- [What you need to be wary of](#what-you-need-to-be-wary-of)
34+
- [What if it goes wrong?](#what-if-it-goes-wrong)
35+
- [Thanks](#thanks)
36+
- [Installation](#installation)
37+
- [Getting the Software](#getting-the-software)
38+
- [HACS](#hacs)
39+
- [Adding the Integration](#adding-the-integration)
40+
- [After a Fresh Install](#after-a-fresh-install)
41+
- [After an Upgrade](#after-an-upgrade)
42+
- [I don't want the New Behaviour!!!](#i-dont-want-the-new-behaviour)
43+
- [Adding More Entries](#adding-more-entries)
44+
- [Component Configuration](#component-configuration)
45+
- [Entity Configuration](#entity-configuration)
46+
- [File Layout](#file-layout)
47+
- [Common Attributes](#common-attributes)
48+
- [Availability](#availability)
49+
- [Persistence](#persistence)
50+
- [Switches](#switches)
51+
- [Binary Sensors](#binary-sensors)
52+
- [Sensors](#sensors)
53+
- [Lights](#lights)
54+
- [Locks](#locks)
55+
- [Fans](#fans)
56+
- [Covers](#covers)
57+
- [Valves](#valves)
58+
- [Device Tracking](#device-tracking)
59+
- [Old Style Entity Configuration](#old-style-entity-configuration)
60+
- [Services](#services)
61+
<!--toc:end-->
5562
5663
5764
# Introduction
@@ -76,22 +83,15 @@ Finally. After sitting on it for far too long I decided to do the work I
7683
needed to, this integration now acts much like every integration, splitting
7784
down by entity, device and integration.
7885

79-
This means a lot of this documentation is now out of date, I will upgrade it
80-
when all the changes have been finalized, for now I will just add a quick note
81-
inline.
82-
8386
#### What pieces are done
8487

8588
- _upgrade_; the code will upgrade a _0.8_ build to the _config flow_ system.
8689
Your current configuration will be moved into 1 file, `virtual.yaml`. This
8790
file contains all your virtual devices. Edit this file to add any type of
8891
device.
89-
- _configuration_; the settings are still available you only need to edit them
90-
in one place, `virtual.yaml`. The layout should be obvious after the
91-
upgrade.
92-
- _multiple integration instances_; you can group virtual devices, each group
93-
will use a different configuration file
9492
- _services_; they follow the _Home Assistant_ standard
93+
- _multiple integrations_; the integration can be added several times and you
94+
can spread your devices across several files
9595
- _device groupings_; for example, a motion detector can have a motion
9696
detection entity and a battery entity, upgraded devices will have a one to
9797
one relationship. For example, the following will create a motion device
@@ -121,12 +121,6 @@ inline.
121121
4. delete the virtual integration
122122
5. add back the virtual integration in accepting the defaults
123123

124-
#### What pieces need doing
125-
126-
- _reload/reconfigure_; this somewhat works, but I need to deal with orphans
127-
when devices are turned off
128-
- _documentation_; the configuration is handled differently now
129-
130124
#### What if it goes wrong?
131125

132126
For now I recommend leaving your old configuration in place so you can revert
@@ -149,19 +143,56 @@ Many thanks to:
149143

150144
# Installation
151145

152-
## HACS
146+
## Getting the Software
147+
148+
### HACS
153149
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration)
154150

155151
Virtual is part of the default HACS store. If you're not interested in
156152
development branches this is the easiest way to install.
157153

154+
## Adding the Integration
155+
156+
### After a Fresh Install
157+
158+
When you have created your initial configuration file do the following:
159+
160+
- go to `Settings` -> `Devices and Integrations` -> `+ ADD INTEGRATION`
161+
- search for _virtual_ and choose the integration
162+
- give your configuration a name and point it at your newly created file
163+
164+
Then you click OK
165+
166+
### After an Upgrade
167+
168+
All your devices will be moved to a group called _import_ and put into
169+
`/config/virtual.yaml`. The system will create a single _virtual_ integration.
170+
171+
## I don't want the New Behaviour!!!
172+
173+
If you want to keep your existing behaviour change your current `virtual`
174+
entry in `configuration.yaml` to this:
175+
176+
```yaml
177+
virtual:
178+
yaml_config: True
179+
```
180+
181+
## Adding More Entries
182+
183+
You can add more than one integration by selecting `Add Entry` on the
184+
_virtual_ integration page. You will need to give this new entity group a name
185+
and point it to the new file.
186+
158187

159188
# Component Configuration
160189

161-
- `yaml_config`; set to `True` to enable backwards compatability, set to `False`
190+
You set this to enable backwards compatibility.
191+
192+
- `yaml_config`; set to `True` to enable backwards compatibility, set to `False`
162193
to disable it. The default is `False`.
163194

164-
For example, this enable backwards compatability.
195+
For example, this enable backwards compatibility.
165196

166197
```yaml
167198
virtual:
@@ -171,10 +202,18 @@ virtual:
171202

172203
# Entity Configuration
173204

174-
All component configuration is done through a _yaml_ file. There is a single
175-
file per integration instance. The default file, created on upgrade, is
176-
`/config/virtual.yaml`. An empty file looks like this:
205+
All component configuration is done through _yaml_ files. You can put all of
206+
your virtual devices into a single _yaml_ file or you can group devices
207+
together in multiple file.
208+
209+
If this is a fresh install you will need to install a _virtual_ integration
210+
instance and tell it about your file. If you are upgrading from _0.8_ the system will
211+
create a single instance and copy all your current devices into a
212+
`/config/virtual.yaml`.
213+
214+
## File Layout
177215

216+
An empty file looks like this:
178217
```yaml
179218
version: 1
180219
devices: {}

0 commit comments

Comments
 (0)