Daikin HVAC Thermostat Plugin

Posted on
Mon Jun 18, 2018 2:45 pm
Albatros offline
Posts: 132
Joined: Feb 07, 2015

Daikin HVAC Thermostat Plugin

I have 4 Daikin FTXG50LW Emura Air Heatpumps. I use them for cooling and heating. I am using in Indigo a python script see below and the Smart Devices Thermostat Plugin but this doesn't work good. Unfortunately the Smart Devices Thermostat has never been finished and only heating is working and not cooling. The last update is from 2014.

I am not a programmer and with some effort I can now control it with some python script. Is there anybody who could maybe finish the Smart Devices pluging or even better based upon this plugin or the Indigo Tado Thermostat Pluging create a plugin for Daikin devices. The Api is known and their are a few examples from domotics and homey. For me setting device on/of, set temperature, mode (cooling/heating) would be fine.

Indigo Smart Devices Plugin: viewforum.php?f=154
Indigo Tado Plugin: viewtopic.php?f=196&t=16181


    Daikin API: https://github.com/ael-code/daikin-control
      Domoticz Plugin https://www.domoticz.com/wiki/Daikin_wifi
        Homey App https://github.com/PeterEIER/nl.climate.daikin


        --------------------------------------------------
        The python script I am using:

        import requests

        pow = indigo.variables[1769655104].value # "pow"
        mode = indigo.variables[1741863173].value # "mode"
        stemp = indigo.variables[839605723].value # "stemp"
        f_rate = indigo.variables[1619577686].value # "f_rate"

        url = "http://192.168.X.XX/aircon/set_control_info?pow=" + pow +"&mode=" + mode + "&stemp=" + stemp + "&shum=0&f_rate=" + f_rate + "&f_dir=0"
        requests.get(url)
        --------------------------------------------------

        Posted on
        Mon Jun 18, 2018 3:07 pm
        mat offline
        Posts: 769
        Joined: Nov 25, 2010
        Location: Cambridgeshire - UK

        Re: Daikin HVAC Thermostat Plugin

        Lots of edits as tired, but hope this helps....(shout if I've not explained it too well as had about 3 hours sleep.

        Not sure if this is any help (and its apple-script) but i use this with my dakin. Just create 4 variables, and run the following applescript when any of the variables changes - you can then control the variables from a control page - This is one of two outstanding plugins I need to write, but its been 18 months so far and not enough time.


        Copy the following, or use your python in an action group. call it say "change AC settings".

        Then set up four triggers for your 4 variables - trigger on a variable change, and your "action" is to run the action group "change AC settings"

        Set up a control page so that you can set the four variables separately. ie press button "cool mode" and the variable "mode" is changed to integer "3". The trigger will then run either your python or my applescript and will set the ac.

        Repeat for the other 4 modes, 3 fan direction and temperature you want, each time running the same action group.

        You can do the same script to switch it off with "pow" in the url = 0

        Any other changes to the variables will switch the unit on.





        Code: Select all
        set mode to value of variable "Gymaircon_mode"
        set temp to value of variable "Gymaircon_temp"
        set fan to value of variable "Gymaircon_fandir"
        set fanspeed to value of variable "Gymaircon_fan"

        set theURL to "http://xxx.xxx.xxx.xxx/aircon/set_control_info?pow=1&mode=" & mode & "&stemp=" & temp & "&shum=0&f_rate=" & fanspeed & "&f_dir=" & fan


        do shell script "curl " & quoted form of theURL




        Mode 2 is dehumidify
        Mode 3 is cool
        Mode 4 is heat
        Mode 6 is fan
        Mode 0-1-7 is auto

        Fan speed is 3 to 7 (there may be lower but I don't use them

        Fan direction is
        1 = horizontal
        2= vertical
        3= both directions

        pow in the url is 0 for off and 1 for on

        The following gets the states (python). I have this in a schedule that runs every minute and updates a variable to tell me if the AC is on or off. You will need to create a variable referenced at the end of the script and change the id:

        Code: Select all
        #get data in HTMl Response from Daikin HVAC

        import urllib2

        urlReturned = urllib2.urlopen('http://xxx.xxx.xxx.xxx/aircon/get_control_info')

        data_getStatus = urlReturned.read()


        #transform HTMl Response in JSON format
        # Split the result into bits
        split_response = data_getStatus.split(',')


        # Split the bits into variable/value pairs
        new_list = []
        for element in split_response:
           new_list.append(element.split('='))


        # Convert the variable/value pairs into something json-y
        new_dict = {}
        for element in new_list:
           new_dict[element[0]] = element[1]



        #get new json string variables to python variables

        pow=str(new_dict['pow'])



        #update indigo variables
        indigo.variable.updateValue(493056778, ((pow)))


        This is probably very similar to the above, but gets the current inside and outside temps(python. Put this in a schedule and run it every few minutes). You will need to create two variables referenced at the bottom of the script to hold the two temperatures, and amend the variable id's at the bottom of the script:

        Code: Select all
        #get data in HTMl Response from Daikin HVAC

        import urllib2

        urlReturned = urllib2.urlopen('http://xxx.xxx.xxx.xxx/aircon/get_sensor_info')

        data_getStatus = urlReturned.read()


        #transform HTMl Response in JSON format
        # Split the result into bits
        split_response = data_getStatus.split(',')


        # Split the bits into variable/value pairs
        new_list = []
        for element in split_response:
           new_list.append(element.split('='))


        # Convert the variable/value pairs into something json-y
        new_dict = {}
        for element in new_list:
           new_dict[element[0]] = element[1]



        #get new json string variables to python variables

        htemp=str(new_dict['htemp'])
        otemp=str(new_dict['otemp'])


        #update indigo variables
        indigo.variable.updateValue(75127650, ((htemp)))
        indigo.variable.updateValue(194583233, ((otemp)))

        Late 2018 mini 10.14

        Posted on
        Tue Jun 19, 2018 2:45 pm
        Albatros offline
        Posts: 132
        Joined: Feb 07, 2015

        Re: Daikin HVAC Thermostat Plugin

        Thanks for you post. Would have been nice to have this info a time ago. I have now figured it out with python script. Similar to what you have done. I am not using control pages but the smart devices thermostat and setting a heatpoint from a schedule. Than the thermostat decides based upon room temperature measurement what to do

        The nice thing of a Daikin plugin would be the thermostat functions, Which would run automatically base upon the temperature set. So if anybody could take the Smart devices plugin or the Tado Plugin and create a daikin.... :lol: It want to pay money for it...

        And having a Daikin thermostat device in indigo would make it to be controlled via the homekit bridge in the Home App on Iphone and Ipad. And of course Siri...

        Posted on
        Tue Jun 19, 2018 4:15 pm
        mat offline
        Posts: 769
        Joined: Nov 25, 2010
        Location: Cambridgeshire - UK

        Re: Daikin HVAC Thermostat Plugin

        Why not give it a go yourself. You have almost all the code.

        There is a model plugin and an explanation on what to do in the wiki.

        It would be a really good place to start as you have the code, you just need to create the plugin wrapper.

        Late 2018 mini 10.14

        Posted on
        Sat Jan 23, 2021 9:47 pm
        agame offline
        Posts: 514
        Joined: Jul 13, 2017
        Location: Melbourne, Australia

        Re: Daikin HVAC Thermostat Plugin

        very handy code snippets, saved a lot of time setting up Daikin with BRP072A42 wireless LAN adaptor.
        Even in the absence of a plugin for Daikin (which would be great), it still didn't take long at all to get things up and running.

        Posted on
        Thu May 27, 2021 12:38 am
        neilk offline
        Posts: 713
        Joined: Jul 13, 2015
        Location: Reading, UK

        Re: Daikin HVAC Thermostat Plugin

        Are you are still using this and in need of a plugin. If so watch this space, I am about 70% done with a plugin just getting my head around the way the indigo thermostat device works and the Daikin approach and building the control actions. Let me know if any specific requests, I also hope to add the energy reporting capabilities to get current and cumulative energy usage for totals, heating and cooling.

        Neil

        Posted on
        Thu May 27, 2021 1:13 am
        DomoPat offline
        User avatar
        Posts: 210
        Joined: Jul 17, 2010
        Location: Toulouse, France

        Re: Daikin HVAC Thermostat Plugin

        I am interested in a plugin too ! :D

        Posted on
        Sat May 29, 2021 6:55 am
        neilk offline
        Posts: 713
        Joined: Jul 13, 2015
        Location: Reading, UK

        Re: Daikin HVAC Thermostat Plugin

        Initial test version of the plugin is not available. More information https://forums.indigodomo.com/viewtopic.php?f=358&t=25260

        Let me know how you get on, most of the heavy lifting was already done in this thread.

        Posted on
        Mon May 31, 2021 1:42 am
        DomoPat offline
        User avatar
        Posts: 210
        Joined: Jul 17, 2010
        Location: Toulouse, France

        Re: Daikin HVAC Thermostat Plugin

        Dowloaded, installed, and it works !

        I have three Daikin units from 2007, but I installed WIFI interfaces some years ago. With the plugin I can now turn on, turn off, change set points, and change heat or cool mode on all of them, great ! did not make schedules or triggers yet, I see they are available, this will be useful.

        I did a quick test, I will let the plugin run all day now and check it deeper later today, but it already looks ready to work. Saw a few:
        "Daikin Wifi Controller Unknown/Other Error getting /aircon/get_sensor_info from Daikin Unit Clim Chambre V"
        but it does not happen on every data poll, and not on the same unit.

        Thank you for this work, and let me know how I can help/test more !

        Patrick

        Posted on
        Mon May 31, 2021 3:30 am
        neilk offline
        Posts: 713
        Joined: Jul 13, 2015
        Location: Reading, UK

        Re: Daikin HVAC Thermostat Plugin

        Patrick,
        Thanks for the feedback and great news it works. I have had it running on my main machine for a couple of days now and I will check my logs as welll. At present I don’t bother doing a retry if the request fails as it will be repeated in the next cycle but I can take a look at making that more robust and maybe the timeout is a little short. I will keep you posted.

        As for testing the main things are your use cases and that they work for you. I did find a couple of gotchas as you swap modes from Dry or Fan during testing and think I have covered most but I am sure some will be missed and I only have one device and firmware version. I haven’t tested every combination of actions and modes etc.

        I am working on the special operation modes and capturing the cumulative energy usage for the next release and I will add any tweaks into that including making the timeout configurable.

        Thanks,
        Neil

        Posted on
        Mon May 31, 2021 4:20 am
        neilk offline
        Posts: 713
        Joined: Jul 13, 2015
        Location: Reading, UK

        Re: Daikin HVAC Thermostat Plugin

        Patrick,

        I suspect this is indeed a timeout issue, I found some of the same in my logs so I have increased the default, and also made it a configurable plugin option in case we need to tweak further. I also spotted a bug when a timeout for the sensor info wasn't correctly trapped. Version 0.03 is now posted https://forums.indigodomo.com/viewtopic.php?p=203002#p203002

        Thanks again for the help. We should probably move the discussion over the the plugin subfolder now as well.

        Neil

        Page 1 of 1

        Who is online

        Users browsing this forum: No registered users and 1 guest