Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

#### [0.3.31](https://github.com/sarbuk/AirCon/compare/0.3.29...0.3.31)
> 27 June 2025

- added additional definitions in ```__main__.py``` to expose additional topics for the following, outside of the HA climate control:
- economy_mode [switch]
- powerful_mode [switch]
- af_vertical_direction [integer 1-4]
- outdoor_temperature [sensor]

#### [0.3.29](https://github.com/sarbuk/AirCon/compare/0.3.24...0.3.29)
> 25 June 2025

- add temp_step = 0.5 to allow half degree increments in HA
- other changes due to forking from xury77

#### [0.3.24](https://github.com/xury77/AirCon/compare/0.3.23...0.3.24)
> 18 November 2024

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If using [HomeAssistant], this is the preferred method.

1. In the HomeAssistant UI, enter **Supervisor → Add-on Store**.
1. Click **⋮ menu → Repositories**.
1. Add `https://github.com/xury77/AirCon` to the list.
1. Add `https://github.com/sarbuk/AirCon` to the list.
1. Choose **HiSense Air Conditioner** and install it.
1. Update the configuration as detailed within the add-on.
1. Start the add-on. Do not forget to enable **Start on boot** and **Watchdog**.
Expand Down
2 changes: 1 addition & 1 deletion aircon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import *
__version__ = '0.3.24'
__version__ = '0.3.31'
76 changes: 76 additions & 0 deletions aircon/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ async def run(parsed_args):
mqtt_client.will_set(mqtt_topics['lwt'], payload='offline', retain=True)
mqtt_client.connect(parsed_args.mqtt_host, parsed_args.mqtt_port)
mqtt_client.publish(mqtt_topics['lwt'], payload='online', retain=True)
print(f"[DEBUG] Devices loaded: {len(devices)}", file=sys.stderr)
for device in devices:
config = {
'unique_id': device.mac_address,
Expand All @@ -211,9 +212,21 @@ async def run(parsed_args):
},
],
'precision': device.get_temp_precision(),
'temp_step': 0.5,
'temperature_unit': 'F' if device.is_fahrenheit else 'C'
}
topics = device.topics
# [PATCH] Extend topics manually for known-but-omitted features
fallback_keys = [
'economy_mode',
'powerful_mode',
'af_vertical_direction',
'outdoor_temperature',
]
for key in fallback_keys:
if key not in topics:
topics[key] = key
print(f"[DEBUG] Patched topics for {device.name}: {topics.keys()}", file=sys.stderr)
if 'env_temp' in topics:
config['current_temperature_topic'] = mqtt_topics['pub'].format(
device.mac_address, topics['env_temp'])
Expand Down Expand Up @@ -254,6 +267,69 @@ async def run(parsed_args):
mqtt_client.publish(mqtt_topics['discovery'].format(device.mac_address),
payload=json.dumps(config),
retain=True)
if 'economy_mode' in topics:
mqtt_client.publish(
f"{parsed_args.mqtt_discovery_prefix}/switch/{device.mac_address}/economy_mode/config",
payload=json.dumps({
"name": f"{device.name} Economy Mode",
"unique_id": f"{device.mac_address}_economy_mode",
"state_topic": mqtt_topics['pub'].format(device.mac_address, topics['economy_mode']),
"command_topic": mqtt_topics['sub'].format(device.mac_address, topics['economy_mode']),
"payload_on": "ON",
"payload_off": "OFF",
"availability": [{"topic": mqtt_topics['lwt']}],
"device": config["device"]
}),
retain=True
)

if 'powerful_mode' in topics:
mqtt_client.publish(
f"{parsed_args.mqtt_discovery_prefix}/switch/{device.mac_address}/powerful_mode/config",
payload=json.dumps({
"name": f"{device.name} Powerful Mode",
"unique_id": f"{device.mac_address}_powerful_mode",
"state_topic": mqtt_topics['pub'].format(device.mac_address, topics['powerful_mode']),
"command_topic": mqtt_topics['sub'].format(device.mac_address, topics['powerful_mode']),
"payload_on": "ON",
"payload_off": "OFF",
"availability": [{"topic": mqtt_topics['lwt']}],
"device": config["device"]
}),
retain=True
)

