Skip to content

Instantly share code, notes, and snippets.

@maxmacstn
Last active April 23, 2024 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxmacstn/dd6bdd1bbb0d34435badf2838293997a to your computer and use it in GitHub Desktop.
Save maxmacstn/dd6bdd1bbb0d34435badf2838293997a to your computer and use it in GitHub Desktop.
WiFikit Serial config for Homebridge
// 1. connect the module to Wi-Fi and MQTT
// 2. Install mqttthing add-on into HomeBridge.
// 3. Add the following section to mqttthing JSON configuration (inside accessories array)
// 4. Change mqtt url, username, password and YOUR_DEVICE_FRIENDLY_NAME to match your setup.
{
"accessory": "mqttthing",
"type": "custom",
"url": "<192.168.1.XXX:1883>",
"username": "<username for MQTT (optional)>",
"password": "<password for MQTT (optional)>",
"name": "Office Daikin AC",
"caption": "Daikin A/C",
"manufacturer": "Daikin",
"model": "WiFikit Serial",
"services": [
{
"type": "heaterCooler",
"name": "Office Daikin AC",
"topics": {
"getOnline": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/availability",
"setActive": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/mode/set",
"apply": "return message? 'cool':'off';"
},
"getActive": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "return JSON.parse(message).mode !== 'off'? true:false;"
},
"getCurrentHeaterCoolerState": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "action =JSON.parse(message).action; if ( action == 'heating' || action =='fan'){return 'HEAT';}else if (action == 'cooling'){return 'COOL';} else if (action == 'idle'){return 'IDLE';} else {return 'OFF';}"
},
"setTargetHeaterCoolerState": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/mode/set",
"apply": "if (message == 'OFF'){return 'off';} else if (message == 'HEAT'){return 'fan_only';} else if (message == 'COOL'){return 'cool';} else if (message == 'AUTO'){return 'heat_cool';}"
},
"getTargetHeaterCoolerState": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "mode =JSON.parse(message).mode; if ( action == 'heat' || action =='fan_only'){return 'HEAT';}else{return 'COOL';}"
},
"getCurrentTemperature": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "return JSON.parse(message).roomTemperature;"
},
"setCoolingThresholdTemperature": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/temp/set",
"getCoolingThresholdTemperature": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "return JSON.parse(message).temperature"
},
"setHeatingThresholdTemperature": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/temp/set",
"getHeatingThresholdTemperature": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "return JSON.parse(message).temperature"
},
"getSwingMode": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "return JSON.parse(message).vane === 'SWING'? 'ENABLED': 'DISABLED'"
},
"setSwingMode": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/vane/set",
"apply": "return message? 'SWING':'3' "
},
"setRotationSpeed": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/fan/set",
"apply": "if (Math.round(message/25)<1) return 'AUTO'; else return Math.round(message/25);"
},
"getRotationSpeed": {
"topic": "daikin2mqtt/YOUR_DEVICE_FRIENDLY_NAME/state",
"apply": "if (isNaN(JSON.parse(message).fan)==true) return 0; else return (JSON.parse(message).fan)*25;"
}
},
"onlineValue": "online",
"offlineValue": "offline",
"minTemperature": 16,
"maxTemperature": 30,
"temperatureDisplayUnitsValues": [
"CELSIUS"
],
"currentHeaterCoolerValues": [
"OFF",
"IDLE",
"HEATING",
"COOLING"
],
"swingModeValues": [
"DISABLED",
"ENABLED"
],
"restrictHeaterCoolerState": [
1,
2
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment