Share My Creation Domoticz Quick Viewer

Domoticz Quick Viewer

Purpose

  • To view Domoticz devices in an Android & Desktop (Linux, Windows) App [iOS is not supported].
  • To select devices from room plans and custom plans Favorites, Used, All, Not Used and User Variables.
  • To view selected device properties and the Domoticz device log.
  • To change the value for a selected device - (so far) for switches & thermostats.
Domoticz is a light weight open source home automation system.

1643994185845.png

Screenshot B4A App with test data from the Domoticz Development System running on a Raspberry Pi 4B with Raspberry Pi OS 10 and Domoticz 2022.1.

This app replaces the earlier version atHome.

Solution
The B4XPages framework is used to create the B4A Android version and the B4J Desktop version (Linux, Windows).
The goal has been to keep the app as simple as possible by using the standard B4X libraries, like B4XPages, B4XPreferenceDialog, xCustomListView, XUI, XUI Views.

The core of the app is the custom list view showing the device entries with properties Name, Data, Last Update.
Clicking on an custom list view item shows a dialog with additional properties and the option to show the Domotiz device log in a browser.
Depending of the device type & subtype, a rounded edit button to change the value of the device. Supported are device types switch and thermostat.

The layouts for the mainpage and the custom list view item are the same for B4A & B4J.
There are no additional layouts defined as various B4XDialog standards used - want to keep the app simple but also avoid maintaining layouts for both B4A & B4J.

The preferences enables to set the IP addresses of the Domoticz production server, Domoticz development server, set the production server as default and a refresh interval to regular update the data of the plan viewed.
In addition, there is an explanation field showing About information.

The communication with the Domoticz server is done via HTTP API REST requests with a JSON response.
The JSON response is parsed to update the plan devices list in the custom list view.
The order of the devices listed in the custom list view depends on the plan type: room plan according the defined order, for other plans (Favorites, Used, All, Not Used, User Variables) order by name.

This app has been tested with Android 9 (and 5 on an old device), Windows 10, Ubuntu 20.04, Raspberry Pi OS 10.

Development Hints
* To get started with xCustomListViews, view the video tutorial - could not build the solution without the video.
* Use the Domoticz JSON/API for building URL requests.
* Use browser first to test and learn the properties of the URL JSON API requests & responses from the Domoticz server.
* Initial Development effort: 3 days (20% Conceptual Design on paper, 30% Exploring How To solutions, 50% Coding & Testing)

Installation
Unzip this B4XPages project to a folder of choice, like Domoticz_Quick_Viewer.
The folder ~/Domoticz_Quick_Viewer has sub folder and files:
B4X:
Domoticz_Quick_Viewer\B4X
Domoticz_Quick_Viewer\B4X\B4A
Domoticz_Quick_Viewer\B4X\B4i - NOT Used
Domoticz_Quick_Viewer\B4X\B4J
Domoticz_Quick_Viewer\B4X\Shared Files - NOT Used
Domoticz_Quick_Viewer\B4X\B4XMainPage
Domoticz_Quick_Viewer\B4X\DomoticzController - Class to handle Domoticz communication
Domoticz_Quick_Viewer\LICENCE
Domoticz_Quick_Viewer\README.md
Domoticz_Quick_Viewer\TODO.md
Domoticz_Quick_Viewer\CHANGELOG.md
Then open from the B4A or B4J folder the respective project DomoticzQuickViewer.b4a or DomoticzQuickViewer.b4j.

Source Code (B4A & B4J)
Attached ZIP archive Domoticz_Quick_Viewer_N.NN.zip.

Change Log
See CHANGELOG.md

ToDo
See TODO.md

Licence
The app has been developed for personal use only according the Open Source GNU Lesser General Public License 3.0.
 

Attachments

  • Domoticz_Quick_Viewer_1.00.zip
    46.3 KB · Views: 180
Last edited:
Top