I have amended the script into 2 new variants to provide the exact same level of control and more as the daikin app, specifically for the R32 ranges Ururu Sarara (FTXZxxN) and Daikin Comfort or Bluevolution (FTXMxxM) variants. Note that for all types of units, I have added flow direction control to the LUA.
We will start with the FTXM25M, which has additional control options for "advanced modes", being the Powerfull- and Econo mode as well as the flash streamer.
Note they cannot be combined as discussed earlier (did not know how to do that in LUA, perhaps a real dev can help). For now I can live without the streamer when econo or powerfull is activated. I intend to automate the use of econo (when my car is charging at 11KW) and set powerfull when entering a room where climate was disabled before, e.g. after power off and dT is larger then say 3 degrees C).
First we add a selector switch type dummy device for flow direction control, name it "DaikinFdir" and set the levels als pictured below:
Next we add a selector switch type dummy device for advanced options control, name it "DaikinAdv" and set the appropriate levels:
Now we paste the below script into the event editor (note you need to set LUA script type to "device", or you'll get an eval error line in the log). If you have multiple units like myself, you can add a pretext to the device names, e.g. Office_DaikinMode, Living_DaikinMode etc. and repeat for other units. Use find/replace to amend the scripts accordingly.
Code: Select all
commandArray = {}
if (devicechanged['DaikinMode']) or (devicechanged['DaikinSetTarget']) or (devicechanged['DaikinFrate']) or (devicechanged['DaikinFdir']) or (devicechanged['DaikinAdv']) then
daikin_ip = '10.0.1.xxx'
stemp = otherdevices_svalues['DaikinSetTarget']
-- Checking if device is off
if (otherdevices['DaikinMode'] == 'Off') then
pow = 0
mode = 0
else
-- Set the operation mode
pow = 1
if (otherdevices['DaikinMode'] == 'Heat') then
mode = 4
elseif (otherdevices['DaikinMode'] == 'Cool') then
mode = 3
elseif (otherdevices['DaikinMode'] == 'Auto') then
mode = 0
elseif (otherdevices['DaikinMode'] == 'Dry') then
mode = 2
end
end
-- Set airflow rate
if (otherdevices['DaikinFrate'] == 'Auto') then
f_rate = 'A'
elseif (otherdevices['DaikinFrate'] == 'Silent') then
f_rate = 'B'
elseif (otherdevices['DaikinFrate'] == 'L1') then
f_rate = '3'
elseif (otherdevices['DaikinFrate'] == 'L2') then
f_rate = '4'
elseif (otherdevices['DaikinFrate'] == 'L3') then
f_rate = '5'
elseif (otherdevices['DaikinFrate'] == 'L4') then
f_rate = '6'
elseif (otherdevices['DaikinFrate'] == 'L5') then
f_rate = '7'
end
-- Set airflow direction
if (otherdevices['DaikinFdir'] == 'Off') then
f_dir = 0
elseif (otherdevices['DaikinFdir'] == 'Vertical') then
f_dir = 1
elseif (otherdevices['DaikinFdir'] == 'Horizontal') then
f_dir = 2
elseif (otherdevices['DaikinFdir'] == '3D') then
f_dir = 3
end
-- Set advanced options
if (otherdevices['DaikinAdv'] == 'Off') then
adv = 0
elseif (otherdevices['DaikinAdv'] == 'Powerfull') then
adv = 2
elseif (otherdevices['DaikinAdv'] == 'Econo') then
adv = 12
elseif (otherdevices['DaikinAdv'] == 'Clean') then
adv = 13
end
-- Execute command using curl
cmd = 'curl "http://' .. daikin_ip .. '/aircon/set_control_info?pow='..pow..'&mode='..mode..'&stemp='..stemp..'&shum=0&f_rate='..f_rate..'&f_dir='..f_dir..'&adv='..adv..'"'
os.execute(cmd)
end
return commandArray
And now we will do the same for the Ururu Sarara variants which do not support the advanced modes, but does support humidity control. Let's start again by creating again the selector switch for the airflow direction and call it "DaikinFdir":
And create another selector switch for the humidity modes called "DaikinHumid" (note "Zwitsal Mode" seems not to be supported through the wifi controller):
Now use the event editor to create another LUA script, set script type to device and paste the below code:
Code: Select all
commandArray = {}
if (devicechanged['DaikinMode']) or (devicechanged['DaikinSetTarget']) or (devicechanged['DaikinFrate']) or (devicechanged['DaikinFdir']) or (devicechanged['DaikinHumid']) then
daikin_ip = '10.0.1.xxx'
stemp = otherdevices_svalues['DaikinSetTarget']
-- Checking if device is off
if (otherdevices['DaikinMode'] == 'Off') then
pow = 0
mode = 0
else
-- Set the operation mode
pow = 1
if (otherdevices['DaikinMode'] == 'Heat') then
mode = 4
elseif (otherdevices['DaikinMode'] == 'Cool') then
mode = 3
elseif (otherdevices['DaikinMode'] == 'Auto') then
mode = 0
elseif (otherdevices['DaikinMode'] == 'Dry') then
mode = 2
end
end
-- Set Airflow rate
if (otherdevices['DaikinFrate'] == 'Auto') then
f_rate = 'A'
elseif (otherdevices['DaikinFrate'] == 'Silent') then
f_rate = 'B'
elseif (otherdevices['DaikinFrate'] == 'L1') then
f_rate = '3'
elseif (otherdevices['DaikinFrate'] == 'L2') then
f_rate = '4'
elseif (otherdevices['DaikinFrate'] == 'L3') then
f_rate = '5'
elseif (otherdevices['DaikinFrate'] == 'L4') then
f_rate = '6'
elseif (otherdevices['DaikinFrate'] == 'L5') then
f_rate = '7'
end
-- Set Airflow direction
if (otherdevices['DaikinFdir'] == 'Off') then
f_dir = 0
elseif (otherdevices['DaikinFdir'] == 'Vertical') then
f_dir = 1
elseif (otherdevices['DaikinFdir'] == 'Horizontal') then
f_dir = 2
elseif (otherdevices['DaikinFdir'] == '3D') then
f_dir = 3
end
-- Set Ururu Sarara Humidity
if (otherdevices['DaikinHumid'] == 'Off') then
shum = '0'
elseif (otherdevices['DaikinHumid'] == 'Low') then
shum = '40'
elseif (otherdevices['DaikinHumid'] == 'Medium') then
shum = '45'
elseif (otherdevices['DaikinHumid'] == 'High') then
shum = '50'
elseif (otherdevices['DaikinHumid'] == 'Continue') then
shum = 'CONTINUE'
end
-- Execute command with curl
cmd = 'curl "http://' .. daikin_ip .. '/aircon/set_control_info?pow='..pow..'&mode='..mode..'&stemp='..stemp..'&shum='..shum..'&f_rate='..f_rate..'&f_dir='..f_dir..'"'
os.execute(cmd)
end
return commandArray
Now you're all set, works like a charm for me now!