Anyone using IntesisHome WiFi control of mini-split AC?

Hi everyone,

I’ve been looking for something to connect my Fujitsu air-conditioner units (ASYG07LMCE, ASYG12LUCA; using the FGLAir app by default) with OpenHAB and I just managed to do it.

In case anyone comes across this issue, follow my guide below - it describes how to integrate the Fujitsu air-conditioners with FGLAir app connectiviy (Wifi module) with OpenHAB through MQTT.

  1. You will need Deiger’s python script: https://github.com/deiger/AirCon

  2. Extract the zip with the script to your home folder (ie. on a Raspberry to /home/pi/opt/fujitsu).

  3. Make sure you have python3 (apt-get install python3)

  4. Find the IP addresses of your airco units - unfortunately the FGLAir app doesn’t seem to support it now, so either you put them on a static IP upon installing them or you’ll need to look into your router’s network map to find them. You will need the IPs, there’s no way around.
    This can help, my wifi module’s MAC addresses start with this bit, you might get lucky. The device ID is something like Murata Manufacturing Co., Ltd.
    arp-scan 192.168.0.0/24 | grep -i "A0:CC:2B:EC"
    Result:
    192.168.0.x a0:cc:2b:ec:xx:xx Murata Manufacturing Co., Ltd.

  5. We’ll need to find the device IDs and create the config file:
    python3 /home/pi/opt/fujitsu/query_cli.py --user your_FGLAIR_USERNAME --passwd your_FGLAIR_PASSWORD --app fglair-eu --config config.json
    This should give you a result like this like my 3 units:
    I0605 13:15:40.971 query_cli.py:196] Found devices: [{‘device’: {‘product_name’: ‘AC000W00285XXXX’, ‘model’: ‘AY001MTS1’, ‘dsn’: ‘AC000W00285XXXX’, ‘oem_model’: ‘AP-WB2E’, ‘sw_version’: ‘bc 2.6.15-fgl 02/04/20 12:25:04 ID phunt/bf51432’, ‘template_id’: 4904, ‘mac’: ‘a0cc2becxxxx’, ‘unique_hardware_id’: None, ‘hwsig’: ‘mac-a0cc2becxxxx’, ‘lan_ip’: ‘192.168.0.2’, ‘connected_at’: ‘2020-05-15T12:12:49Z’, ‘key’: 56789, ‘lan_enabled’: True, ‘has_properties’: True, ‘product_class’: ‘demo’, ‘connection_status’: ‘Online’, ‘lat’: ‘50xxx’, ‘lng’: ‘xxx’, ‘locality’: ‘xxxx’, ‘device_type’: ‘Wifi’}}, {‘device’: {‘product_name’: ‘AC000W00281YYYY’, ‘model’: ‘AY001MTS1’, ‘dsn’: ‘AC000W00281YYYY’, ‘oem_model’: ‘AP-WB2E’, ‘sw_version’: ‘bc 2.6.15-fgl 02/04/20 12:25:04 ID phunt/bf51432’, ‘template_id’: 4904, ‘mac’: ‘a0cc2becyyyy’, ‘unique_hardware_id’: None, ‘hwsig’: ‘mac-a0cc2becyyyy’, ‘lan_ip’: ‘192.168.0.3’, ‘connected_at’: ‘2020-05-15T12:12:56Z’, ‘key’: 345678, ‘lan_enabled’: True, ‘has_properties’: True, ‘product_class’: ‘demo’, ‘connection_status’: ‘Online’, ‘lat’: ‘50.xxx’, ‘lng’: ‘5.xx’, ‘locality’: ‘xxx’, ‘device_type’: ‘Wifi’}}, {‘device’: {‘product_name’: ‘AC000W00285ZZZZ’, ‘model’: ‘AY001MTS1’, ‘dsn’: ‘AC000W00285ZZZZ’, ‘oem_model’: ‘AP-WB2E’, ‘sw_version’: ‘bc 2.6.15-fgl 02/04/20 12:25:04 ID phunt/bf51432’, ‘template_id’: 4904, ‘mac’: ‘a0cc2beczzzz’, ‘unique_hardware_id’: None, ‘hwsig’: ‘mac-a0cc2beczzzz’, ‘lan_ip’: ‘192.168.0.3’, ‘connected_at’: ‘2020-05-15T12:12:59Z’, ‘key’: 123456, ‘lan_enabled’: True, ‘has_properties’: True, ‘product_class’: ‘demo’, ‘connection_status’: ‘Online’, ‘lat’: ‘50.xxx’, ‘lng’: ‘xxx’, ‘locality’: ‘xxxx’, ‘device_type’: ‘Wifi’}}]

  6. We’ll need to take the bold bits and generate config files for each of them:
    python3 /home/pi/opt/fujitsu/query_cli.py --user your_FGLAIR_USERNAME --passwd your_FGLAIR_PASSWORD --app fglair-eu --config configairco1.json --device AC000W00285XXXX
    You need to do the same for each airco unit, only changing the config file name (which will be in the home folder of your RPI - if you’re root then in /root/configairco1.json, if you’re user pi then /home/pi…

  7. Start the service and check - here you need to pair the config file (configairco1.json) with the appropriate IP address.
    python3 /home/pi/opt/fujitsu/hisense.py --config configairco1.json --mqtt_host localhost --ip 192.168.0.2 --port 8888 --device_type fgl_b

This will start the script in the present window - it should look something like this:
192.168.0.2 - - [08/Jun/2020 18:42:30] "POST /local_lan/property/datapoint.json?cmd_id=204&status=200 HTTP/1.1" 200 -

192.168.0.2 - - [08/Jun/2020 18:42:30] "GET /local_lan/commands.json HTTP/1.1" 200 -

For every airco unit/service you run you must give a different port. Ie. for airco2 you should NOT give port 8888, but something different ie. 8887, since that will be the way to address it later.

  1. From another terminal window you can try to query this service:
    curl -ik 'http://localhost:8888/hisense/status'

The result should be like this:
HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.7.3
Date: Mon, 08 Jun 2020 16:57:16 GMT
Content-type: application/json

{"operation_mode": "OFF", "fan_speed": "AUTO", "adjust_temperature": 210, "af_vertical_move_step1": 0, "af_horizontal_move_step1": 0, "economy_mode": "OFF"}
  1. If this works you’re good. In this case I’d suggest to either follow the script writer’s advice to make it a service, or alternatively you can run it manually in the background with ie. screen:
    sudo screen -dmS airco1 python3 /home/pi/opt/fujitsu/hisense.py --config configairco1.json --mqtt_host localhost --ip 192.168.0.2 --port 8888 --device_type fgl_b --mqtt_topic Airco1
    This will start the service running in the background as an app. You can put it in crontab as well for automatic execution upon boot:
    crontab -e
    @reboot sleep 30; sudo screen -dmS airco1 python3 /home/pi/opt/fujitsu/hisense.py --config configairco1.json --mqtt_host localhost --ip 192.168.0.2 --port 8888 --device_type fgl_b --mqtt_topic Airco1

  2. Normally your script should be up and running. It should post to the MQTT topics of your choice:
    By default it’s hisense_ac - in my example it’s Airco1.
    So you can subscribe to the following topics:
    Airco1/operation_mode/status
    Airco1/fan_speed/status
    Airco1/adjust_temperature/status
    The actual values are posted on these topics every 10 minutes automatically as long as your service is running.
    For publishing you use very similar topics, just replace the /status with /command:
    Airco1/operation_mode/command [values: AUTO/COOL/HEAT/DRY/FAN/OFF]
    Airco1/fan_speed/command [values: QUIET/LOW/MEDIUM/HIGH/AUTO]
    Airco1/adjust_temperature/command [values: temperature10 → if you want 24 C, you post 240; if you want 21 C, you post 210]*

You can also try it with curl:
curl -ik 'http://localhost:8888/hisense/command?property=adjust_temperature&value=220'

  1. OpenHAB setup - Items:

    Status: we need one which shows the actual status through incoming MQTT and one which publishes to MQTT for our commands:
    String AircoLivingStatus “Airco Living status [%s]” <ac_unit> (Changesonly, GF_Living) { mqtt=“<[JagoMQTT:Airco1/operation_mode/status:state:default” } // updates every 10 minutes
    Switch AircoLivingStatusCMD “Airco Living” (gPseudo) { mqtt=“>[JagoMQTT:Airco1/operation_mode/command:command:ON:ON], >[JagoMQTT:Airco1/operation_mode/command:command:OFF:OFF]” } // we publish ON/OFF, and that’s ok

    Temperature: we need one which gets the actual set temperature through incoming MQTT (ie. 240), which we convert into proper Celsius/Fahrenheit by making it look like 24.0 and then show on sitemap, and the third one for controlling the temperature from sitemap.
    Number AircoLivingTemperature “Airco Living temperature [%.0f]” (gPseudo) { mqtt=“<[JagoMQTT:Airco1/adjust_temperature/status:state:default” }
    Number AircoLivingTemperatureSELECT “Airco Living temperature [%.0f]” (Changesonly, GF_Living) // Sitemap SELECTION ITEM, auto-updated by AircoLivingTemperature and posts to AircoLivingTemperatureCMD through .rules.
    Number AircoLivingTemperatureCMD “Airco Living temperature [%.0f]” { mqtt=“>[JagoMQTT:Airco1/adjust_temperature/command:command:*:default” }

    Fan speed: we need one to show the actual setting, and one which we select in sitemap and command the airco.
    String AircoLivingFanspeed “Airco Living fan [%s]” { mqtt=“<[JagoMQTT:Airco1/fan_speed/status:state:default” }
    String AircoLivingFanspeedCMD “Airco Living fan [%s]” { mqtt=">[JagoMQTT:Airco1/fan_speed/command:command:*:default] } // Selection item directly: QUIET/LOW/MEDIUM/HIGH/AUTO

  2. OpenHAB - rules:
    rule “Airco Living Fan to Sitemap”
    when Item AircoLivingFanspeed received update
    then
    postUpdate(AircoLivingFanspeedSELECT, AircoLivingFanspeed.state.toString)
    end

    rule “Airco Living Temperature to Sitemap”
    when Item AircoLivingTemperature received update
    then
    var Number receivedtemp=AircoLivingTemperature.state
    var Number temptopost=receivedtemp/10
    postUpdate(AircoLivingTemperatureSELECT, temptopost.intValue)
    end

    rule “Airco Living Fan to Sitemap”
    when Item AircoLivingFanspeed received update
    then
    postUpdate(AircoLivingFanspeedSELECT, AircoLivingFanspeed.state.toString)
    end

    rule “Airco Living Temperature SELECT to Airco”
    when Item AircoLivingTemperatureSELECT received command
    then
    var Number receivedtemp=AircoLivingTemperatureSELECT.state
    var Number temptopost=receivedtemp*10
    postUpdate(AircoLivingTemperatureCMD, temptopost.toString)
    end

  3. OpenHAB - Sitemap:
    Note: I have used “ON” instead of “AUTO” as a label on the sitemap for the StatusCMD.

    Text item=AircoLivingStatus icon=“ac_unit”
    Switch item=AircoLivingStatusCMD label=“Airco Living” icon=“ac_unit” mappings=[AUTO=“ON”, COOL=“COOL”, DRY=“DRY”, FAN=“FAN”, OFF=“OFF”]
    Selection item=AircoLivingTemperatureSELECT label=“Airco Living Temperature” icon=“temperature” mappings=[19=“19”, 20=“20”, 21=“21”, 22=“22”, 23=“23”, 24=“24”, 25=“25”, 26=“26”]
    Selection item=AircoLivingFanspeedSELECT label=“Airco Living Fan” icon=“fan” mappings=[auto=“AUTO”, quiet=“QUIET”, low=“LOW”, medium=“MEDIUM”, high=“HIGH”]

  4. Enjoy:
    image

1 Like