Actron Air Conditioner add-on

Hi
Does anyone have the Actron Air Conditioner add-on in HA

3 Likes

I have seen Mike Mcguires one but never implemented it.


My reason for not bothering with it was I still wanted to leave the actron connect app in play externally to my house.

I decided to utilise a combination of reading data locally from the Air-Conditioner itself and sending commands to Actron’s Hosted system.

So this needs a little bit of digging to get some of the information. I also admit that I am still a novice at playing with the Home Assistant thing so please give any improvements you can make.

First thing you will need to do find out the specific information for your Air-Conditioner.
Using chrome (because it is easy) go to Actron’s website and go to the Demo and login with your account details.

Use the chrome menu to open up tools->Developer tools (ctrl+shift+j)

Open up the network tab of the developer tools
Click one of the command buttons (I turned off Zone 1 of 3 for the below command)
you should see something allong the lines of aconnect000000000000000000_0_x_y?user_access_token=somehorrendouslookingstring
click on it and you should see the request url which contains all the information we need for this step.

Request URL:

  https://que.actronair.com.au/rest/v0/device/ACONNECT{yourSpecificUnit}?user_access_token={yourSpecificUserAccessToken}

The Request Payload:

{DA: [0, 1, 1, 0, 0, 0, 0, 0]}

For those of you that get bored easily and like to dig further, you can do the same thing for each of the buttons. But I didn’t want to replicate the app so you can investigate those bits further and replicate how you want.

Step 2
work out the IP address of your air conditioner
Using the very helpful app on actron’s website go to the settings section, click on airconditioner and it will tell you your IP address of your Air conditioner. (for example I will use 192.168.1.9)

Step 3
You now have all the information you need to replicate what I have done.

For reading data from the air conditioner directly there is either multiple reads and then decoding the JSON for each read for individual sensors, Or you can decode the entire JSON and then use templates.
For reference
6.json is the status information

{"isOn":false,"mode":2,"fanSpeed":2,"setPoint":24.5,"roomTemp_oC":27.4,"isInESP_Mode":false,"fanIsCont":0,"compressorActivity":2,"errorCode":"","individualZoneTemperatures_oC":[null,null,null,null,null,null,null,null],"enabledZones":[0,1,1,0,0,0,0,0],"liveTimer":null}

4.json is the values that the AC has read from the Actron server (useful information for later on)

{"amOn":false,"tempTarget":24.5,"mode":2,"fanSpeed":2,"enabledZones":[0,1,1,0,0,0,0,0]}

Add the below to Configuration.yaml

  - platform: rest
    resource: http://192.168.1.9/6.json
    method: GET
    name: InsideTemp_AC
    value_template: '{{value_json.roomTemp_oC}}'
    unit_of_measurement: "°C"

    resource: http://192.168.1.9/6.json
    name: ac_status
    json_attributes:
      - isOn
      - setPoint
      - fanSpeed
      - mode
      - isInESP_Mode
      - roomTemp_oC
      - fanIsCont
      - compressorActivity
      - enabledZones
  - platform: template
    sensors:
       ac_sts_running:
         friendly_name: "AC On"
         #unit_of_measurement: ''
         value_template: '{{  states.sensor.ac_status.attributes["isOn"] }}'
       ac_sts_setpoint:
         friendly_name: "AC Current Setpoint"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["setPoint"]}}'
       insidetemp_ac:
         friendly_name: "Inside Air Temperature"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["roomTemp_oC"] }}'
       ac_fan_speed:
         friendly_name: "AC Fan Speed"
         #unit_of_measurement: ""
         value_template: '{{  states.sensor.ac_status.attributes["fanSpeed"]}}'  		 

Cool we now have the data from the Air conditioner. There is more stuff you can get but you get the picture.

Now how do we command the Air Conditioner to do our bidding?

We add the following. The first 2 commands are pretty straightforward. Turn it On and Turn it OFF.
The third command is one that will take a setpoint and write it to actron’s server. See more info below.

