mirror of
https://github.com/jomjol/AI-on-the-edge-device-docs.git
synced 2025-12-08 04:27:02 +03:00
Add Makefile and Markdown linter (#73)
* Add Makefile * Update .gitignore to exclude venv * Add requirements.txt for venv * Add pymarkdown lint Github action * Update .md from lint tool * Update README with make commands * Add linter config
This commit is contained in:
committed by
GitHub
parent
bbe3bd79db
commit
0cd98c67e2
@@ -1,4 +1,5 @@
|
||||
# Integration into Home Assistant
|
||||
|
||||
There are 3 ways to get the data into your Home Assistant:
|
||||
|
||||
1. Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery)
|
||||
@@ -8,6 +9,7 @@ There are 3 ways to get the data into your Home Assistant:
|
||||
The first one is the easier way if you already have MQTT in use.
|
||||
|
||||
## Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery)
|
||||
|
||||
Starting with Version `>12.0.1`, AI-on-the-edge-devices support Home Assistant Discovery.
|
||||
|
||||
1. Check [here](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery) to learn more about it and how to enable it in Homeassistant.
|
||||
@@ -23,11 +25,12 @@ On the next start of the device, it will send discovery topics and Home Assistan
|
||||

|
||||

|
||||
|
||||
|
||||
### Using MQTT (Manually Setup Entities)
|
||||
|
||||
First make sure with an MQTT client (for example [MQTT Explorer](http://mqtt-explorer.com/)) that MQTT works as expected and to get a list of the available topics!
|
||||
|
||||
Then add a sensor for each property:
|
||||
|
||||
```yaml
|
||||
mqtt:
|
||||
sensor:
|
||||
@@ -73,7 +76,9 @@ mqtt:
|
||||
payload_available: connected
|
||||
payload_not_available: connection lost
|
||||
```
|
||||
|
||||
If you run the discovery once, you can also extract the information from there (MQTT Info, untested):
|
||||
|
||||
```yaml
|
||||
mqtt: # Extracted form the Discovery but untested!
|
||||
sensor:
|
||||
@@ -90,6 +95,7 @@ mqtt: # Extracted form the Discovery but untested!
|
||||
```
|
||||
|
||||
If you want to convert the `m³` to `l`, use a template sensor:
|
||||
|
||||
```yaml
|
||||
template:
|
||||
- sensor:
|
||||
@@ -118,22 +124,24 @@ utility_meter:
|
||||
Note that you also can add it using the UI.
|
||||
|
||||
### Examples
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Statistics Graph
|
||||
|
||||
Creating Statistics Graphs (e.g. usage per day) is easy using the [Energy Dashboard](https://www.home-assistant.io/home-energy-management/):
|
||||

|
||||
|
||||
Note that there seems to be a bug in the graph, see [https://github.com/home-assistant/frontend/issues/13995](https://github.com/home-assistant/frontend/issues/13995)!
|
||||
|
||||
|
||||
### InfluxDb Graphs
|
||||
|
||||
See also [Influx-DB](Influx-DB.md).
|
||||
|
||||
If you have setup InfluxDB already, it is also possible to fetch statistics from there, e.g. daily usage:
|
||||
|
||||
```
|
||||
from(bucket: "HomeAssistant")
|
||||
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|
||||
@@ -146,8 +154,8 @@ from(bucket: "HomeAssistant")
|
||||
|
||||

|
||||
|
||||
|
||||
## Using REST
|
||||
|
||||
When using REST, Home Assistant has to periodically call an URL on the ESP32 which in return provides the requested data.
|
||||
|
||||
See [REST API](REST-API.md) for a list of available URLs.
|
||||
@@ -155,6 +163,7 @@ See [REST API](REST-API.md) for a list of available URLs.
|
||||
The most practical one is the `json` entrypoint which provides the most relevant data JSON formatted:
|
||||
`http://<IP>/json`
|
||||
This would return:
|
||||
|
||||
```JSON
|
||||
{
|
||||
"main":
|
||||
@@ -170,6 +179,7 @@ This would return:
|
||||
```
|
||||
|
||||
To do such a REST call, you need to create a REST sensor:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
|
||||
@@ -218,8 +228,8 @@ sensor:
|
||||
|
||||
See also https://community.home-assistant.io/t/rest-sensor-nested-json/243420/9
|
||||
|
||||
|
||||
#### Photo
|
||||
|
||||
REST can also be used to show the photo of the last round:
|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user