Skip to content

hannoeru/hass-nature-remo

 
 

Repository files navigation

Home Assistant integration for Nature Remo

Yet another Home Assistant component for Nature Remo.

⚠️This integration is neither Nature Remo official nor Home Assistant official. Use at your own risk. ⚠️

Supported features

  • Air Conditioner
    • Set mode (e.g. cool, warm, blow etc.)
    • Set temperature
    • Set fan mode
    • Set swing mode
    • Show current temperature
    • Remember previous target temperatures when switching modes back and forth
  • Energy Sensor (Nature Remo E/E Lite)
    • Fetch current power usage
    • Fetch cumulative consumed energy
    • Fetch cumulative returned energy (for solar panels, etc.)
  • Switch
  • Light
  • TV
  • Others
    • Fetch sensor data

Tested on Home Assistant Core 2024.3.4 (Linux) Only energy sensor features (including cumulative consumed and returned energy) have been tested. Other device features (e.g. air conditioners, switches) were not verified in this update.

Home Assistant Energy Dashboard support

This integration supports Home Assistant's Energy Dashboard. If you're using Nature Remo E or E Lite, cumulative energy sensors (both consumed and returned) will automatically be available for configuration.

Installation

Install via HACS Custom repositories

https://hacs.xyz/docs/faq/custom_repositories

Enter the following information in the dialog and click Add button.

Manual Install

  1. Download this repository
  2. Create custom_components/nature_remo folder in your config directory
  3. Copy files into it (Just drag&drop whole files would be fine)
{path_to_your_config}
├── configuration.yaml
└── custom_components
    └── nature_remo
        ├── __init__.py
        ├── climate.py
        ├── manifest.json
        └── sensor.py

Install via git submodule

If you have set up git, you can also install this component by adding submodule to your git repository.

git submodule add https://github.com/yutoyazaki/hass-nature-remo.git {path_to_custom_component}/nature_remo

Configuration

  1. Go to https://home.nature.global and sign in/up
  2. Generate access token
  3. Add the following codes to your configuration.yaml file
nature_remo:
  access_token: YOUR_ACCESS_TOKEN

Development

This section contains information for developers who want to contribute to this project.

Prerequisites

  • Python 3.12 or higher
  • uv - Python package manager

Setup Development Environment

  1. Clone the repository

    git clone https://github.com/hannoeru/hass-nature-remo.git
    cd hass-nature-remo
  2. Install uv (if not already installed)

    curl -LsSf https://astral.sh/uv/install.sh | sh
  3. Set up virtual environment and install dependencies

    uv sync --dev
  4. Activate the virtual environment

    source .venv/bin/activate

Development Tools

This project uses several development tools to maintain code quality:

Code Linting and Formatting

  • Ruff - Fast Python linter and formatter
    # Check for linting issues
    uv run ruff check
    
    # Fix auto-fixable issues
    uv run ruff check --fix
    
    # Format code
    uv run ruff format

Type Checking

  • mypy - Static type checker
    uv run mypy .

Testing

  • pytest - Testing framework
    # Run all tests
    uv run pytest
    
    # Run tests with coverage
    uv run pytest --cov
    
    # Run specific test file
    uv run pytest tests/test_specific.py

Project Structure

hass-nature-remo/
├── __init__.py          # Main integration setup
├── climate.py           # Climate entity implementation
├── sensor.py            # Sensor entities implementation
├── manifest.json        # Home Assistant integration manifest
├── pyproject.toml       # Project configuration and dependencies
├── README.md            # This file
└── tests/               # Test files (if any)

Adding New Features

  1. Follow Home Assistant development patterns - Refer to the Home Assistant Developer Documentation

  2. Add type annotations - All new code should include proper type hints

  3. Write tests - Add tests for new functionality in the tests/ directory

  4. Run quality checks before committing:

    # Run all checks
    uv run ruff check --fix
    uv run ruff format
    uv run mypy .
    uv run pytest

Debugging

For debugging the integration:

  1. Enable debug logging in your Home Assistant configuration.yaml:

    logger:
      default: info
      logs:
        custom_components.nature_remo: debug
  2. Use Home Assistant's developer tools to inspect entity states and attributes

  3. Check Home Assistant logs for any error messages related to the integration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes following the development guidelines above
  4. Run all quality checks
  5. Submit a pull request

Home Assistant Integration Testing

To test the integration with Home Assistant:

  1. Install Home Assistant in a development environment
  2. Copy the integration to your custom_components directory
  3. Add the configuration to your configuration.yaml
  4. Restart Home Assistant and check the logs for any issues

About

Nature Remo integration for Home Assistant

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%