FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
herzogk
Staff & Editor
Staff & Editor
Article Id 408591
Description This article describes how to configure the FortiOS Integration for Home Assistant.
Scope

FortiOS 7.2.x, 7.4.x, 7.6.x.

Solution

It is possible to integrate FortiOS as a device tracker within Home Assistant. Follow the steps below to accomplish this.

 

FortiOS Preparation:

 

Create a new API key for the Home Assistant to utilize with read-only permissions:

 

API User CreationAPI User Creation

 

After creating the account, the API key will be displayed so it can be copied. Note: The key is only displayed one time. If the key is lost, it will need to be regenerated.

 

Additionally, note the IP address of the interface that the Home Assistant will send requests to, as well as whether a non-standard https port is being used. Lastly, ensure https/http is set to 'allowed' under the interface's administrative access.

 

Home Assistant Configuration:

 

The FortiOS integration is not installed as usual via the GUI Integration page. Instead, it is created by modifying the Home Assistant configuration.yaml file with the following:

 

#FortiOS Integration
device_tracker:
    - platform: fortios
    host: 10.1.4.33:10443  #in this example https access in on custom port 10443
    token: bb5tGhm8e19NHxr7drHGw4x31asr45 #API Key generated above

 

After the configuration has been added, restart the Home Assistant server. After a reboot the FortiOS integration can been seen in the integration list. Additionally, all devices the FortiGate has detected will be added as entities in Home Assistant.

 

Validating:

 

In FortiOS, there should now be successful API requests from the Home Assistant server under the API logs:

 

Example Logs.Example Logs.

 

Additionally, the devices and their online/offline status can be compared in FortiOS and Home Assistant.

 

Dashboard -> Users & Devices -> Assets.

 

Example Asset from Device InventoryExample Asset from Device Inventory

 

Settings - > Devices & services -> Entities.

 

Filter for 'Device tracker'.

 

Example Asset Now Displayed as Entity in Home Assistant.Example Asset Now Displayed as Entity in Home Assistant.

 

Now that the devices and their status are integrated from FortiOS, they can be be configured as desired within Home Assistant.

 

Note: The Home Assistant FortiOS integration is not developed or maintained by Fortinet and therefore cannot be supported via TAC. For any issues, it is recommended to check or post in the Fortinet Community Forums.

Contributors