Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
riley206 committed Sep 28, 2023
1 parent 24b6438 commit 65458c6
Showing 1 changed file with 21 additions and 40 deletions.
61 changes: 21 additions & 40 deletions services/core/PlatformDriverAgent/HomeAssistantDriver.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**VOLTTRON Home Assistant Driver.**

The Home Assistant driver provides VOLTTRON with a way to access any point of data from a home assistant device. It currently allows for control of lights and thermostats.
The Home Assistant driver provides VOLTTRON with a way to access any point of data from a home assistant device. It currently allows for control of lights and thermostats.

Please see the README for the platform driver.
[services/core/PlatformDriverAgent/README.md](https://github.com/riley206/Rileys_volttron/blob/55146b78d3ab7f53d08598df272cdda2d0aa8d3d/services/core/PlatformDriverAgent/README.md)
Expand All @@ -25,74 +25,59 @@ Listener agent: https://volttron.readthedocs.io/en/main/introduction/platform-in

Platform driver agent: https://volttron.readthedocs.io/en/main/agent-framework/core-service-agents/platform-driver/platform-driver-agent.html?highlight=platform%20driver%20isntall#configuring-the-platform-driver

Once you have cloned the repo, fill out your configuration files. Each device/entity will have 1 configuration file. Each set of homogenous devices such as lights will share one registry file.

For example below we have two seperate lights.
Once you have cloned the repo, fill out your configuration files. Each device will have 2. Make sure your registry_config points to your devices registry file from the config store. Below there are examples for lights and thermostats.

**lights**
```json
{
"driver_config": {
"ip_address": "Your Home Assistant IP address",
"access_token": "Your Access Token",
"port": "Your port",
"entity_id": "light.example"
},
"driver_type": "home_assistant",
"registry_config":"config://lights.json",
"interval": 30,
"timezone": "UTC"
}
```
```json
{
"driver_config": {
"ip_address": "Your Home Assistant IP address",
"access_token": "Your Access Token",
"port": "Your port",
"entity_id": "light.example2"
"ip_address": "Your Home Assistant IP",
"access_token": "Your Home Assistant Access Token",
"port": "Your Port"
},
"driver_type": "home_assistant",
"registry_config":"config://lights.json",
"registry_config":"config://light.example.json",
"interval": 30,
"timezone": "UTC"
}
```
Both light.example and light.example2 will share this registry file below. Light states are currently converted to integers with 0 being off and 1 being on.
Your register file will contain one device, with the ability to add attributes. Entity ID is used to extract data from Home Assistant, and Volttron Point Name will get the state or attributes defined. In this example, the file name is light.example.json

**lights.json**
**light.example.json**
```json
[
{
"Entity ID": "light.example",
"Volttron Point Name": "state",
"Units": "On / Off",
"Units Details": "0: off, 1: on",
"Units Details": "on/off",
"Writable": true,
"Starting Value": true,
"Type": "int",
"Notes": "state control"
"Type": "boolean",
"Notes": "lights hallway"
},
{
"Entity ID": "light.example",
"Volttron Point Name": "brightness",
"Units": "int",
"Units Details": "0-255 light level",
"Units Details": "light level",
"Writable": true,
"Starting Value": 0,
"Type": "int",
"Notes": "brightness control"
"Notes": "brightness control, 0 - 255"
}
]
```
**Thermostats**

For thermostats the state is also converted into numbers. "1: Off, 2: heat, 3: Cool, 4: Auto".
For thermostats the state is converted into numbers. "1: Off, 2: heat, 3: Cool, 4: Auto",
```json
[
{
"Entity ID": "climate.my_thermostat",
"Volttron Point Name": "state",
"Units": "int",
"Units Details": "0: Off, 2: heat, 3: Cool, 4: Auto",
"Units": "Enumeration",
"Units Details": "1: Off, 2: heat, 3: Cool, 4: Auto",
"Writable": true,
"Starting Value": 1,
"Type": "int",
Expand Down Expand Up @@ -120,22 +105,18 @@ For thermostats the state is also converted into numbers. "1: Off, 2: heat, 3: C
}
]
```
Attributes can be found in developer tools in the GUI of Home Assistant.
Attributes can be found in developer tools or by opening the device in the GUI of Home Assistant.

![image](https://github.com/riley206/Rileys_volttron/assets/89715390/a367e61e-8b73-4f35-a179-dfda235ddcbe)


**Add to config store**

Add the registers files and the config files into the VOLTTRON config store.


```bash
vctl config store platform.driver lights.json PATH/TO/lights.json

vctl config store platform.driver devices/BUILDING/ROOM/light.example PATH/TO/light.example.config
vctl config store platform.driver light.example.json HomeAssistant_Driver/light.example.json

vctl config store platform.driver devices/BUILDING/ROOM/light.example2 PATH/TO/light.example2.config
vctl config store platform.driver devices/BUILDING/ROOM/light.example HomeAssistant_Driver/light.example.config
```


Expand Down

0 comments on commit 65458c6

Please sign in to comment.