syr_connect

System Requirements for SYR Connect Integration

Home Assistant Requirements

Development Requirements

For running tests and development (the tests need Linux or WSL, they do not run on Windows):

pip install -r requirements-dev.txt

Run tests with:

pytest tests/

Run tests with coverage:

pytest --cov=custom_components.syr_connect --cov-report=term-missing tests/

Development Emulator

For testing without a real SYR device, use the SYR Connect Emulator:

Repository: https://github.com/alexhass/syr_connect_emulator

The emulator provides:

To use the emulator and install to Apache:

  1. Clone the emulator:

    git clone https://github.com/alexhass/syr_connect_emulator.git
    
  2. Configure the integration to use your webservers hostname or IP as the device host
  3. Select “Local” when adding the integration hub

The emulator responds to all standard API calls and allows testing features without accessing real devices.

Python Package Requirements

The following packages will be automatically installed by Home Assistant:

Required Packages

  1. pycryptodomex (>=3.19.0,<4.0)
    • Purpose: AES encryption/decryption for API communication
    • License: BSD, Public Domain
    • Note: Uses pycryptodomex (not pycryptodome) to avoid conflicts with Home Assistant’s crypto libraries
  2. defusedxml (>=0.7.1,<1.0)
    • Purpose: Secure XML parsing to prevent XXE (XML External Entity) attacks
    • License: Python Software Foundation License
    • Note: Replaces the built-in xml.etree.ElementTree with a hardened version

Network Requirements

Installation Verification

After installing the integration in Home Assistant:

  1. Check that requirements are installed:
    • Go to Settings > System > Logs
    • Look for any ModuleNotFoundError or ImportError
    • If requirements are missing, restart Home Assistant
  2. Verify integration loads:
    • Go to Settings > Devices & Services
    • Check if “SYR Connect” appears in the list
    • If not visible, check logs for errors
  3. Test connection:
    • Add the integration with your credentials
    • Check if devices are discovered
    • Verify sensors show data

Common Issues

Issue: ModuleNotFoundError: No module named 'Cryptodome' or No module named 'defusedxml'

Solution: Restart Home Assistant to trigger automatic installation of required packages (pycryptodomex and defusedxml)

Issue: ImportError: cannot import name 'AES' from 'Crypto.Cipher'

Solution: This indicates a conflict with the old pycryptodome package. The integration now uses pycryptodomex which avoids this conflict.

Issue: Integration not appearing in list

Solution:

  1. Verify the folder structure is correct: config/custom_components/syr_connect/
  2. Check that all required files are present
  3. Restart Home Assistant
  4. Check logs for any Python syntax errors

Manual Dependency Installation (Advanced)

If automatic installation fails, you can manually install the dependencies:

# For Home Assistant Container/OS
docker exec -it homeassistant pip install "pycryptodomex>=3.19.0,<4.0" "defusedxml>=0.7.1,<1.0"

# For Home Assistant Core
source /srv/homeassistant/bin/activate
pip install "pycryptodomex>=3.19.0,<4.0" "defusedxml>=0.7.1,<1.0"

File Structure Requirements

config/
└── custom_components/
   └── syr_connect/
      ├── __init__.py
      ├── manifest.json
      ├── aiosyrconnect/
      │  ├── __init__.py
      │  ├── codes.py
      │  ├── commands.py
      │  ├── const.py
      │  ├── exceptions.py
      │  ├── http_client.py
      │  ├── json_api.py
      │  ├── model_detection.py
      │  ├── models.py
      │  ├── py.typed
      │  ├── settings.py
      │  ├── units.py
      │  ├── values.py
      │  ├── xml_api.py
      │  ├── xml_checksum.py
      │  ├── xml_encryption.py
      │  ├── xml_parser.py
      │  └── xml_payload.py
      ├── config_flow.py
      ├── const.py
      ├── models.py
      ├── coordinator.py
      ├── data.py
      ├── sensor.py
      ├── binary_sensor.py
      ├── button.py
      ├── select.py
      ├── switch.py
      ├── update.py
      ├── valve.py
      ├── diagnostics.py
      ├── entity.py
      ├── helpers/
      │  ├── __init__.py
      │  ├── device.py
      │  ├── integration.py
      │  ├── profile.py
      │  └── registry.py
      ├── icons.json
      ├── migrations.py
      ├── devices/
      │  ├── __init__.py
      │  └── <one file per device family>.py
      ├── brand/
      │  ├── icon.png
      │  ├── icon@2x.png
      │  ├── logo.png
      │  └── logo@2x.png
      └── translations/
         ├── de.json
         ├── en.json
         ├── es.json
         ├── fr.json
         ├── it.json
         ├── nl.json
         ├── pl.json
         └── pt.json

All files must be present for the integration to work correctly.