Skip to content

Instantly share code, notes, and snippets.

@samthor
Last active December 9, 2022 19:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samthor/d788bd880f158a126f796e6fb0306183 to your computer and use it in GitHub Desktop.
Save samthor/d788bd880f158a126f796e6fb0306183 to your computer and use it in GitHub Desktop.
Update WiFi on Daikin BRP069A42
// If the device is already on a network and you need to change it, you can load:
// http://<device_ip>/common/get_wifi_setting
// It'll give you a result like... ret=OK,ssid=OldSSIDHere,security=mixed,key=%6e%65%76%65%72%67%6f%6e%6e%61%67%69%76%65%79%6f%75%75%70
// To update the same data, open that page and in the console, run this (modify as needed):
const ssid = 'NewSSIDHere';
const key = 'nevergonnagiveyouup';
const encoded = Array.from(key).map((c) => '%' + c.charCodeAt(0).toString(16).padStart(2, '0')).join('');
const body = `ssid=${ssid}&security=mixed&key=${encoded}`;
const headers = new Headers();
headers.set('Content-Type', 'application/x-www-form-urlencoded');
const args = {method: 'POST', body, headers};
// nb. Commented out so you don't clobber settings
// const r = await fetch('/common/set_wifi_setting', args);
// const text = await r.text();
// console.info(text);
// Once you're done, open up http://<device_ip>/common/reboot (as a GET is fine) and the device will reboot and join the new WiFi.
@gjdv
Copy link

gjdv commented Dec 9, 2022

Thanks for sharing. Inspired by your code, I created another gist, in Python to avoid cross domain referencing issues in the browser. Also, I found out that set_wifi_setting required a GET action rather than POST on my FTXA device.
Perhaps my recent additions to the following repository are also of your interest: https://github.com/gjdv/python-daikinapi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment