You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @manup, after many more tests, I haven't found a solution to get rid of this error message in Home Assistant. Perhaps it should be fixed in Phoscon, since it's also present in the browser.
Out of interest I put it into git diff. To be honest I have no clue what the changes are doing since the files were completely reformatted and modified by GPT.
Sorry, I was a bit hasty there, and the changes GPT suggested wouldn't have made much sense. Now I'm pretty sure it's Home Assistant. So, have a nice day.
@manup, I think the cause of the POST /api/ HTTP/1.1 403 error is pollGateways() in pwa/js/login/helper-functions.js. It contains the following expression:
According to GPT, a login attempt is made every 5 seconds with the username "delight" which then causes this error. Removing these lines should fix it.
I saw that this bug will be fixed with the Phoscon App v2.0.6 so just wait and see.
Hi, I'm trying to wrap my head around this. The login JS code isn't pretty, from what I remember the prope from above is to detect if the gateway still has the legacy defaut password "delight" in use and move the user to the UI to set a unique password.
However this shouldn't be done infinito. I'll try to figure out a fix, hopefully this can be done with my small VM HA test setup for debugging.
Uff that was a deep dive. I think to have found what was going wrong and added a small fix in scanner.js.
constGateway=Backbone.Model.extend({url: function(){constip=this.get('ip');constport=':'+this.get('port')||'';leturl='//'+ip+port+'/api';// handle HA ingress extra path hereletpath=location.pathname;// /api/hassio_ingress/IlTGHq7BYxfxXQDMf9F_r9ADSQaZuysfh3nr-SAyNFQ/pwa/login2.html?1756241884538"path=path.slice(0,path.indexOf('/pwa'));// /api/hassio_ingress/IlTGHq7BYxfxXQDMf9F_r9ADSQaZuysfh3nr-SAyNFQif(path.length!==0&&location.hostname===ip&&location.port===this.get('port')){url='//'+ip+port+path+'/api';}if(this.has('apikey'))url+='/'+this.get('apikey');elseurl+='/config';returnurl;},sync: function(method,model,options){returnBackbone.sync(method,model,options);}});
The problem was that ingress does add a small path to the URL like /api/hassio_ingress/IlTGHq7BYxfxXQDMf9F_r9ADSQaZuysfh3nr-SAyNFQ and the code on the login page only used the normal host:port combo and then appended the deCONZ API path.
The changes above will the extra path in the URL in cases like Ingress. I could only verify this in a live system for now within the browser debugger by setting a breakpoint on the url method and hard rewrite the variable. In the test the call then returns proper 200 instead 401 error code.
Activity
manup commentedon Aug 12, 2025
Out of interest I put it into git diff. To be honest I have no clue what the changes are doing since the files were completely reformatted and modified by GPT.
mattreim commentedon Aug 12, 2025
Sorry, I was a bit hasty there, and the changes GPT suggested wouldn't have made much sense. Now I'm pretty sure it's Home Assistant. So, have a nice day.
mattreim commentedon Aug 22, 2025
@manup, I think the cause of the
POST /api/ HTTP/1.1 403error ispollGateways()inpwa/js/login/helper-functions.js. It contains the following expression:According to GPT, a login attempt is made every 5 seconds with the username "delight" which then causes this error. Removing these lines should fix it.
I saw that this bug will be fixed with the Phoscon App v2.0.6 so just wait and see.
manup commentedon Aug 26, 2025
Hi, I'm trying to wrap my head around this. The login JS code isn't pretty, from what I remember the prope from above is to detect if the gateway still has the legacy defaut password "delight" in use and move the user to the UI to set a unique password.
However this shouldn't be done infinito. I'll try to figure out a fix, hopefully this can be done with my small VM HA test setup for debugging.
mattreim commentedon Aug 26, 2025
Thank you, it would be great if this error was fixed and maybe Phoscon also has an icon.
manup commentedon Aug 26, 2025
Uff that was a deep dive. I think to have found what was going wrong and added a small fix in
scanner.js.The problem was that ingress does add a small path to the URL like
/api/hassio_ingress/IlTGHq7BYxfxXQDMf9F_r9ADSQaZuysfh3nr-SAyNFQand the code on the login page only used the normalhost:portcombo and then appended the deCONZ API path.The changes above will the extra path in the URL in cases like Ingress. I could only verify this in a live system for now within the browser debugger by setting a breakpoint on the
urlmethod and hard rewrite the variable. In the test the call then returns proper 200 instead 401 error code.mattreim commentedon Aug 27, 2025
You've made deCONZ/Phoscon a whole lot better and fixed a pretty old bug in HA. You're great, thank you very much.
bcutter commentedon Sep 29, 2025
And now it finally is available in a stable release. Curios to see how long it will take until the HA deCONZ addon will receive the 2.31.2 update.
mattreim commentedon Sep 30, 2025
Hi @manup, I made two more changes here.
devices-plug.htmlthe unit of consumption changed from wH to Whphoscon_app_2025-09-30.zip