Airtouch 4 integration (AUS)

@doublebishop, I haven’t even looked into submitting it as a PR at this stage, let alone whether it would be approved or not. Got a lot going on at the moment (and might be selling up and moving to a non-airtouch home!) - if anyone else wants to try pushing the damper control stuff through happy for someone to grab it and pick it up, just not ready for 100+ revisions at the moment (last time I had to take a week off work)

1 Like

@mycrouch you could use a service call to increment up/down the temperature set point by any given amount (say 0.5 deg) from a service call;

service: climate.set_temperature
target:
  entity_id: climate.master
data:
  temperature: >
    {{ state_attr("climate.master", "temperature") + 0.5 }}
1 Like

Also, if you want to display the set point, you will need a template sensor for each room to display the sensor in the picture element card:

sensor:
  - platform: template
    sensors:
      bedroom_temperature:
        unit_of_measurement: "°C"
        value_template: >-
            {{ state_attr("climate.master", "temperature") }}

Sorry for the double post

Thanks @jlich

I’ve looked at the climate services and seems the set_temperature doesn’t like the incrementing.

Failed to call service climate/set_temperature. must contain at least one of temperature, target_temp_high, target_temp_low.

@jlich you put me on track to find a solution. That set_temperature was failing from the Lovelace card so I created a script and call the script from the tap_action. It works well.

Script is

lounge_temp_up:
  alias: Lounge Temp Up
  sequence:
  - service: climate.set_temperature
    data_template:
      entity_id: climate.lounge
      temperature: '{{ state_attr(''climate.lounge'', ''temperature'') + 1 | float
        }}'
  mode: single
lounge_temp_down:
  alias: Lounge Temp Down
  sequence:
  - service: climate.set_temperature
    data_template:
      entity_id: climate.lounge
      temperature: '{{ state_attr(''climate.lounge'', ''temperature'') - 1 | float
        }}'
  mode: single

In the card code editor

  - type: icon
    icon: mdi:minus-circle-outline
    tap_action:
      action: call-service
      service: script.lounge_temp_down

  - type: icon
    icon: mdi:plus-circle-outline
    tap_action:
      action: call-service
      service: script.lounge_temp_up

Thanks for your help

No worries. I must admit I did not try it through the card! Glad you found a solution that works for you.

@LonePurpleWolf
Since ~4pm yesterdayI have been having the same issue as above (see error log below). Local access password is disabled. I believe there was an update to the system recently - could this be the reasoning? I have tried re-adding the integration with no luck either. IP is correct with static internal IP.


Logger: aiohttp.server
Source: components/airtouch4/config_flow.py:29 
First occurred: 4:10:07 PM (1 occurrences) 
Last logged: 4:10:07 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 89, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/airtouch4/config_flow.py", line 29, in async_step_user
    await airtouch.UpdateInfo()
  File "/usr/local/lib/python3.9/site-packages/airtouch4pyapi/airtouch.py", line 65, in UpdateInfo
    await self.SendMessageToAirtouch(message)
  File "/usr/local/lib/python3.9/site-packages/airtouch4pyapi/airtouch.py", line 251, in SendMessageToAirtouch
    return self.TranslatePacketToMessage(dataResult)
UnboundLocalError: local variable 'dataResult' referenced before assignment

@jlich all that error means is that the airtouch is not responding or not there - both the above issues were either WiFi issues or the local password being on - without being in your house, I can only say that 100% of cases so far have been WiFi issues or misconfigured tablets - I’d be checking in your android systems settings to verify the IP, then try pinging the device from your container, then try running SSH/SFTP Server on your android airtouch (you can download it from the play store) and try sshing to it - if all that works with the same IP address then it’s possibly an airtouch issue - but 10 times out of 10 so far, if you take the home assistant out of the equation, things are still broken. I’m currently on 1.3.0/1.1.0.0 which seems to be the latest update. In general I would never expect an update to the airtouch firmware to break the integration, as airtouch would then be breaking their APIs (they seem pretty good about not doing that)

Awesome integration, thanks so much.

Quick Feature Request - keen to pull the historical room temp from a Zone Entity.
Equally, keen to be able to show the current room temp from a Zone within a Badge in Lovelace.
Appreciate any guidance?

