{"id":23752511,"url":"https://github.com/rwbl/domoticz-quick-access-mobile","last_synced_at":"2025-08-05T06:13:04.520Z","repository":{"id":156024006,"uuid":"302360422","full_name":"rwbl/domoticz-quick-access-mobile","owner":"rwbl","description":"A Domoticz Custom User Interface, accessible from any browser, as a responsive, mobile-first front-end. ","archived":false,"fork":false,"pushed_at":"2020-10-21T06:59:15.000Z","size":4619,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T00:21:57.984Z","etag":null,"topics":["domoticz","dzvents","lua","python"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwbl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-08T14:04:45.000Z","updated_at":"2020-10-21T07:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"49185986-a3ee-4e7c-a5d0-503de987e5ef","html_url":"https://github.com/rwbl/domoticz-quick-access-mobile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwbl/domoticz-quick-access-mobile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Fdomoticz-quick-access-mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Fdomoticz-quick-access-mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Fdomoticz-quick-access-mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Fdomoticz-quick-access-mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwbl","download_url":"https://codeload.github.com/rwbl/domoticz-quick-access-mobile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwbl%2Fdomoticz-quick-access-mobile/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268844981,"owners_count":24316100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["domoticz","dzvents","lua","python"],"created_at":"2024-12-31T17:53:09.160Z","updated_at":"2025-08-05T06:13:04.508Z","avatar_url":"https://github.com/rwbl.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# domoticz-quick-access-mobile\nA Domoticz Custom User Interface, accessible from any browser, as a responsive, mobile-first front-end. \n\n## Purpose\nTo develop for personal use only, a Custom Web Frontend for the [Domoticz Home Automation System](https://domoticz.com/):\n* control frequently used functions, like lights, thermostats, shutter/blinds, climate \u0026 key dates information.\n* simple to use user interface with limited components, i.e. buttons, dropdowns, modal info pages.\n* mainly accessed from mobile devices running Android or iOS.\n* located on a Raspberry Pi running Domoticz 2020.2.\n* created with HTML, JavaScript modules, CSS styles.\n* interacting with Domoticz using JSON via [HTTP API requests](https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s).\n* flexible in maintaining the Domoticz devices for the various functions by using Domoticz roomplans \u0026 device properties to setup the HTML interface.\n\n![android-0](https://user-images.githubusercontent.com/47274144/95470037-9a0ded80-0980-11eb-9877-340d5004e3fb.png)\n\nThis application is called Domoticz Quick Access Mobile **QAM**.\n\n## Background\nThe application has been developed, based on a request to enable simple access to Domoticz from any device in a local network.\nMeant by simple access, is a user interface with limited components on a mobile device screen having large sized components, like text, buttons, dropdowns etc..\nFunctions are grouped, separated by horizontal rules. Each function having similar layout depending its required components. The screen must be scrollable to select a function.\n\nA function is used to \n* control dedicated devices, like lights, thermostats, shutter/blinds\n* inform about climate \u0026 key dates\n\n## Solution\nThe following libraries \u0026 styles are used and stored locally (instead accessing a Content Delivery Network CDN):\n* [jQuery](https://jquery.com/) v3.5.1 - Copyright JS Foundation and other contributors - [License](http://jquery.org/license).\n* [Bootstrap](https://getbootstrap.com/) v4.3.1 - Copyright 2011-2019 The Bootstrap Authors - [License](https://github.com/twbs/bootstrap/blob/master/LICENSE).\n* [Font Awesome Free](https://fontawesome.com/) 5.14.0 - @fontawesome - [License](https://fontawesome.com/license/free) (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License).\n* Versions are subject to change\n\n**The UI is based upon the HTML Bootrap Grid.**\nEach control function has several rows with grids depending its features. The inform functions make use of modal dialogs with lists.\nThe devices used for a function are populated from the related Domoticz roomplan.\nThe communication between the UI and Domoticz is via HTTP API requests to the Domoticz engine. The Domoticz engine to action / response accordingly.\nDepending the function selected, an Domoticz Automation Event, dzVents Lua, is triggered.\nJavaScrip jQuery.getJSON function is handling the HTTP API requests.\n\nThe main file is \"index.html\". It has sections:\n\n**HEAD**\n* Include the third party styles and libraries (stored locally) plus some additional styles.\n\n**BODY**\n* _HTML_ for the user interface, based on the Bootstrap Grid, with selectors.\n* _JavaScript_ to interact, via HTTP API requests, with Domoticz triggered by HTML components and to set data in HTML selectors from HTTP API responses, but also to change Domoticz devices.\n\n**Note**\nThe UI focus is on mobile devices, but it is simple to create other type of user interfaces because the JavaScript section contains all the Domoticz interaction logic.\n\nThe usage of roomplans provides flexibility for the devices used. There is no hardcoding required to get or set data in the user interface.\nWhenever a roomplan or device changes, i.e. device added or removed, device name change this is handled by the user interface - either load or reload if already open in a browser.\n\n## Get Started\nSee file \"GETSTARTED.md\".\n\n## Concepts\nRecommend to read the source files \"basic.html\" and \"index.html\".\nMore information see \"domoticz_quick_access_mobile.pdf\".\n\n### Roomplan Data Request\nThe data is gathered from the Domoticz HTTP API request for a given idx of a plan.\nThe HTTP API request returns a JSON string with an array of devices.\nImportant is the key status to ensure the data is properly fetched.\nBelow an extract of the key:value pairs. The key result is the array containing all devices with its properties.\nThe device properties are device dependend, but for all the DQAM functions Data, Name, PlanID and idx are used (the name is case sensitive).\nThe data property is used to display device value.\n\n_Exception_\nThe data used for the function Climate, device Wind extracts the windspeed and direction from the data property.\n\n### Roomplan HTTP API Request \u0026 Response Devices\nThe plan idx=23, which is Klima (\"Climate\") used in a modal information dialog with close button.\n\n**Request**\n```\nhttp://domoticz-ip:port/json.htm?type=devices\u0026plan=23\n```\n**Response**\n```\n{\n\t\"ActTime\" : 1600949265,\n\t...\n\t\"app_version\" : \"2020.2\",\n\t\"result\" : \n\t[\n\t\t{\n\t\t\t\"Data\" : \"24-09 07:11 - 19:14 (12:03)\",\n\t\t\t\"Name\" : \"Tageslicht (Std)\",\n\t\t\t\"PlanID\" : \"23\",\n\t\t\t\"idx\" : \"121\"\n\t\t},\n\t\t..\n\t\t{\n\t\t\t\"Data\" : \"18.7 C, 62 %\",\n\t\t\t\"Name\" : \"Aussen\",\n\t\t\t\"PlanID\" : \"23\",\n\t\t\t\"idx\" : \"344\",\n\t\t}\n\t],\n\t\"status\" : \"OK\",\n\t\"title\" : \"Devices\"\n}\n```\n\n### Roomplan HTTP API Request \u0026 Response List\nAs the roomplan is core to create the content of the user interface, this is the request to get all the roomplans name and idx.\n```\nhttp://domoticz-ip:port/json.htm?type=plans\u0026order=name\u0026used=true\n```\nThe data is used to set f.e. the heading in an information dialog, i.e. \"Klima\" and \"Termine\". \n\nThe other roomplans are used to control devices via a dropdown component, i.e. \nLights (Hardware Philips Hue), Shutter/Blinds (Somfy via RFXCOM), Heating (Thermostats Homematic IP via HTTP XMLAPI requests).\n```\n{\n\t\"result\" : \n\t[\n\t\t{\"Devices\" : 7,\"Name\" : \"Somfy\",\"Order\" : \"1\", \"idx\" : \"24\"},\n\t\t{\"Devices\" : 9,\"Name\" : \"Hue\",\"Order\" : \"17\",\"idx\" : \"20\"},\n\t\t{\"Devices\" : 7,\"Name\" : \"Heizung\",\"Order\" : \"19\",\"idx\" : \"21\"},\n\t\t{\"Devices\" : 11,\"Name\" : \"Klima\",\"Order\" : \"21\",\"idx\" : \"23\"},\n\t\t{\"Devices\" : 7,\"Name\" : \"Termine\",\"Order\" : \"22\",\"idx\" : \"4\"},\n\t],\n\t\"status\" : \"OK\",\"title\" : \"Plans\"\n}\n```\n\n## Control Requests\nAs mentioned, all requests are via the Domoticz HTTP engine.\nFor each of the functions, the request URL's are defined with placeholder.\nThe placeholders in the URL are replaced depending the selected device.\nThe URL is submitted using buttons or a slider (example set brightness Hue light bulb).\n\n**Examples URL**\n```\n// Set the domoticz system base url - TODO: Checkout why 127.0.0.1 is giving cors error\nconst URL_DOMOTICZ = \"http://domoticz-ip:port/json.htm?\";\n// CMD = Somfy switch command Off, Stop, On\nvar\t  URL_SWITCH_SOMFY = URL_DOMOTICZ + \"type=command\u0026param=switchlight\u0026idx=#IDX#\u0026switchcmd=#SWITCHCMD#\";\n// CMD = Somfy Group switch command level 10 (Open), 20 (Stop), 30 (Close)\nvar\t  URL_SWITCH_SOMFY_GROUP = URL_DOMOTICZ + \"type=command\u0026param=switchlight\u0026idx=#IDX#\u0026switchcmd=Set%20Level\u0026level=#LEVEL#\";\n// CMD = Hue switch command Off, Set%20Level=NN, On\nvar\t  URL_SWITCH_HUE = URL_DOMOTICZ + \"type=command\u0026param=switchlight\u0026idx=#IDX#\u0026switchcmd=#SWITCHCMD#\";\n// CMD = Thermostat switch state ON or OFF handled by customevent raspmatic_thermostat_onoff. JSON data key : {\"idx\":123, \"state\":0|1}\nvar\t  URL_THERMOSTAT_ONOFF = URL_DOMOTICZ + \"type=command\u0026param=customevent\u0026event=raspmatic_thermostat_onoff\u0026data=#DATA#\";\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwbl%2Fdomoticz-quick-access-mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwbl%2Fdomoticz-quick-access-mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwbl%2Fdomoticz-quick-access-mobile/lists"}