rest_command:
    turn_ac_on:
      url: https://que.actronair.com.au/rest/v0/device/ACONNECT{yourSpecificUnit}?user_access_token={yourSpecificUserAccessToken}
      method: put
      payload: '{"DA": {"amOn": true} }'
      content_type: 'application/json; charset=utf-8'


    turn_ac_off:
      url: https://que.actronair.com.au/rest/v0/device/ACONNECT{yourSpecificUnit}?user_access_token={yourSpecificUserAccessToken}
      method: put
      payload: '{"DA": {"amOn": false} }'
      content_type: 'application/json; charset=utf-8'

    
    set_ac_setpoint:
      url: https://que.actronair.com.au/rest/v0/device/ACONNECT{yourSpecificUnit}?user_access_token={yourSpecificUserAccessToken}
      method: put
      payload: >
        {"DA": {"tempTarget": 
        {{ new_aircon_sp }}      
        }}
      content_type: 'application/json; charset=utf-8'

I created an internal HA input number to allow me to have a setpoint within Home assistant for me to manipulate to send the commands to the Actron system.
This setpoint is not live updated from the Air conditioner. I haven’t done that bit a magic yet to auto update it when the value from the AC changes. I do have a refresh button that does transfer the value from the AC into the internal variable.

input_number:
    ha_aircon_sp:
      name: Air Conditioner Setpoint Control
      initial: 25
      min: 20
      max: 34
      mode: box
      unit_of_measurement: "°C"
      step: 0.5
      icon: mdi:home-thermometer

Next there needs to be some scripts to call the rest services.
Turn AC On
Create Script with Action type “Call Service” then select rest_command.turn_ac_on as the service.

Turn AC off
Create Script with Action type “Call Service” then select rest_command.turn_ac_off as the service.

I have buttons to increase and decrease the internal HA AC setpoint, so I created scripts for this. This increments the setpoint by the “Step” value in the settings for the variable
Decrease AC Temperature
Create script with action type “Call Service” then select input_number.decrement then select the entity input_number.ha_aircon_sp
Increase AC Temperature
Create script with action type “Call Service” then select input_number.increment then select the entity input_number.ha_aircon_sp

For Reseting the internal setpoint to the current air conditioner setpoint, create a script.
you will need to manually edit the yaml

data_template:
  entity_id: input_number.ha_aircon_sp
  value: '{{states(''sensor.ac_sts_setpoint'') | float}}'
service: input_number.set_value

For writing the air conditioner setpoint to the actron server you will need to create another script and then edit the yaml

data_template:
  new_aircon_sp: '{{states(''input_number.ha_aircon_sp'') | float}}'
service: rest_command.set_ac_setpoint

Now to put it all together onto a page. You can either do it yourself using standard buttons etc. I have all the settings laid out on a page using vertical and horizontal stacks etc so it goes well on a single page that is set up as in panel mode.

Create a vertical stack with the following YAML

cards:
  - cards:
      - cards:
          - entity: script.1580612095306
            icon: 'mdi:arrow-up-bold'
            icon_height: 60px
            name: Up
            show_icon: true
            show_name: false
            tap_action:
              action: toggle
            type: entity-button
          - entities:
              - entity: input_number.ha_aircon_sp
                name: Control SP
            icon_height: 60px
            show_icon: true
            show_name: true
            type: entities
          - entity: script.1580612306016
            icon: 'mdi:refresh'
            icon_height: 60px
            name: Reset
            show_icon: true
            show_name: false
            tap_action:
              action: toggle
            type: entity-button
        type: horizontal-stack
      - cards:
          - entity: script.1580612134575
            icon: 'mdi:arrow-down-bold'
            icon_height: 60px
            name: Down
            show_icon: true
            show_name: false
            tap_action:
              action: toggle
            type: entity-button
          - entities:
              - entity: sensor.ac_sts_setpoint
                name: Current SP
            icon_height: 60px
            show_icon: true
            show_name: true
            type: entities
          - entity: script.1580602518504
            icon: 'mdi:check'
            icon_height: 40px
            name: Apply Setpoint
            show_icon: true
            show_name: true
            tap_action:
              action: toggle
            type: entity-button
        type: horizontal-stack
      - cards:
          - entity: script.1580527413443
            icon: 'mdi:fan-off'
            icon_height: 60px
            name: 'Off'
            show_icon: true
            show_name: false
            tap_action:
              action: toggle
            type: entity-button
          - entity: script.1580527392555
            icon: 'mdi:fan'
            icon_height: 60px
            name: 'On'
            show_icon: true
            show_name: false
            tap_action:
              action: toggle
            type: entity-button
          - entities:
              - entity: sensor.ac_sts_running
                icon: 'mdi:fan'
                name: AC Running
            icon_height: 60px
            show_icon: true
            show_name: true
            type: entities
        type: horizontal-stack
    type: vertical-stack
  - entities:
      - entity: sensor.insidetemp_ac
        icon: 'mdi:thermometer'
        name: Current Inside Temp
    icon_height: 60px
    show_icon: true
    show_name: true
    type: entities
  - entities:
      - entity: sensor.ac_sts_setpoint
        name: Setpoint
      - entity: sensor.insidetemp_ac
        name: Temperature
    hours_to_show: 10
    refresh_interval: 0
    type: history-graph