Hi,

Thanks for working on integrating the Airtouch4. I am the creator of the HOOBS plugin, and considering moving to Home Assistant atm. I noticed this plugin is using Local Polling, however with the airtouch you can get Local Push. Wondering if there is any reason why this is soo…
Also, are the sensors still required for this to work?
I like the card Jason developed, I think it condenses the UI with most functionality and it’s familiar to use :slight_smile:

Hi @mihailescu2m, as far as I was aware for AirTouch 4 based on specs provided by Polyaire, the only thing available is a TCP API that uses polling - where did you get the info about local push? If someone wants to redevelop it with local push, more than open!

The TCP API is not polling. Once you connect to the socket, you get updates as they happen, so if you change the temperature from the console, then this change will be “pushed” to you as well. It’s a pubsub model, which fits push not poll.
Btw, I am using the damper control even though I have the ITC, so currently setting the temperature does not work for me unfortunately.

Makes sense - I didn’t realise that, so thats the answer to your question! If you look earlier in this thread, theres a branch that isn’t in the mainline that allows damper control via percentage as well

@LonePurpleWolf I had a look at the implementation, and indeed you are using the API in a polling manner. You’re using the polling arbitrator, and you don’t subscribe to updates, but I think you are sending request messages to trigger responses with the state.

I played a bit with Home Assistant and definitely I like it better than pure Homekit.
Finally, there’s a true push system I can make use of. I adapted a bit off my code for the Airtouch and you can see how fast updates are in this video: Push (left) vs Poll (right) HASS Integration - YouTube
(on left is the push system I set up, and on the right is the current poll plugin). I implemented only the “read” operations for now (can’t set state yet), but I am already regretting not moving to HASS a long time ago :slight_smile:
I also see an easy way of dealing with the zones ITC control vs damper control, and exposing all of the Airtouch features (boost, spill etc), things which I struggled with in Homekit…

Looks great!
Let us know if you want any testers to play with the ‘push method’ - I’d be eager to try it out.

@timbo sure, in a few days I will publish my take on the integration.
Had some time this weekend and implemented most of it…

Dampers are set as fans with 2 presets: Damper Control and ITC Control.
When switching to ITC Control, you cannot modify the fan speed (damper), but can set the temperature in the thermostat. If the preset is set to Damper Control, you cannot set the temperature in the thermostat, but can set the fan speed. Turning either thermostat or fan to OFF will turn the zone off.

Thanks to the beauty of push, everything syncs instantly (between themselves and with the other controllers, like the tablet or the phone app).

UPDATE: integration for testing can be found at: https://github.com/mihailescu2m/hass-airtouch4-platform

Arvo @mihailescu2m, looks to have worked a treat! I can’t see any issues whatsoever.
Love how the individual climate entries track the master operating state now, and the new damper vs ITC regime!
When in temp controlled mode, does the system have feedback of the currently set damper level? I sometimes switch over quickly to damper mode just to see if the system is doing something dumb and has the damper half closed when I want it to be pumping more air. Could this be a custom property of the climate module - which we could just template to use elsewhere.

Once again, cheers!

@timbo I’ve done a small update to handle the cases with mixed ITC/Damper control - now the AC target temperature is limited (e.g. when heating, the min temp you can set on the AC is the max target of the ITC groups).
Currently the only thing I am not happy with is the assumption that all groups belong to AC 0 - e.g. when the individual group thermostat show their action (idle/heating/cooling), they are looking at AC 0. Based on requests, I could improve on this, but I only have one AC so I cannot test.
I will be looking if it’s possible to show the damper value when ITC is enabled as the fan of the thermostat. This is something that not even the offical apps/touchpad do :slight_smile:

@mycrouch I think you can use these backgrounds and these icons :smiley:
Can you share your card when it’s done?
Cheers!

Hey all,

Im trying to use the ‘set_temperature’ command onto climate.ac_0 (through node_red)… passing through the temperature value. it doesnt seem to work.

Does anyone know how to set the overall target temperature? Tried to look more into it but cant seem to find it.

Thanks

Carlo

EDIT: It may be that I am only using Dampers, and not the ‘target temperature’ per zone.