Elisys Home Automation Server (Java) is the back-end side for the following projects:
- Elisys ESP32 Motion Detector (Rust)
- Elisys ESP32 Weather Station (Rust)
- Elisys ESP32 Relay Client (Rust)
- Elisys ESP32 Alarm Clock (Rust)
There is also a basic implementation of the front end side, and it is called
Currently, Elisys Home Automation Server supports the motion, temperature, humidity and pressure sensors, so that it allows to store and retrieve the data provided by a several sensors controlled by a ESP32 device (or Raspberry Pi). Moreover, E.H.A.S. provides the functionality to control remotely a Relay device and to control an Alarm Clock.
In brief E.H.A.S. allows to:
-
retrieve data from a Motion detector
- supply the configuration for the motion sensor when it starts for the first time;
- send notifications via Discord when a motion is detected, so that when a post request is handled;
- keep trace about the sensor status: alive/disabled.
-
retrieve data from a Weather station
- store temperature/humidity/pressure from sensors
- provide the last temperature/humidity/pressure values
- provide the list of temperature/humidity/pressure values by date
- provide the average of temperature/humidity/pressure by date
- provide the minimum temperature by date
- provide the maximum temperature by date
-
control remotely a Relay
- control remotely a Relay
-
control remotely an Alarm Clock
- define new alarms/remove alarms
Elisys Home Automation was implemented using Java, Spring Boot, MapStruct, Lombok, OpenApi, Feign, Liquibase, Hibernate and PostgreSQL.
Rename src/main/resources/application.properties
in src/main/resources/application-dev.properties
.
Configure IntelliJ IDEA in this way:
Before run the application for the first time it is necessary to configure these properties in application.properties
file in order to make motion sensor work properly:
feign.discord.message.post=/api/webhooks/846237846238746328746/HELLO_WORLD
app.configuration.default.motion.sensor.iamalive.interval.seconds=30
app.configuration.default.motion.sensor.iamalive.endpoint=http://localhost:8080/api/v1/i-am-alive/notify
app.configuration.default.motion.sensor.alert.endpoint=http://localhost:8080/api/v1/motion-sensor/alert
Just build the jar by executing the following statement:
./gradlew bootJar
Next, run an instance of PostgreSQL:
sudo docker-compose up -d
Then run the jar elisys-home-automation.jar
located in build/libs
in the following way:
java -jar elisys-home-automation.jar
Or for external configuration file:
java -jar -Dspring.config.location=application-dev.properties elisys-home-automation.jar
The API documentation can be found at the following URI (after server starts):
http://localhost:8080/swagger-ui/index.html
There is a postman collection in the root project directory that can be imported in your postman environment.
This project is a Work In Progress.
If you found a bug please contact me here.