Docs/Admin/Devices

Devices

Manage Shelly IoT relays, configure usage plans, and control device power remotely.


Overview

Devices in Hygate are Shelly IoT relays that control appliances like washing machines, dryers, EV chargers, and other equipment. Guests pay for time-based access to these devices through usage plans.


Adding a Device

Prerequisites

Before adding devices, configure the Shelly integration in Settings → Shelly.

Step 1: Sync Devices

  1. Go to Devices
  2. Click Sync from Shelly
  3. Wait for the device list to load
  4. Review the list — already-added devices appear disabled

Step 2: Configure Each Device

SettingRequiredDescription
Shelly DeviceYesThe device from your Shelly Cloud account
LocationYesPhysical location assignment
NameNoDisplay name (e.g., "Washer 1", "EV Charger A")
DescriptionNoInternal notes
ChannelNoRelay channel (for multi-channel devices)

Step 3: Add Usage Plans

After adding the device, create at least one usage plan (see below).

Step 4: Save


Usage Plans

Usage plans define the pricing and time structure for each device session.

What Makes Up a Usage Plan

FieldDescriptionExample
Program NameGuest-facing name"1-Hour Wash"
DescriptionOptional details"Standard cotton cycle"
DurationSession length in minutes60
Delayed StartGrace period before timer starts5 minutes
PriceAmount in your currency€2.50
Sort OrderDisplay order on payment page1
ActiveWhether guests can select this plantrue

Why Delayed Start Exists

The delayed start gives guests a grace period to prepare before the timer begins:

Use CaseWhy Delay Matters
LaundryGuest needs to load clothes, add detergent, close the door
EV ChargingGuest needs to connect the charging cable
Gym EquipmentGuest needs to adjust settings, wipe down surfaces
Tanning BedGuest needs to apply lotion, get positioned
Massage ChairGuest needs to remove shoes, sit comfortably

Creating a Usage Plan

  1. Open the device detail page
  2. Scroll to Usage Plans
  3. Click Add Usage Plan
  4. Fill in the fields (see table above)
  5. Set Sort Order to control display order
  6. Toggle Active on
  7. Save

Multiple Plans Per Device

You can offer multiple plans for the same device. For example, a single washer might offer:

PlanDurationDelayPrice
Quick Wash30 min3 min€1.50
Standard Wash60 min5 min€2.50
Extended Dry90 min5 min€3.50

Managing Usage Plans

  • Edit — Change price, duration, or any field
  • Reorder — Change sort order to reorder on the payment page
  • Deactivate — Turn off without deleting (existing sessions continue)
  • Delete — Remove the plan entirely (only if no active sessions use it)

Device Status

Active Mode

The device accepts payments and relay commands. This is the default mode.

Maintenance Mode

New payments are blocked. Active sessions continue unaffected.

What HappensActive ModeMaintenance Mode
New payments acceptedYesNo
Relay controllableYesNo
Existing sessions affectedNoNo
Visible in dashboardYesYes (badge)

When to use maintenance mode:

  • Equipment needs inspection or repair
  • Staff needs to clear a jam or perform maintenance
  • You want to temporarily stop new sales without affecting current users

Relay Control

Hygate sends real-time commands to Shelly devices to control power.

Manual Control

From the device detail page:

  • Power ON — Turns the relay on immediately
  • Power OFF — Turns the relay off immediately

These commands are useful for:

  • Testing device connectivity
  • Emergency shutdown
  • Manual overrides

Automatic Control

During a guest session, Hygate manages the relay automatically:

Payment confirmed
        │
        ▼
  Grace period starts (delayMinutes)
  ┌──────────────────────────────────────┐
  │ Guest loads laundry / prepares        │
  │ device                                 │
  └──────────────────────────────────────┘
        │
        ▼
  Timer starts → Relay turns ON
        │
        ▼
  Guest sees countdown on session page
  (polling every 2 seconds)
        │
        ▼
  Timer reaches 0 → Relay turns OFF
        │
        ▼
  Session marked COMPLETED

Relay Reliability

