Skip to content

FanPico Home Assistant (MQTT Discovery) Support

Timo Kokkonen edited this page Sep 12, 2024 · 6 revisions

MQTT Client support in FanPico allows it to appear as "MQTT Sensor" in Home Assistant.

FanPico support MQTT Discovery feature in Home Assistant, making it easy to add FanPico units into Home Assistant.

Sensor Dashboard View

Requirement

To use FanPico with Home Assistant following is needed:

  • Enable MQTT Integration in Home Assistant (see Home Assistant: MQTT Integration).
  • Add user (person) for FanPico to use to connect to MQTT Server (see Adding a person to Home Assistant).
  • Following information is needed to proceed:
    1. MQTT server hostname or IP address (usually this is same as the Home Assistant server)
    2. MQTT server port
    3. MQTT username
    4. MQTT password
    5. MQTT Discovery prefix (found in Home Assistant MQTT Integration configuration, typically "homeassistant")

Configure FanPico as MQTT Sensor for Home Assistant

Here we assume FanPico is already configured and connected to WiFi network. See FanPico Web Interface for tutorial on how to configure WiFi on FanPico.

Configure MQTT Server Information

First step is to configure MQTT Server information (hostname/IP, tcp port, username, and password).

FanPico will default to port 1883 when TLS is disabled and port 8883 if TLS is enabled.

This example assumes that Home Assistant is on IP address 192.168.1.10, and MQTT is not using TLS and is on default port 1883):

SYS:MQTT:SERVER 192.168.1.10
SYS:MQTT:TLS OFF

If MQTT is using non-standard port, it can be configured as follows:

SYS:MQTT:PORT 1884

Configure MQTT Credentials

Next we need to configure username and password that FanPico will use to authenticate with the MQTT server.

SYS:MQTT:USERNAME mqttsensor
SYS:MQTT:PASSWORD password123

Configure MQTT Discovery

Next we enable Home Assistant MQTT Discovery, so that FanPico will automatically appear as sensor in Home Assistant.

Here we assume Home Assistant is using default discovery prefix "homeassistant" and that we want to send updates every 60 seconds (default is once every 600 seconds):

SYS:MQTT:HA:DISCOVERY homeassistant
SYS:MQTT:INT:STATUS 60

Configure What Information to Send to Home Assistant

Next we need to configure at least 1 or more data points to send to Home Assistant:

Currently supported data points are:

  • SENSORS (temperature)
  • FANS (RPM and Duty Cycle)
  • MBFANS (RPM and Ducty Cycle)

For example here we send all three temperature sensors (1,2,3) and 5 of the 8 Fan RPM speeds (1,2,5,6,7) as well as all of the motherboard (MBFAN) PWM values or duty cycles (1,2,3,4) sent by motherboard:

SYS:MQTT:MASK:TEMP 1-3
SYS:MQTT:MASK:FANRPM 1-2,5-7
SYS:MQTT:MASK:MBFANPWM 1-4

Save Configuration

Last step is to save configuration and reset (reboot) FanPico for MQTT client to get enabled during boot process:

CONF:SAVE
*RST

Check Sensor in Home Assistant

After FanPico has rebooted, it should appear as MQTT Sensor in Home Assistant after couple minutes (assuming SYS:MQTT:INT:STATUS was set to 60 seconds earlier).

Sensor Detail View