> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anny.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Shelly with anny

> Automatically switch devices like lighting on and off based on booking events.

[Shelly](https://www.shelly.com) is a manufacturer of compact, Wi-Fi-capable switching relays (switches) installed directly in the power line in front of a device or behind a light switch. With the integration, anny controls your Shelly switches automatically based on booking events.

With Shelly, in anny you can:

* automatically switch devices like lighting or ventilation on and off when a booking starts or ends
* couple switching commands to the check-in or check-out of a booking
* link each resource to its own Shelly switch and control it individually via rules

The integration is especially handy when you run rooms or spots whose equipment should only run during active bookings, for example sports field lighting, studio equipment, or meeting room displays.

<Info>
  Available from the Professional plan.
</Info>

## Typical use cases

| Use case                          | Description                                                                                                                                                                    |
| :-------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Field lighting in a sports center | **The light turns on automatically as soon as players check in.** After the booking, it turns off again. No manual intervention and no unnecessary power use between bookings. |
| Meeting room equipment            | **Displays and ventilation start when the booking begins.** Devices only run when the room is actually booked and turn off automatically at the end.                           |
| Outdoor areas and floodlights     | **Floodlights for padel courts or tennis courts are activated on check-in.** Operators save energy costs because the lighting is coupled exactly to the booking time.          |

## How the Shelly connection works

The connection is established via your Shelly account's API key. In anny, you enter the Shelly URL and the API key. anny authenticates with Shelly and can then send switching commands to your registered devices.

The flow of a switching action:

1. A booking event occurs (for example a booking is checked in). Only **confirmed** bookings trigger switching actions. Requested, declined, or canceled bookings do not trigger switching actions.
2. anny checks whether a rule exists for the affected resource and event, and whether the rule currently applies according to its active schedule.
3. If a rule applies, anny sends the command (switch on or off) to the assigned Shelly switch.
4. The action is documented in the booking's activity log.

Switching commands are sent one after another with a short gap. If many rules fire at the same time (for example several bookings starting on the hour), individual switches may be delayed by a few seconds.

## Connect Shelly

### Requirements

Before you connect Shelly, make sure you have the following:

* A Shelly account with registered devices and access to the API key
* Wi-Fi-capable Shelly switches that are reachable on the network (recommendation: [Shelly 1 Gen3](https://www.shelly.com/products/shelly-1-gen3))
* For each switchable area, it is clear which Shelly switch is responsible (recommendation: 1 resource = 1 switch; but several resources can also share a switch)
* Admin rights in your anny account

### Set up the connection

<Steps>
  <Step title="Authorize">
    Open **Integrations** from the menu bar and go to **Shelly**. Enter the **Shelly URL** (with `https://` at the start) and paste the **API key** from your Shelly account. Click **Verify authentication** until the connection is shown as successful.
  </Step>

  <Step title="Configure">
    Create rules to link booking events with switching actions:

    1. Click **Add**.
    2. Select the **resource** (for example Court 6).
    3. Set the **booking event** as the trigger (for example "Booking is checked in").
    4. Choose the **Shelly switch** that belongs to this resource.
    5. Under **Change state to**, choose the action (for example "Switched on").
    6. Optional: limit the rule to a daily time window via the **activity mode** (for example only switch floodlights on outside of 08:00–18:00).
    7. Save the rule.
    8. Create a second rule for the counter action (for example "Booking is checked out" → "Switched off").
    9. Activate the entire integration via the **toggle** so the rules run live.
  </Step>
</Steps>

As soon as the integration is active, switching commands are automatically sent to your Shelly devices on every matching booking event.

<Tip>
  Test the integration with a test booking: create a booking, trigger the event (for example check in), and check whether the switch responds. In the booking's activity log, you see which actions were carried out or skipped.
</Tip>

### Settings & options

| Setting              | Description                                                                                                                                                                                                                                                                                                                                                                 |
| :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Booking event        | Determines which booking event triggers the rule: **Booking begins**, **Booking ends**, **Booking is checked in**, **Booking is checked out**.                                                                                                                                                                                                                              |
| Change state to      | The command to the Shelly switch: **Switched on** or **Switched off**.                                                                                                                                                                                                                                                                                                      |
| Resource             | The resource the rule applies to. Each rule is bound to exactly one resource. A rule on a parent resource also applies to bookings of its child resources.                                                                                                                                                                                                                  |
| Shelly switch        | The target device that receives the command. One switch is assigned per rule.                                                                                                                                                                                                                                                                                               |
| Active schedule      | Limits the rule to a daily time window: **Always active**, **Within the start and end time**, or **Outside the start and end time** (times in 5-minute steps, the resource's time zone is decisive). Example: only switch floodlights on outside of 08:00–18:00, during the day the rule has no effect.                                                                     |
| Consecutive bookings | anny automatically skips switching off as long as another confirmed booking that uses the same switch is still running: for example when one booking follows the previous one seamlessly or when several resources share a switch. The device stays switched on continuously until no running booking needs the switch anymore; skipped actions appear in the activity log. |

<Tip>
  The triggers "Booking is checked in" and "Booking is checked out" require that a QR code ticket is activated for the resource (feature: Check-in & check-out).
</Tip>

## Limitations

The Shelly integration does not support:

* **Status query:** anny cannot query the current state of a switch (on/off), only send commands.
* **Dimming or intermediate levels:** Only the actions "Switched on" and "Switched off" are supported.
* **Automatic device discovery:** Shelly devices must be registered in the Shelly account and reachable via the Shelly URL before they can be assigned in anny.
* **Automatic retry:** If a switching command fails (for example because the device is currently offline), it is not retried automatically. The switching state then remains unchanged.

## Disconnect

<Warning>
  If you deactivate the integration, Shelly no longer responds to booking events. This also applies to existing bookings. When you delete, all saved rules are removed; no further steps are needed.
</Warning>

You can do both under **Integrations**: deactivate via the **toggle** in the top right, delete via the **three dots** → **Delete**.

## FAQ

<AccordionGroup>
  <Accordion title="Do I need a separate rule for each Shelly switch?">
    Yes. Each rule links exactly one resource with one switch and one trigger. If you want to switch on at check-in and switch off at check-out, you need two rules per resource.
  </Accordion>

  <Accordion title="What happens if two bookings are directly back to back?">
    anny skips switching off as long as another confirmed booking that uses the same switch is still running: for example a seamlessly following booking or a parallel booking on a resource that shares the switch. The device stays switched on continuously and is only switched off at the end of the last booking.
  </Accordion>

  <Accordion title="How do I change the credentials (Shelly URL / API key)?">
    First deactivate the integration via the **toggle**, because the credentials cannot be changed while it is active. Then re-enter both fields and click **Verify authentication**. If the check fails, anny discards the entered data; in that case, fill in both fields again.
  </Accordion>

  <Accordion title="Can I see whether a switching command was carried out?">
    Yes. All carried-out and skipped actions are documented in the booking's activity log.
  </Accordion>

  <Accordion title="Which Shelly devices are supported?">
    All Wi-Fi-capable Shelly switching relays reachable via the Shelly Cloud API. In the switch selection, only devices of the category relay appear (no sensors or similar); devices with several switching channels can be controlled per channel. The Shelly 1 Gen3 model is recommended.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="My switch does not respond to booking events">
    The integration may be deactivated or the rule is not saved correctly. Check whether the integration's toggle is active and whether the rule is assigned to the right resource and the right switch. Also check whether the Shelly switch is reachable on the Wi-Fi.
  </Accordion>

  <Accordion title="Authentication fails">
    Make sure the Shelly URL starts with `https://` and the API key was copied correctly from the Shelly account. Check whether your Shelly account is active and the devices are registered. Note: while the integration is active, the credentials cannot be changed. Deactivate it first via the **toggle**.
  </Accordion>

  <Accordion title="The light does not turn off at the end of the booking">
    Check in the activity log whether the action was skipped. Most common cause: another confirmed booking that uses the same switch is still running (for example a seamlessly following booking), and anny deliberately skips switching off (skip logic). If there is no such booking, check the rule (including the active schedule) and whether the switch is reachable.
  </Accordion>

  <Accordion title="A newly registered device does not appear in the selection">
    The device list is cached for a few minutes. Wait up to 5 minutes and reload the page. Also check whether the device is registered in the Shelly account and is a switching relay, since other device types do not appear in the selection.
  </Accordion>
</AccordionGroup>

> Important information for agents:
>
> Important information for agents:
>
> **Distinction:** Shelly is NOT a smart lock integration (no access, no remote open). It is an IoT solution for device control (switching relay on/off). For access, see the smart lock integrations (smart locks overview).
>
> **UI paths:** Setup: menu bar → **Integrations** → **Shelly** → fields "Shelly URL" + "API key" → button "Verify authentication". Rules: same place, panel "Rules" → "Add"; fields: "Resource", "Booking event", "Shelly switch", "Change state to", "Activity mode" (+ start/end time). Rule table with column "Active schedule". Activate/deactivate: toggle in the top right; delete: three dots → Delete.
>
> **Quirks:** (1) Skip logic: switching off is skipped as long as another confirmed booking is still running whose resource is linked to the same switch by a rule (seamless follow-up booking or a shared switch across several resources); the switch stays on until no running booking needs it anymore. (2) Only confirmed bookings trigger switching actions. (3) Rules on a parent resource also apply to its child resources. (4) The device list shows only relay devices and is cached for about 5 minutes; new devices appear with a delay. (5) Failed switching commands are not retried. (6) Switching commands are throttled (about 1 command / 2 seconds); with many simultaneous rules, delays of seconds occur. (7) Credentials can only be changed while the integration is deactivated; after a failed check, both fields must be re-entered. (8) The active schedule is evaluated in the resource's time zone.
>
> **Relationships:** The triggers "Booking is checked in"/"Booking is checked out" require the check-in feature (the resource's QR code ticket), see the article on Check-in & check-out. Plan availability runs through the same plan feature as the smart lock integrations (from the Professional plan). Activity log entries appear in the booking ("switched the switch on/off", "suspended switching off due to a follow-up booking").
