Skip to content

Commit

Permalink
[DOCS] - Enrich use documentation (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile authored Apr 12, 2023
1 parent aff45e2 commit c3de541
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 27 deletions.
Binary file not shown.
Binary file added docs/.vuepress/public/videos/Theengs-app-demo.mp4
Binary file not shown.
Binary file modified docs/img/Theengs-app-background-updates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-battery-excluded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-battery-unrestricted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-location-permission-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-location-permission.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-nearby-permission.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/Theengs-app-unused-permission.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 47 additions & 27 deletions docs/use/use.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,63 @@
# Use

Features comparison between OS:
## Features comparison between OS
| OS | Real time data | MQTT integration | Running in background | Home Assistant Auto Discovery |
|:-:|:-:|:-:|:-:|:-:|
|iOS|☑️|☑️||☑️|
|Android|☑️|☑️|☑️ *experimental*|☑️|

## iOS
## Overview

The application will ask you for permission to use Bluetooth. You can learn more on Apple [website](https://support.apple.com/HT210578).
<iframe width="353" height="628" src="/videos/Theengs-app-demo.mp4" frameborder="0" type="video/mp4" allowfullscreen></iframe>

## Real time data
The app enables to retrieve BLE sensor real time data, to add new sensors tap "Search for new sensors" in the hamburger menu.

To refresh the sensor data tap "Refresh sensor data" in the hamburger menu.

::: tip Note
Why does Theengs App needs the location permission?

Theengs App requires the location permission to access your device Bluetooth and retrieves sensor data. Theengs is not accessing your location with GPS/GLONASS/BAIDU.
:::

## MQTT integration

Prerequisites:
* MQTT broker setup in your local network (Mosquitto is a well known broker)

Theengs app can publish the data to an MQTT broker, to do so go to the hamburger menu, select Integration.
Enter the following informations:
* Broker host IP (compulsory)
* Broker port (compulsory, default: `1883`)
* Username (optional)
* Password (optional)
* Topic (compulsory, default: `home`)
* SubTopic (compulsory, default: `TheengsApp`)

Once done click on the MQTT switch to activate the integration, if the app can connect to the broker, it will display "Connected" in the top right.

<iframe width="353" height="767" src="/videos/Theengs-App-mqtt-integration.mp4" frameborder="0" type="video/mp4" allowfullscreen></iframe>

### iOS specificity

If you want to push data to an MQTT broker you will need to manually enter a MAC address for the sensor, this is done from the sensor page see below:

![add-mac](./../img/Theengs-set-mac.png)

## Android
### Home Assistant Auto Discovery

Theengs app can publish your sensor definition following Home Assistant MQTT convention, so as to do this you need to activate “Enable discovery” into your MQTT Options and follow the steps below:

![location](./../img/Theengs_app_auto_discovery_BLE_Sensor_Home_Assistant.gif)

The sensor definition will be publish when the app connect to the broker. You can retrigger the publication by deactivating and reactivating the MQTT integration from the application.

## iOS permissions

The application will ask you for permission to use Bluetooth. You can learn more on Apple [website](https://support.apple.com/HT210578).

## Android permissions

The Android operating system requires applications to ask for device location permission in order to scan for nearby Bluetooth Low Energy sensors.
You would need to go into the app information (long press on the icon -> (i)) so as to configure the app permissions properly.
Expand Down Expand Up @@ -82,26 +125,3 @@ Some devices also require the GPS to be turned on while scanning for new sensors
Android has drastically reduced the capabilities of apps to run in the background, as a consequence the Update interval set into the app may not be followed by the operating system.
You may also have more regular results when the device is charging.
:::

## Home Assistant Auto Discovery

Theengs app can publish your sensor definition following Home Assistant MQTT convention, so as to do this you need to activate “Enable discovery” into your MQTT Options and follow the steps below:

![location](./../img/Theengs_app_auto_discovery_BLE_Sensor_Home_Assistant.gif)

The sensor definition will be publish when the app connect to the broker. You can retrigger the publication by deactivating and reactivating the MQTT integration from the application.

## Linux ('live mode' and 'historical data')

While reading Flower Care and RoPot historical entry count, the sensors usually freeze for up to a second, and the Linux kernel consider that to be a connection timeout.
To be able to get the historical data working on Linux, you'll need to increase the "supervision timeout" value (while root):

```bash
# echo 100 > /sys/kernel/debug/bluetooth/hci0/supervision_timeout
```

You could also give Theengs binary the _net_raw_ and _net_admin_ capabilities, so that it could be allowed to changes the supervision timeout on its own. But at the moment that's not fully implemented.

```bash
# setcap 'cap_net_raw,cap_net_admin+eip' theengs
```

0 comments on commit c3de541

Please sign in to comment.