This is a userspace app for Mac OSX, Linux and Windows that can be deployed to all relevant App Stores for these platforms.
The intention is:
- Provide a base, self contained Electron User Space App that:
- Provides a fully self-contained app to run in user space with no elevated privileges.
- Manages an overall user connection to the API back end (rest based)
- Allows the user to see and monitor Wemo, Homekit and other devices on the local network
- Switched to a pluggable architecture to support other integrations - now you can publish your own integrations with other services/devices
- Allows to "connect" (pair) devices selectively to (and remove them from) the currently active Allow2 account
- May allow some other basic functions in future
- Provide a separate capability to detect (and authenticate against?) a separate elevated daemon service that runs on system boot.
- Includes the ability to automatically install the elevated daemon service where the relevant App Store allows the binary to provide that capability.
- Includes a reference to how to download and install the separate daemon installer for those App Stores that do not permit the background process to be included in the installer (Yes Apple, I am looking at you!).
The base operation is intended to show a "Network Wide" view of all detected automation devices, and provide the ability to link/authenticate with them directly, with bridges and otherwise, and de-duplicate any that may come through separate channels (ie: direct wemo connections and the same device via a homekit bridge). It also provides a pluggable module framework to support communication with 3rd party services and devices.
The following provides more detail on the structure and intent of the application and components.
This is a standard electron app, to get started simply clone the repo and run npm install.
git clone https://github.com/Allow2/Allow2Automate.git
cd Allow2Automate
npm installTo run in dev mode (launch the user space app with hot-loader):
npm run developTo build for all platforms:
npm run packor for a specific platform:
npm run pack:mac./sign.shThen upload with Application Loader
NOTE: cannot currently build on Mac without using a Paid pro version of Parallel. So need to do that, or build on a VM
npm run pack:winThen drag into https://developer.microsoft.com/
npm run pack:linuxsnapcraft push dist/Allow2Automate_1.1.0_amd64.snapFor installation of the daemon helper: https://www.npmjs.com/package/electron-sudo
Plugins are new and provide an ability to hook in to Allow2 and use it to control external devices/etc. For example, if you use battle.net parental controls, they provide no API and are not integrated with Allow2. However, you can develop a plugin and submit it to the directory and within that plugin create the necessary bridge to translate controls.
The rationale is if users can set up a process on their own computer or device, and put their credentials in that instance, then it is inherently more secure. The endpoint on the parents home network has the credentials in a highly decentralised model. Otherwise they would need to entrust their credentials to a cloud service. This is inherently less secure and also creates a much bigger target for hackers.
In the case of battle.net (one of the examples), it uses web calls to the html page and scrapes it using the supplied credentials. This enables the end user to set it up and have the Allow2 controls take effect on the web interface for battle.net parental controls.
The second example (both are on github) is a ssh plugin. This can be set to trigger on "interesting" state changes (ie: child 2 runs out of internet time) and do an automatic ssh to a device and run a pre-configured command, this also looks for a return code to indicate if there is a success or failure. This can be used to do things like ssh in to a flashed router and run a script to change firewall rules and reboot the router. Or it could ssh into a light and run a script or command to turn it red.
Plugins package.json require a few extra fields: allow2Token: create a new "app/device" token at https://developer.allow2.com/ and enter that token here. All plugins need to have a token to communicate with the Allow2 platform. engines: { "allow2automate": "*" } - specifies the version range with which the plugin is tested/compatible.
Allow2Automate uses Firebase Analytics to track user behavior, plugin usage, and app interactions. This helps us understand how the app is being used and improve the user experience.
- User Authentication: Login/logout tracking with user ID assignment
- Screen Views: Track which screens users navigate to
- Plugin Management: Track plugin installations, uninstalls, enables/disables, and errors
- Marketplace Activity: Track marketplace views, searches, and plugin discovery
- App Source Tagging: Automatically tags events with app source (Mac App Store, development, direct download, etc.)
Analytics is implemented in the app/analytics/ directory:
firebase-config.js- Firebase initialization (renderer process only)environment.js- Environment detection and app source taggingindex.js- Main Analytics API with 40+ tracking methods
Analytics is renderer process only - the main process does not initialize Firebase. All tracking happens through the singleton Analytics instance imported in React components.
All analytics data is anonymized and used solely to improve the app. User credentials and personal information are never tracked.
