Sites
Sites represent physical locations or logical separations in multi-tenant or multi-location GEM installations. Sites enable user access restrictions and location-based organization.
Overview
The Sites feature allows:
- Multi-Location Management: Single GEM managing multiple properties
- Multi-Tenant Isolation: Separate clients in managed services
- User Restriction: Limit users to specific sites
- Cross-Site Integration: Link sites for shared resources
Viewing Sites
Sites are displayed as a grid of cards. Each card shows:
- Label (and internal name if different) - Site display name with an icon: a house for the local server, a cloud for remote sites
- This Server badge - Highlights the local site with a blue border accent
- Disabled badge - Dimmed if the site is disabled
- URL - Clickable link for remote sites (opens in a new tab); display-only for the local site
- Active Mode badge - The site's currently assigned mode
- Stats Row (local site only) - Live counts of Zones, Devices, Spaces, and Users on this server
- Action Buttons:
- View Spaces - On the local site, jumps to the Site Spaces page
- Edit - Modify the site (not available when this server is managed by another site)
- Delete - Remove the site (not available when managed)
Toolbar Actions
- Add - Create a new site (disabled when this server is managed)
Creating a Site
To create a new site:
- Click Add in the grid toolbar
- Configure the site properties (see sections below)
- Click Save
Site Configuration
Site Information
Name
- Internal identifier (lowercase_with_underscores)
- Examples:
headquarters,building_a,client_smith,vacation_home - Auto-formatted on blur
Label
- User-friendly display name
- Examples: "Headquarters", "Building A", "Smith Residence", "Vacation Home"
- Shown in UI dropdowns and selectors
URL
- Full URL to remote GEM server (if applicable)
- Format:
https://example.comorhttps://192.168.1.100:443 - Include protocol (https:// or http://)
- Used for cross-site API communication
Settings
This Server
- Toggle to mark this as the local site
- Only one site should have "This Server" enabled
- Identifies the site on which this GEM server is running
- Important for:
- Cross-site routing
- User site restrictions
- Remote synchronization
Enabled
- Toggle to enable/disable the site
- Disabled sites:
- Hidden from user selections
- Cannot be accessed
- Configuration preserved
- Useful for seasonal properties or inactive clients
Common Use Cases
Single-Location Deployment
For a single home or building:
- Create one site (often auto-created):
- Name:
primary - Label: "Primary Site"
- This Server: Yes
- Enabled: Yes
- Name:
- Leave URL empty (local only)
- Do not restrict users to sites
Multi-Location Enterprise
For a campus or multi-building facility:
-
Create a site for each building:
Site 1:Name: headquartersLabel: Headquarters BuildingThis Server: YesURL: (empty - local)Site 2:Name: warehouse_northLabel: North WarehouseThis Server: NoURL: https://warehouse-north.company.localSite 3:Name: warehouse_southLabel: South WarehouseThis Server: NoURL: https://warehouse-south.company.local -
Assign users to appropriate sites:
- Corporate users: All sites
- Warehouse managers: Specific warehouse only
- Security: All sites
Multi-Tenant Service Provider
For a service provider managing multiple clients:
-
Create a site for each client:
Site 1 (This Server):Name: provider_hqLabel: Provider HQThis Server: YesSite 2:Name: client_smithLabel: Smith ResidenceThis Server: NoURL: https://smith.gemautomation.netSite 3:Name: client_jonesLabel: Jones EstateThis Server: NoURL: https://jones.gemautomation.net -
Create site-specific users:
- smith_user → assigned to client_smith only
- jones_user → assigned to client_jones only
- installer_tech → assigned to all sites
- admin → assigned to all sites
Vacation Home Network
For linked primary/vacation homes:
-
Primary Home (Main GEM):
Name: primary_residenceLabel: Primary ResidenceThis Server: YesURL: https://home.family.net -
Vacation Home (Remote GEM):
Name: lake_houseLabel: Lake HouseThis Server: NoURL: https://lakehouse.family.net -
Users:
- Family members: Both sites
- House sitter: lake_house only
- Maintenance: Both sites
User Site Restrictions
Users can be restricted to specific sites:
No Sites Assigned
- User can access all sites
- Default behavior
- Appropriate for admins and service providers
Specific Sites Assigned
- User can only access those sites
- Site selector appears in user interface
- Queries and controls filtered to site
- Attempts to access other sites are denied
Implementation
In the Users page:
- Edit a user
- In the "Sites" section, select one or more sites
- Save the user
- User will only see and control the selected sites
Cross-Site Communication
When sites have URLs configured, GEM can communicate across sites:
Supported Features
Cross-Site Queries:
- Query zones on remote sites
- Get attributes from remote devices
- Monitor status across sites
Cross-Site Commands:
- Send commands to remote zones
- Execute macros on other sites
- Synchronize states
Cross-Site Macros:
- Macro steps can target zones on different sites
- "Goodnight" macro can control both home and vacation home
- Synchronize schedules across properties
Requirements
- Network Connectivity: Sites must be able to reach each other
- URL Configuration: Remote sites need valid URLs
- Authentication: Cross-site requests use API keys or tokens
- Firewall Rules: Allow HTTPS traffic between sites
Example Cross-Site Macro
// Macro: "Secure All Properties"
Step 1: Lock all doors (primary_residence)
Step 2: Arm security (primary_residence)
Step 3: Lock all doors (lake_house) [via cross-site API]
Step 4: Arm security (lake_house) [via cross-site API]
Step 5: Send notification: "All properties secured"
Site Selection UI
When a user has site restrictions:
- Site Selector: Dropdown appears in navigation
- Filtered Views: Only shows zones/devices from selected site
- Switching Sites: User can change between assigned sites
- Default Site: First assigned site selected by default
Security Considerations
Site Isolation
Benefits:
- Prevents users from accessing wrong properties
- Maintains client privacy in multi-tenant
- Reduces accidental control of wrong location
Implementation:
- Assign users to specific sites
- Ensure roles don't override site restrictions
- Audit site assignments regularly
Cross-Site Security
Risks:
- Cross-site requests expose data between locations
- Compromised site could access other sites
- Network traffic contains sensitive control data
Mitigations:
- Encryption: Always use HTTPS URLs
- Authentication: Use strong API keys
- Firewall: Restrict cross-site traffic to known IPs
- VPN: Consider VPN for cross-site links
- Monitoring: Log all cross-site API calls
URL Security
Public URLs:
- Use valid SSL certificates
- Implement rate limiting
- Enable 2FA for remote users
- Monitor for suspicious activity
Private URLs:
- Use VPN or private network
- Consider IP whitelisting
- Use self-signed certs if needed
- Isolate from internet
Troubleshooting
User Cannot See Site
Check:
- Site Enabled: Verify site is enabled
- User Assignment: Check user has site assigned (or no sites = all access)
- This Server: Ensure local site has "This Server" set correctly
- Login Again: User must re-login after site assignment changes
Cross-Site Commands Failing
Check:
- URL: Verify remote site URL is correct and accessible
- Network: Ping or curl the remote URL
- Authentication: Verify API credentials are valid
- Firewall: Check firewall rules allow HTTPS between sites
- Logs: Review logs on both sites for error messages
"This Server" Set Wrong
Symptoms:
- Site selector shows wrong site as current
- Cross-site routing fails
- User restrictions not working
Solution:
- Identify the correct local site
- Edit that site, set "This Server": Yes
- Edit other sites, set "This Server": No
- Restart GEM for change to take effect
Site Selector Not Appearing
Cause:
- User has no site restrictions (can access all)
Expected Behavior:
- Site selector only appears when user is restricted to 2+ sites
- If user assigned to 1 site, that site is always active (no selector)
- If user assigned to 0 sites (empty), all sites accessible (no selector)
Best Practices
- Clear Naming: Use descriptive site names and labels
- Documentation: Document which site corresponds to which physical location
- Consistent URLs: Use DNS names instead of IP addresses when possible
- Test Connectivity: Verify cross-site communication works
- User Training: Educate users about site selector if applicable
- Regular Audits: Review site assignments quarterly
- Disable Unused: Disable seasonal or inactive sites instead of deleting
Advanced Topics
Programmatic Site Management
Sites can be managed via API:
// Create site
await GemApp.getInstance().insertModel('site', {
name: 'new_location',
label: 'New Location',
url: 'https://new-location.example.com',
is_me: false,
enabled: true
});
// Query sites
let sites = await GemApp.getInstance().query('site', {enabled: true});
// Update site
await GemApp.getInstance().updateModel('site', siteId, {
url: 'https://updated-url.example.com'
});
Site Synchronization
For synchronized multi-site deployments:
- Shared Configuration: Export/import configs between sites
- Macro Sync: Keep macro libraries identical
- User Sync: Maintain consistent user accounts
- Schedule Sync: Coordinate time-based events
Consider developing custom sync scripts for large deployments.
Site Failover
For high-availability:
- Configure backup URL in site
- Implement retry logic in cross-site calls
- Monitor site availability
- Alert on site communication failures
Related Documentation
- Users - Assigning users to sites
- Roles - Role-based access control
- Access Log - Monitoring cross-site access
- Backup & Restore - Site backup strategies