title: AC control
type: vertical-stack
1 Like

This is a picture of what my final dashboard looks like.

I will add extra items as I have time to implement them.
My goal is to add in:

  • Zone control and status
  • Mode Selection and status
    • 0 = Auto
    • 1 = Heat
    • 2 = Cool
    • 3 = Fan
  • Fan Speed Selection and status
    • 0 = Low
    • 1 = Med
    • 2 = High
  • Compressor Activity - This is just information
    • 0 = Heating
    • 1 = Cooling
    • 2 = Off
2 Likes

That looks great Keith you’ve been busy!

Just be aware that the Air Conditioner unique identifier does change occasionally. As I learnt when mine suddenly stopped working.
In my case the first part remained the same, as it is based on MAC address but the last digit changed. Possibly a version number of some sort.

Thanks very much for the information, i been thinking about this for awhile and also did not want to go down path of not having remote app.

Your details above lead me to this which shoul dhelp decipher the rest of the api

https://que.actronair.com.au/api/

Once i know more i’ll post some info on it also.

Cheers
mark

Hi Keith, thank you so much for the work you’re doing getting Actron air conditioners to work with hass. Im not very good with scripts so I’m not exactly sure how to implement what you’ve done so far but I’m very excited with your progress.

Cheers,
Shaun

1 Like

Hi Keith,

Quick question for you, I am able to follow along to extract the data required from Chrome Dev Tools, but when it comes to creating the config, i am getting stuck.

On Step 3, you state that we should just add the code to configuration.yaml, but when i do, i get errors. I THINK i have worked out that i need to add the sensor: integration before the - platform: template line so that it codes like this (possibly also have this wrong)

sensor:
  - platform: template
    sensors:
       ac_sts_running:
         friendly_name: "AC On"
         #unit_of_measurement: ''
         value_template: '{{  states.sensor.ac_status.attributes["isOn"] }}'
       ac_sts_setpoint:
         friendly_name: "AC Current Setpoint"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["setPoint"]}}'
       insidetemp_ac:
         friendly_name: "Inside Air Temperature"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["roomTemp_oC"] }}'
       ac_fan_speed:
         friendly_name: "AC Fan Speed"
         #unit_of_measurement: ""
         value_template: '{{  states.sensor.ac_status.attributes["fanSpeed"]}}'

but I cannot work out what to add before the

  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: InsideTemp_AC
    value_template: '{{value_json.roomTemp_oC}}'
    unit_of_measurement: "°C"

    resource: http://10.0.20.171/6.json
    name: ac_status
    json_attributes:
      - isOn
      - setPoint
      - fanSpeed
      - mode
      - isInESP_Mode
      - roomTemp_oC
      - fanIsCont
      - compressorActivity
      - enabledZones

any help would be greatly appreciated…

I’ll jump onto my system tonight or tomorrow and see if I can replicate the issue. But I am thinking the platform template bit may need to come after the platform rest bit because the template bit references the stuff inside the ac_status.
But i’ll have a look at what I have got above the platform:rest