if 'af_vertical_direction' in topics:
mqtt_client.publish(
f"{parsed_args.mqtt_discovery_prefix}/number/{device.mac_address}/af_vertical_direction/config",
payload=json.dumps({
"name": f"{device.name} Vertical Airflow",
"unique_id": f"{device.mac_address}_af_vertical_direction",
"state_topic": mqtt_topics['pub'].format(device.mac_address, topics['af_vertical_direction']),
"command_topic": mqtt_topics['sub'].format(device.mac_address, topics['af_vertical_direction']),
"min": 1,
"max": 4,
"step": 1,
"availability": [{"topic": mqtt_topics['lwt']}],
"device": config["device"]
}),
retain=True
)

if 'outdoor_temperature' in topics:
mqtt_client.publish(
f"{parsed_args.mqtt_discovery_prefix}/sensor/{device.mac_address}/outdoor_temperature/config",
payload=json.dumps({
"name": f"{device.name} Outdoor Temperature",
"unique_id": f"{device.mac_address}_outdoor_temperature",
"state_topic": mqtt_topics['pub'].format(device.mac_address, topics['outdoor_temperature']),
"unit_of_measurement": "°C",
"device_class": "temperature",
"availability": [{"topic": mqtt_topics['lwt']}],
"device": config["device"]
}),
retain=True
)
device.add_property_change_listener(mqtt_client.mqtt_publish_update)

async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(connect=5.0)) as session:
Expand Down
6 changes: 3 additions & 3 deletions hassio/config.json → config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "HiSense Air Conditioners",
"version": "0.3.24",
"version": "0.3.31",
"slug": "hisense_ac",
"description": "Interface for controlling Air Conditioners, e.g. with HiSense modules.",
"url": "https://github.com/xury77/AirCon",
"image": "ghcr.io/xury77/aircon",
"url": "https://github.com/sarbuk/AirCon",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
"build": true,
"startup": "application",
"boot": "auto",
"host_network": true,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
hisense_ac:
depends_on:
- copy_config
image: ghcr.io/xury77/aircon:0.3.24
build: .
container_name: hisense_ac
healthcheck:
disable: true
Expand Down
2 changes: 1 addition & 1 deletion hassio/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Configuration

1. Find your application code from the list
[here](https://github.com/xury77/AirCon#prerequisites).
[here](https://github.com/sarbuk/AirCon#prerequisites).
1. Set the configuration as follows:
```yaml
app:
Expand Down
2 changes: 1 addition & 1 deletion hassio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## About

Use this add-on to add support for Hisense Air Conditioners. See [here](https://github.com/xury77/AirCon) for more details.
Use this add-on to add support for Hisense Air Conditioners. See [here](https://github.com/sarbuk/AirCon/) for more details.

[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
Expand Down
2 changes: 1 addition & 1 deletion new_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ git tag -d "$NEW_VERSION"
git tag -a "$NEW_VERSION" -m "$NEW_VERSION_MSG"
docker buildx rm --all-inactive --force
docker buildx create --name multiarch --driver docker-container --use || true
docker buildx build --platform linux/arm/v7,linux/arm64,linux/amd64,linux/386 -t xury77/aircon:$NEW_VERSION --push .
docker buildx build --platform linux/arm/v7,linux/arm64,linux/amd64,linux/386 -t sarbuk/aircon:$NEW_VERSION --push .
git push
git push --tags
4 changes: 2 additions & 2 deletions repository.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Home Assistant Add-on: HiSense Air Conditioners",
"url": "https://github.com/xury77/AirCon",
"maintainer": "Xury77 xury@poczta.onet.pl"
"url": "https://github.com/sarbuk/AirCon",
"maintainer": "sarbuk"
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
description='Interface for controlling Air Conditioners, e.g. with HiSense modules.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/xury77/AirCon',
url='https://github.com/sarbuk/AirCon',
author='Dror Eiger',
author_email='droreiger@gmail.com',
license='GPL 3.0',
Expand Down