Daikin Heat pump Altherma Integration

I have a Daikin ALTHERMA hybrid + Lan adapter.
You can read and write values via local network ( skipping the Daikin cloud using) websockets as a communication protocol.
Here is a python script to read and write values. Replace the IP with your Lan adapter IP.

from websocket import create_connection
import json, datetime, time, urllib2, urllib
ts = time.time()
timestamp = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
#replace with local LAN adapter  IP
ws = create_connection("ws://192.168.5.109/mca")
# websocket command to read value
ws.send("{\"m2m:rqp\":{\"op\":2,\"to\":\"/[0]/MNAE/1/Sensor/TankTemperature/la\",\"fr\":\"/TarmoTest\",\"rqi\":\"xijub\"}}")
result1 =  json.loads(ws.recv())
ws.send("{\"m2m:rqp\":{\"op\":2,\"to\":\"/[0]/MNAE/1/Operation/TargetTemperature/la\",\"fr\":\"/TarmoTest\",\"rqi\":\"yssyq\"}}")
result2 = json.loads(ws.recv())

print("Received temp '%s'" % result1)
print("Received target '%s'" % result2)

#tankTemperature = result1["m2m:rsp"]["pc"]["m2m:cin"]["con"]
#tankTargetTemperature = result2["m2m:rsp"]["pc"]["m2m:cin"]["con"]

def setValue(ws, item, value):
    ws.send("{\"m2m:rqp\":{\"op\":1,\"to\":\"/[0]/MNAE/"+item+"\",\"fr\":\"/OpenHab\",\"rqi\":\""+"xyz"+"\",\"ty\":4,\"pc\":{\"m2m:cin\":{\"con\":"+value+",\"cnf\":\"text/plain:0\"}}}}")
    result1 =  json.loads(ws.recv())
    print("Response was: %s" % result1)
    value = result1["m2m:rsp"]["rsc"]
    if (value==2001):
        print("Success")
    return value

# set target temperature to desired one 
setValue(ws, "1/Operation/TargetTemperature", "24")

ws.close()

I’ve taken the initial code from the openHab forum. I plan to write an integration for HA in the future (a couple of months), including controlling zones / thermic actuators / pumps for underfloor heating. For now, I’m busy with setting up other automations as I’ve just moved in.

3 Likes