looks like my order of things is
sensor:

  • platform: xxxxx (my inverter for solar)

  • platform: rest (as above)

  • platform: template (as above)

Thankyou for checking.

You will have to excuse my lack of coding ability, I am more of a script copier than a writer… once i get it working (after a lot of trial and error) i can normally pick up how it works… On that note, I have another question to throw at you…

I have the code working BUT have written it as follows,

Sensor:
  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: InsideTemp_AC
    value_template: '{{value_json.roomTemp_oC}}'
    unit_of_measurement: "°C"
  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: "AC On"
    value_template: '{{value_json.isOn}}'
    unit_of_measurement: ""
  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: "AC Current Setpoint"
    value_template: '{{value_json.setPoint}}'
    unit_of_measurement: "°C"
  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: "AC Fan Speed"
    value_template: '{{value_json.fanSpeed}}'
    unit_of_measurement: ""
#  - platform: template
#    sensors:
#       ac_sts_running:
#         friendly_name: "AC On"
#         #unit_of_measurement: ''
#         value_template: '{{  states.sensor.ac_status.attributes["isOn"] }}'
#       ac_sts_setpoint:
#         friendly_name: "AC Current Setpoint"
#         unit_of_measurement: "°C"
#         value_template: '{{  states.sensor.ac_status.attributes["setPoint"]}}'
#       insidetemp_ac:
#         friendly_name: "Inside Air Temperature"
#         unit_of_measurement: "°C"
#         value_template: '{{  states.sensor.ac_status.attributes["roomTemp_oC"] }}'
#       ac_fan_speed:
#         friendly_name: "AC Fan Speed"
#         #unit_of_measurement: ""
#         value_template: '{{  states.sensor.ac_status.attributes["fanSpeed"]}}'

as i was missing entities if i added it as you have it above.
Just so i understand, should i have only used one of the two different sections, ie:

  - platform: rest
    resource: http://10.0.20.171/6.json
    method: GET
    name: InsideTemp_AC
    value_template: '{{value_json.roomTemp_oC}}'
    unit_of_measurement: "°C"

OR

  - platform: rest
    resource: http://10.0.20.171/6.json
    name: ac_status
    json_attributes:
      - isOn
      - setPoint
      - fanSpeed
      - mode
      - isInESP_Mode
      - roomTemp_oC
      - fanIsCont
      - compressorActivity
      - enabledZones
  - platform: template
    sensors:
       ac_sts_running:
         friendly_name: "AC On"
         #unit_of_measurement: ''
         value_template: '{{  states.sensor.ac_status.attributes["isOn"] }}'
       ac_sts_setpoint:
         friendly_name: "AC Current Setpoint"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["setPoint"]}}'
       insidetemp_ac:
         friendly_name: "Inside Air Temperature"
         unit_of_measurement: "°C"
         value_template: '{{  states.sensor.ac_status.attributes["roomTemp_oC"] }}'
       ac_fan_speed:
         friendly_name: "AC Fan Speed"
         #unit_of_measurement: ""
         value_template: '{{  states.sensor.ac_status.attributes["fanSpeed"]}}'
1 Like

Slightly off-topic, but people looking for info about the EasyConnect app could head here

I’ve made very small progress toward connecting to that service, but thought people that some EasyConnect users might end up here, and might want to come and help :grinning:

It looks like the demo is no longer available. Any other methods to get the API?

EDIT:
i found on Log in after I log in to my account using inspector and searching for keyword ‘api’ a key that I believe is correct.
Screen Shot 2021-12-18 at 11.00.21 pm

After accessing the link it returns this info -

{“type”:“aconnect”,“serial”:“ACONNECT*******”,“id”:“ms1Ewo4axVAZKvw0c7heHPs4**********************=”,“issued”:“2021-11-21T08:25:04.6510578+00:00”,“expires”:“3021-11-21T08:25:04.6510578+00:00”,“description”:“Actron Connect (ACONNECT******************)”,"_links":{“self”:{“href”:"/api/v0/client/ac-systems/ms1Ewo4axVAZKvw0c7heHPs4**********************%3D"}}}

For those looking for the demo link:
https://actronair.com.au/aconnect/#/Auth

1 Like