Meraki
The Meraki integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] connects Home Assistant to Cisco Meraki networks through the Meraki Dashboard API. It tracks whether the clients of your networks, such as phones and laptops on Wi-Fi or computers on a Meraki switch, are connected.
An older way of presence detection through the Meraki CMX location service is set up in YAML; see Presence detection with the CMX location service.
Use case
- Know who is home: a phone that connects to your Wi-Fi marks its owner as home.
- Notice when a wired device, such as a NAS, drops off the network.
Prerequisites
The integration needs a Meraki Dashboard API key with access to your organization. In the Meraki Dashboard, enable API access for the organization and create an API key, as described in Meraki’s authorization guide. A key of an administrator with read-only access is enough.
Configuration
To add the Meraki hub to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Meraki.
-
Follow the instructions on screen to complete the setup.
Supported functionality
Device trackers
- Clients: A tracker for each Wi-Fi or wired client seen in the organization’s networks in the last hour. It is home while Meraki reports the client online, and shows the client’s IP address, MAC address and hostname.
Each client gets its own device, named after the client and identified by its MAC address. Like other network-based trackers, new trackers are disabled until you enable them for the clients you want to follow.
Automation example
Turn off the lights when everyone has left
Example YAML configuration
alias: "Turn off the lights when the phones leave"
triggers:
- trigger: state
entity_id:
- device_tracker.pixel_9
- device_tracker.iphone
to: not_home
for: "00:10:00"
conditions:
- condition: state
entity_id:
- device_tracker.pixel_9
- device_tracker.iphone
state: not_home
actions:
- action: light.turn_off
target:
area_id: living_room
Data updates
The integration polls the Meraki Dashboard API every minute: one request for the organization’s networks, plus one for the clients of each network. With a few networks, this stays well within Meraki’s rate limit of 10 requests per second per organization.
A client that connects shows as home within about a minute. Meraki only marks a client offline after about five minutes without traffic, so a phone that leaves, or turns off its Wi-Fi, shows as away about five to six minutes later. Keep this in mind for automations that react to someone leaving.
Known limitations
- Each organization is added as a separate entry. The same API key can be used for several organizations.
- The Dashboard API does not provide a client’s position, so unlike the CMX presence detection, the trackers don’t show devices on the map. They only tell whether a device is home.
- Bluetooth devices are not tracked yet. The CMX presence detection still covers them.
Troubleshooting
The API key is not accepted
- Make sure API access is enabled for the organization in the Meraki Dashboard.
- Make sure the API key belongs to an administrator of the organization you want to add.
The integration fails to set up after it worked before
The API key was revoked, or its administrator lost access to the organization. Create a new API key in the Meraki Dashboard for an administrator who has access to the organization, or restore the administrator’s access first. Then remove the integration and add it again with the new key.
Removing the integration
This integration follows standard integration removal.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- Next to the entry you want to remove, select the three dots
menu. Then, select Delete. - Depending on the integration, the entries are listed under one of the following headings:
- Devices
- Hubs
- Services
- Integration entries
- Depending on the integration, the entries are listed under one of the following headings:
- To confirm, select Delete.
- Home Assistant also deletes the devices and entities of the entry.
- If Home Assistant asks you to restart, restart Home Assistant.
- If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.
- If you keep them, Home Assistant uses them automatically when you add the integration again.
- To delete them later, refer to Deleting application credentials.
The CMX presence detection described below is set up in YAML and is removed by removing its configuration from your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file.
Presence detection with the CMX location service
Presence detection with the CMX location service is deprecated and will stop working in Home Assistant 2027.5. To switch to the integration set up in the UI:
- Remove the
merakiplatform from thedevice_trackersection of yourconfiguration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, and the devices it tracked from yourknown_devices.yamlfile. - Restart Home Assistant.
- Add the Meraki integration in the UI with a Meraki Dashboard API key, as described above.
- Enable the trackers of the devices you want to follow, as they start disabled, and update automations and scripts that used the old trackers.
The integration tracks whether Wi-Fi and wired clients are connected, without their position on the map. Bluetooth devices are not tracked yet.
Use your Meraki AP as device tracker. Note that Meraki will see all devices, not only connected to the network. This requires Home Assistant to be reachable from the internet, as Meraki sends the data to it.
Prerequisites
- Go to Network-wide/General page, and find the Location and scanning section.
- Make sure analytics and Scanning API are both enabled.
- Make note of the Validator string, which will be used in the
device_trackerconfiguration. - Click Add a Post URL:
- Set the Post URL to
https://YOUR_HOSTNAME/api/meraki - Set the Secret to a randomly generated string, and make note of it for the
device_trackerconfiguration. - Make sure the API Version is set to
2.0. - Hit Save in the bottom right of the page.
- Set the Post URL to
Configuration
After you configure access to the Meraki CMX API, add the following to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file.
After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.
# Example configuration.yaml entry
device_tracker:
- platform: meraki
secret: your_secret
validator: meraki_validator