Hygate includes automatic retry logic for relay commands:

CommandRetriesTimeoutOn Final Failure
Power ON3 attempts5 seconds eachSession marked CANCELLED
Power OFF3 attempts5 seconds eachLogged, retry on next cycle

Device Session Lifecycle

Session States

StateRelayTimerGuest Sees
ACTIVEONRunningCountdown circle
COMPLETEDOFFFinished"Session Complete"
CANCELLEDOFFEnded early"Session Ended"

Session States Explained

ACTIVE

The relay is on and the countdown is running. The guest sees a live countdown circle on their session page. The page polls every 2 seconds for updates.

COMPLETED

The timer reached zero and the relay was turned off normally. This is the expected end state.

CANCELLED

The session ended before the timer expired. This can happen because:

  • Admin force-ended — You manually ended the session
  • Relay failure — The relay turned off unexpectedly
  • Reconciliation — The background reconciliation process detected the relay was off

Cancelled sessions are logged with a failure reason.

The Countdown Circle

The guest-facing session page shows a countdown circle with seven states:

StateWhen It Appears
LoadingInitial load while session data is fetched
RunningACTIVE session with time remaining
FinishingACTIVE session with 0 seconds remaining (waiting for relay OFF)
CompleteSession finished normally
InterruptedSession cancelled after starting
Failed to StartSession cancelled before relay turned on
UnavailableDevice went offline during the session

Startup Recovery

When the Hygate server restarts, it performs a recovery check on all active sessions:

  1. Query all ACTIVE sessions
  2. Check each session:
    • If expired → turn relay OFF, mark COMPLETED
    • If not expired → verify relay state
      • Relay ON → session is valid, log confirmation
      • Relay OFF → mark CANCELLED (interrupted)
  3. Log all recovery actions in audit logs

This ensures no sessions are left in an orphaned state after downtime.


Session Reconciliation

A background reconciliation process runs every 2 minutes to verify session integrity:

CheckAction
Relay is ON but session not startedWait for grace period
Relay is OFF but session still ACTIVEMark as CANCELLED
Session expired but still ACTIVEForce completion

Why Reconciliation Matters

  • Relay bugs — Some Shelly devices can lose relay state during power fluctuations
  • Network issues — Temporary network loss can prevent a command from completing
  • Race conditions — Payment confirmation race conditions are caught
  • Ghost sessions — Stuck sessions are identified and resolved

Multi-Channel Devices

Some Shelly devices have multiple relay channels. You can configure each channel as a separate Hygate device, allowing different usage plans and independent control per channel.

For example, a Shelly Pro 4PM with 4 channels could represent:

  • Channel 1 → Washer 1
  • Channel 2 → Washer 2
  • Channel 3 → Dryer 1
  • Channel 4 → Dryer 2

Troubleshooting

Device Shows Offline

CheckAction
Shelly device onlineCheck Shelly Cloud app or device status
Shelly credentialsVerify Auth Key in Settings → Shelly
Network connectivityEnsure Shelly device has WiFi/Ethernet connection
Channel configuredVerify the correct channel number is set

Relay Won't Turn On

CheckAction
Device statusEnsure device is not in Maintenance Mode
Active sessionCheck Sessions page for conflicting sessions
NetworkVerify Hygate can reach Shelly Cloud API
RetryClick Power ON again — relay commands are retried automatically

Session Not Ending Automatically

  1. Go to Sessions
  2. Find the active session
  3. Click Force End to manually terminate

The reconciliation process also runs every 2 minutes to catch and end stale sessions.

Payment Succeeded But Relay Didn't Turn On

CheckAction
Active sessionsCheck Sessions page — was a session created?
Device statusIs the device in Maintenance Mode?
Relay failureWas the relay ON? Check session failure reason
RetryNavigate to the session → Retry Activation

Usage Plan Not Showing on Payment Page

CheckAction
Plan is ActiveCheck the plan's Active toggle
Price is > 0Free plans may be handled differently
Device is ActiveCheck device status
SyncRegenerate the payment link