-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added firmware `#` configuration parameters to `smart-sensor` example - refactored `smart-sensor*` code
- Loading branch information
Showing
37 changed files
with
234 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,37 @@ | ||
Smart sensor with display and HomeGenie Mini UI. | ||
|
||
# smart-sensor | ||
|
||
Smart multi-sensor device with display. HomeGenie Mini UI example use. | ||
|
||
- [Documentation and firmware install page](https://homegenie.it/mini/1.2/examples/smart-sensor/) | ||
|
||
|
||
## Firmware configuration (in addition to default system options) | ||
|
||
| Key | Description | Default | | ||
|------------|-------------------------------------|---------| | ||
| `ligh-typ` | Light sensor type | -1 | | ||
| `ligh-pin` | Light sensor GPIO# | -1 | | ||
| `motn-typ` | Motion sensor type | -1 | | ||
| `motn-pin` | Motion sensor GPIO# | -1 | | ||
| `soth-typ` | Temperature sensor type | -1 | | ||
| `soth-pin` | Temperature sensor GPIO# | -1 | | ||
| `sdht-typ` | Temperature + Humidity sensor type | -1 | | ||
| `sdht-pin` | Temperature + Humidity sensor GPIO# | -1 | | ||
|
||
|
||
### Manual build and install | ||
|
||
You can also manually build and install the firmware from source code | ||
as explained in the [Getting started](../../getting-started#custom-firmware) page | ||
and using the following commands for flashing the firmware: | ||
|
||
```bash | ||
pio run -e smart-sensor[<target>] -t upload | ||
``` | ||
|
||
where the optional `<target>` suffix can be one of the following: | ||
- ESP32 + display | ||
`-display` | ||
- ESP32-S3 + display | ||
`-display-s3` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// Created by gene on 21/06/24. | ||
// | ||
|
||
#ifndef HOMEGENIE_MINI_COMMONSENSORS_H | ||
#define HOMEGENIE_MINI_COMMONSENSORS_H | ||
|
||
#include "HomeGenie.h" | ||
|
||
#include "io/sensors/DS18B20.h" | ||
#include "io/sensors/MotionSensor.h" | ||
#include "io/sensors/DHTxx.h" | ||
#include "io/sensors/LightSensor.h" | ||
|
||
using namespace IO::Sensors; | ||
|
||
void includeCommonSensors(HomeGenie* homeGenie, Module* miniModule) { | ||
|
||
// Light sensor | ||
if (Config::getSetting("ligh-typ").equals("ldr")) { | ||
auto lightSensor = new LightSensor(Config::getSetting("ligh-pin").toInt()); | ||
lightSensor->setModule(miniModule); | ||
homeGenie->addIOHandler(lightSensor); | ||
} | ||
|
||
// Motion sensor | ||
if (Config::getSetting("motn-typ").equals("switch")) { | ||
uint8_t motionSensorPin = Config::getSetting("motn-pin").toInt(); | ||
auto motionSensor = new MotionSensor(motionSensorPin); | ||
motionSensor->setModule(miniModule); | ||
homeGenie->addIOHandler(motionSensor); | ||
} | ||
|
||
// Temperature sensor | ||
if (Config::getSetting("soth-typ").equals("ds18b20")) { | ||
auto temperatureSensor = new DS18B20(Config::getSetting("soth-pin").toInt()); | ||
temperatureSensor->setModule(miniModule); | ||
homeGenie->addIOHandler(temperatureSensor); | ||
} | ||
|
||
// DHT-xx Temperature and humidity sensor | ||
uint8_t dhtSensorPint = Config::getSetting("sdht-pin").toInt(); | ||
if (Config::getSetting("sdht-typ").equals("22")) { | ||
auto dhtSensor = new DHTxx(22, dhtSensorPint); | ||
dhtSensor->setModule(miniModule); | ||
homeGenie->addIOHandler(dhtSensor); | ||
} else if (Config::getSetting("sdht-typ").equals("11")) { | ||
auto dhtSensor = new DHTxx(11, dhtSensorPint); | ||
dhtSensor->setModule(miniModule); | ||
homeGenie->addIOHandler(dhtSensor); | ||
} | ||
} | ||
|
||
#endif //HOMEGENIE_MINI_COMMONSENSORS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# smart-sensor | ||
|
||
A smart multi-sensor device. | ||
|
||
- [Documentation and firmware install page](https://homegenie.it/mini/1.2/examples/smart-sensor/) | ||
|
||
|
||
## Firmware configuration (in addition to default system options) | ||
|
||
| Key | Description | Default | | ||
|------------|-------------------------------------|---------| | ||
| `ligh-typ` | Light sensor type | -1 | | ||
| `ligh-pin` | Light sensor GPIO# | -1 | | ||
| `motn-typ` | Motion sensor type | -1 | | ||
| `motn-pin` | Motion sensor GPIO# | -1 | | ||
| `soth-typ` | Temperature sensor type | -1 | | ||
| `soth-pin` | Temperature sensor GPIO# | -1 | | ||
| `sdht-typ` | Temperature + Humidity sensor type | -1 | | ||
| `sdht-pin` | Temperature + Humidity sensor GPIO# | -1 | | ||
|
||
|
||
### Manual build and install | ||
|
||
You can also manually build and install the firmware from source code | ||
as explained in the [Getting started](../../getting-started#custom-firmware) page | ||
and using the following commands for flashing the firmware: | ||
|
||
```bash | ||
pio run -e smart-sensor[<target>] -t upload | ||
``` | ||
|
||
where the optional `<target>` suffix can be one of the following: | ||
- ESP8266 | ||
`-d1-mini` | ||
- ESP32 D1 Mini | ||
`-d1-mini-esp32` |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.