Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.31 KB

readme.md

File metadata and controls

38 lines (27 loc) · 1.31 KB

MQTT Java App for turning light on and off when needed

If you want to run it get yourself Full JDK Liberica 20

Why ?

This app was done for purpose to switch pc light on or off. App it's able to store configuration file where server config is kept, so you can modify and try on your own!

See some of my notes which i've made during the development.

How this app works.

  1. Open it enter your mqtt server credentials
  2. Press save ( app should create and modify config.properties files)
  3. Press Connect If connected you can close and reopen app.

After config file initialized

  1. Since initial config app by default's tries to connect to the known MQTT server
  2. App sends a topic ("java/light/status") with value of 1.
  3. App minimize itself to try
  4. When pc is shutting down there is hook added to the app, so it will send another mqtt message this time with value of 0

Gui preview

Main window:

GUI

Tray icon:

tray

Handle Node-red logic

Now you can handle the logic in Node-Red or somewhere where you like to. nodered

Bonus generated diagram

diagram