Control and monitor a Sabik 350 ventilation unit via Modbus and MQTT, allowing integration with Home Assistant.
- USB-Modbus converter connected to the Sabik
- MQTT broker (typically Home Assistant's built-in broker)
- Add your user to the
dialoutgroup for USB access:
sudo usermod -a -G dialout $USER
# Log out and back in for changes to take effect- Clone and build:
git clone https://github.com/Arie/sabik
cd sabik
docker compose build-
Edit
docker-compose.ymlto set your MQTT credentials and USB device path (default is/dev/ttyUSB0). -
Run:
docker compose up -dThis will automatically set up the sensors in Home Assistant and start the MQTT subscriber.
- View logs:
docker compose logs -f- Clone the repository:
git clone https://github.com/Arie/sabik
cd sabik- Install dependencies:
gem install bundler && bundle-
Create a MQTT user in Home Assistant if you don't already have one
-
Create a
secrets.rbfile with your MQTT credentials:
MQTT_USER = 'your-ha-mqtt-user-here'
MQTT_PASSWORD = 'your-ha-mqtt-user-password-here'
MQTT_HOST = 'ip-address-or-hostname-of-ha-mqtt'- Create the sensors in Home Assistant:
ruby setup_mqtt.rb- Test the Modbus connection:
bundle consoleThen in the console:
require_relative 'sabik'
Sabik.new.statusYou should see output like this:
{:active_alarms=>0,
:filter_alarm=>0,
:temperature_sensor_extract_air_status=>0,
# ... more status values ...
:selected_air_volume=>1}ruby mqtt_subscriber.rb- Create the systemd user directory:
mkdir -p ~/.config/systemd/user/- Create
~/.config/systemd/user/sabik-mqtt.service:
[Unit]
Description=Sabik MQTT Control Service
After=network.target
[Service]
Type=simple
Environment="MQTT_HOST=your-ha-mqtt-host"
Environment="MQTT_USER=your-ha-mqtt-user"
Environment="MQTT_PASSWORD=your-ha-mqtt-password"
WorkingDirectory=%h/path/to/sabik
ExecStart=/usr/bin/ruby mqtt_subscriber.rb
Restart=always
RestartSec=10
[Install]
WantedBy=default.target- Enable and start the service:
# Enable service
systemctl --user enable sabik-mqtt.service
# Start service
systemctl --user start sabik-mqtt.service
# Check status
systemctl --user status sabik-mqtt.serviceUse the test script for manual control:
ruby test_mqtt_control.rbFeatures available through the test script:
- Operation modes (off/auto/manual)
- Fan speeds (low/medium/high/auto/snooze)
- Bypass temperature settings:
- Minimum indoor temperature (21-30°C)
- Minimum outdoor temperature (12-20°C)
- Minimum temperature difference (3-6°C)
- Manual and automatic bypass control
- Summer mode control
- Boost mode
- Time settings and synchronization
- Status monitoring
Bypass requires all these conditions:
- Indoor (Extract) temperature > minimum (default 23°C)
- Outdoor temperature > minimum (default 13°C)
- Temperature difference > minimum (default 3°C)
Requires:
- Outdoor temperature above minimum (uses same threshold as bypass)
- Serial Port Access:
# Add user to dialout group
sudo usermod -a -G dialout $USER
# Verify permissions
ls -l /dev/ttyUSB0- View Service Logs:
journalctl --user -u sabik-mqtt.service -f- Test MQTT Connection:
mosquitto_sub -h your-ha-mqtt-host -u your-mqtt-user -P your-mqtt-password -t 'homeassistant/climate/sabik/#'