Home automation


Before diving into the details, let me emphasize, that the key mechanism is MQTT. Most home automation systems support MQTT. Details about configuring MQTT for other systems than Home Assistant are given later in this chapter.

We will focus on Home Assistant with an install base of over 100,000 user

An open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Home Assistant

We auto populate the Home Assistant entities using MQTT Discovery. This enables us to use MQTT devices with only minimal configuration effort on the side of Home Assistant. A few of these messages are shown in the section MQTT device discovery of chapter Interface.

Home Assistant supports will use the messages and automatically populate the entities shown below.

Device entities on Home Assistant
Device entities on Home Assistant cont’d


In the Home Assistant configuration.yaml we add some rules and template sensors as shown in hassio/packages. This also includes some rules that we use for the PoolMath integration.

The Lovelace dashboard tab includes several cards as shown below. The YAML code can be found in hassio/lovelace.


When the pump is not running, the cards shown below wil be visible.

When for instance the pool circuit is activated, additional cards show up.

Other home automation systems

The OPNpool device publishes state transitions using MQTT. You find an overview of the topics in the table below.

Topic Example value
homeassistant/switch/opnpool/pool_circuit/state ON
homeassistant/switch/opnpool/spa_circuit/state OFF
homeassistant/switch/opnpool/aux1_circuit/state OFF
homeassistant/switch/opnpool/aux2_circuit/state OFF
homeassistant/switch/opnpool/aux3_circuit/state OFF
homeassistant/switch/opnpool/ft1_circuit/state OFF
homeassistant/switch/opnpool/ft2_circuit/state OFF
homeassistant/switch/opnpool/ft3_circuit/state OFF
homeassistant/switch/opnpool/ft4_circuit/state OFF
homeassistant/climate/opnpool/pool_heater/available online
    "mode": "heat",
    "heatsrc": "None", // None/Heater/SolarPref/Solar
    "target_temp": 70,
    "current_temp": 67,
    "action": "off"  // off/heating/idle
homeassistant/climate/opnpool/spa_heater/available offline
    "mode": "heat",
    "heatsrc": "None", // None/Heater/SolarPref/Solar
    "target_temp": 0,
    "current_temp": 67,
    "action": "off"  // off/heating/idle
homeassistant/sensor/opnpool/pool_sched/state 08:00 – 10:00
homeassistant/sensor/opnpool/spa_sched/state no sched
homeassistant/sensor/opnpool/aux1_sched/state no sched
homeassistant/sensor/opnpool/aux2_sched/state no sched
homeassistant/sensor/opnpool/air_temp/state 69
homeassistant/sensor/opnpool/water_temp/state 67
homeassistant/sensor/opnpool/system_time/state 11:28
homeassistant/sensor/opnpool/ctrl_version/state v2.080
homeassistant/sensor/opnpool/if_version/state v1.2.4
homeassistant/sensor/opnpool/pump_mode/state FILTER
homeassistant/sensor/opnpool/pump_status/state OK
homeassistant/sensor/opnpool/pump_power/state 606
homeassistant/sensor/opnpool/pump_gpm/state 0
homeassistant/sensor/opnpool/pump_speed/state 2250
homeassistant/sensor/opnpool/pump_error/state 0
homeassistant/sensor/opnpool/chlor_name/state Intellichlor–40
homeassistant/sensor/opnpool/chlor_pct/state 25
homeassistant/sensor/opnpool/chlor_salt/state 3650
homeassistant/sensor/opnpool/chlor_status/state OK
homeassistant/binary_sensor/opnpool/pump_running/state ON
homeassistant/binary_sensor/opnpool/mode_service/state OFF
homeassistant/binary_sensor/opnpool/mode_temp_inc/state OFF
homeassistant/binary_sensor/opnpool/mode_freeze_prot/state OFF
homeassistant/binary_sensor/opnpool/mode_timeout/state OFF

Continue reading to learn about other Embbedded C projects.