atHomeApp
Note: This app is replaced by the Domoticz Quick Viewer.
Note: in the meantime added more devices.
Objectives
To create a flexible Home Automation Android & Windows App to view & control devices atHome.
Attached without the libraries used
Note: This app is replaced by the Domoticz Quick Viewer.
Note: in the meantime added more devices.
Objectives
To create a flexible Home Automation Android & Windows App to view & control devices atHome.
- atHome is a private project building a Home Automation Solution
- based on Domoticz Home Automation System v4, running on a Raspberry Pi 3B+ Stretch
- atHomeApp is created with B4A v8.50 and B4J v6.51
- Open Source GNU Lesser General Public License
- first private showcase learning Mobile Development B4A / B4J + XUI
- Make the app as generic as possible, means the data of the Domoticz server should be used as is without making dedicated changes in the app
- Keep the App SIMPLE – not overcomplicating - fast access to view & control is key
- B4J version here
- Published on the Domoticz Forum
- View & control devices which are added to the Domoticz Dashboard ("favorites")
- Devices are grouped and displayed in tabs (B4A TabStripViewPager Custom View, B4J TabPane)
- Own device grouping used (not Domoticz menus) to build the tabs: Weather, Lights, Information
- Tabs containing xCustomListView to view or control devices and to manage settings via CheckBox/InputDialog
- xCustomListView items are build at runtime using Domoticz Favorite Devices data
- Domoticz Favorite Devices data is requested via HTTP (okhttputils2) and the JSON rersponse is parsed to get the relevant data
- Data refreshed is triggered manually via menu item (Tab Settings shows time refreshed)
- If Domoticz favorite devices are changed (added/removed/updated), these are reflected on the next manual updated (no changes required in the App, full flexible to handle change)
- Clicking on xCustomListView item shows short toastmessage with additional information
- Tab Lights enabled to control switches (on/off), lights (on/off) and dimmer. When dimming, a short toastmessage shows the dim level. Mainly used for Philips Hue Bulbs
- Tab Information enables to send a message to the Alert Message device via InputDialog
- Settings are managed via Tab Settings and stored using map file (in file internal)
- At App resume (B4A), data is refreshed
- Menus added to refresh the data as mentioned, jump to tabs (pages)
- Extend parsing device Types & Subtypes as not all Domotict types are supported yet
- Handle devices thresholds, i.e. change data color depending level
- Consider to update real time or use a timer to autorefresh - but will cause high network traffic
- Consider selective devices from all devices data - needs customizing (=effort to maintain, non standard), high data volume
- Various smaller improvements
- To get started with xCustomListViews, view the very good video tutorial first - could not build the solution without the video!
- Android.jar: ensure(!) to set minimum android-28\android.jar (else error unable to find attribute android:fontVariationSettings) - it was a surprise after updating the SDK - but solved with help from the forum
- Use the Domoticz JSON/API reference for building URL requests
- Use browser first to test and learn the properties of the URL requests & response from the Domoticz server
- Screenshots made with the Android device monitor (folder tools, monitor.bat)
- All constants defined in code module Constants, Tabs text & icons defined in a map with maps
- Initial Development effort: 2 days (30% Conceptual Design on Paper, 40% Exploring How To Solutions, 30% Coding & Testing)
Attached without the libraries used
Attachments
Last edited: