Skip to content

bigmoby/fglair_for_homeassistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

379 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FGLair™ integration for homeassistant

GitHub Release Project Stage License

Maintenance GitHub Activity

Donate

FGLAIR_LOGO

This is a platform to support Fujitsu General Airconditioners under Climate component of Home Assistant. The Python supporting library for accessing the FGLair™ API is located at: https://github.com/bigmoby/pyfujitsugeneral/

Sample UI:

UI_SCREENSHOT1 UI_SCREENSHOT2

Installation

Manual

  1. Create this directory path custom_components/fglair_heatpump_controller/ if it does not already exist.

  2. Download the all custom_components/fglair_heatpump_controller/ files from the repo and place it in the directory mentioned in previous step.

HACS

  1. Add this repository to HACS:
https://github.com/bigmoby/fglair_for_homeassistant
  1. Search for the FGLair integration for homeassistant integration and choose install.

  2. Reboot Home Assistant.

Usage:

In Home Assistant->Settings->Device & services->Integration menu add the new integration FGLair and configure it.

Please, use your FGLair app username/password and region your FGLair account is registered (choose one of region: eu, cn or us). For tokenpath field you could leave the default value token.txt. You could set a proper temperature_offset, default will be 0.

Attention: please, remove from configuration.yaml any previous FGLair installation setup.

Features

  • HVAC Modes: Heat, Cool, Auto, Dry, Fan Only, Off
  • Fan Speeds: Auto, Low, Medium, High, Quiet
  • Preset Modes: Economy, Boost, Away (Min Heat)
  • Temperature Control: Adjustable target temperature with offset support
  • Vertical Swing: Full vertical swing control with position settings
  • Horizontal Swing: Independent horizontal swing control (requires Home Assistant 2024.12+ and compatible air conditioner)

Develop

Quick Start

Setup the development environment:

make setup

Or manually:

./scripts/setup

Available Commands

Use the Makefile for common development tasks:

make help          # Show all available commands
make setup         # Setup development environment (run this first!)
make test          # Run tests
make test-coverage # Run tests with coverage report
make lint          # Run linting tools
make format        # Format code
make check         # Run all checks (lint + test)
make clean         # Clean up temporary files
make install-dev   # Install in development mode
make develop       # Start development server (requires setup first)
make ci            # Run CI pipeline locally

# Pre-commit system
make pre-commit-install          # Install pre-commit hooks
make pre-commit-uninstall        # Uninstall pre-commit hooks
make pre-commit-run              # Run pre-commit on all files

Note: Make sure you have run make setup before using make develop, otherwise you may get an error because the hass command will not be available.

Development Tools

This project includes development tools for code quality and testing:

Pre-Commit Hooks

Install pre-commit hooks to automatically run checks before commits:

make pre-commit-install  # Install pre-commit hooks

The pre-commit configuration includes:

  • ✅ Code formatting with ruff
  • ✅ Linting with ruff and flake8
  • ✅ Type checking with mypy
  • ✅ Test execution with pytest
  • ✅ Coverage checking (minimum 100%)

Manual Commands

Activate virtual environment:

source venv/bin/activate

Run tests:

python -m pytest tests/ -v

Run linting:

pre-commit run --all-files

Start development server:

./scripts/develop

Dependencies Structure

  • requirements.txt - Core runtime dependencies
  • requirements.test.txt - Testing and development dependencies
  • pyproject.toml - Project metadata and optional dependencies

The project uses:

  • pyfujitsugeneral==2.0.33 - Core API client for FGLair
  • aiofiles==24.1.0 - Async file operations
  • pytest-homeassistant-custom-component - Testing framework for HA integrations
  • ruff - Fast Python linter and formatter
  • mypy - Static type checker
  • pre-commit - Git hooks for code quality

Known issues and missing features:

  • Logging needs to be implemented
  • The "powerful" functionality is implemented via the preset selections in the UI
  • Independent horizontal swing control (Home Assistant 2024.12+)
  • There are some other functionalities in the A/C which currently is not implemented.
  • Possibility to add external temperature sensor

** "FGLair" is a trademark of FUJITSU GENERAL LIMITED.