Page 1 of 1

Habridge Error - undefined with status: Server Error - 500

Posted: Thursday 13 February 2025 13:41
by marcelo
Hello everyone,

Version: 2024.7 /(build16461)
Platform: Raspberry Domoticz
Plugin/Hardware: Ha-Bridge Version 5.4.1RC1

Description:

After the last beta update, no new devices can be queried in the HA Bridge.

When you click on the Domoticz Devices button, the following message appears:
GET DOMOTICZ DEVICES ERROR: undefined with status: Server Error - 500


The following appears in the HA Bridge logs:

02-13-2025 13:25:23.057 DEBUG doHttpRequest with url <<<http://192.168.xx.xx:8080/json.htm?type ... &used=true>>>, verb: null, contentType: null, body <<<null>>> com.bwssystems.HABridge.plugins.http.HTTPHandler

02-13-2025 13:25:23.057 DEBUG header index 0 name: <<<Authorization>>>, value: <<<Basic bWFyY2VsOm9iZWxpWCExODE0>>> com.bwssystems.HABridge.plugins.http.HTTPHandler

02-13-2025 13:25:23.057 DEBUG Making outbound call in doHttpRequest: <<<GET http://192.168.xx.xx:8080/json.htm?type ... &used=true HTTP/1.1>>> com.bwssystems.HABridge.plugins.http.HTTPHandler

02-13-2025 13:25:23.064 DEBUG GET execute (0) on URL responded: 404 com.bwssystems.HABridge.plugins.http.HTTPHandler

02-13-2025 13:25:23.065 WARN HTTP response code was not an expected successful response of between 200 - 299, the code was: HTTP/1.1 404 Not Found with the content of <<<>>> com.bwssystems.HABridge.plugins.http.HTTPHandler

02-13-2025 13:25:23.065 DEBUG GET devices DomoticzApiResponse - data: com.bwssystems.HABridge.plugins.domoticz.DomoticzHandler


In the previous stable version, it worked without errors.
The existing devices in the HABRIDGE are still there and work. It's just that no new devices are found and displayed.

I'm asking for help.

Best greetings, Marcel

Re: Habridge Error - undefined with status: Server Error - 500

Posted: Thursday 13 February 2025 20:22
by waltervl
So this is probably an issue in ha- bridge. The more than a year announced deprecated Domoticz API calls are now really removed and not working in Domoticz. Please inform the ha-bridge author to change the code and use the correct API calls.
See also the Domoticz wiki to see what has changed. https://wiki.domoticz.com/Domoticz_API/ ... and_newer)

Re: Habridge Error - undefined with status: Server Error - 500

Posted: Tuesday 01 April 2025 21:42
by Gingerpale
Anybody succeeded in fixing it?
I found out when downloading and inspecting https://github.com/bwssytems/ha-bridge/ ... -5.4.1.jar you can find that com\bwssystems\HABridge\plugins\domoticz\DomoticzHandler.class contains the depreciated

Code: Select all

/json.htm?type=
which forms e.g.

Code: Select all

 /json.htm?type=devices
. This should be changed to /json.htm?type=command&param=getdevices


See also the src at: https://github.com/bwssytems/ha-bridge/ ... ndler.java

Original java code:

Code: Select all

public class DomoticzHandler {
    private static final Logger log = LoggerFactory.getLogger(DomoticzHandler.class);
    private static final String GET_REQUEST = "/json.htm?type=";
    private static final String DEVICES_TYPE = "devices";
    private static final String SCENES_TYPE = "scenes";
    private static final String FILTER_USED = "&used=true";
    private NamedIP domoticzAddress;
Proposed updated java code:

Code: Select all

public class DomoticzHandler {
    private static final Logger log = LoggerFactory.getLogger(DomoticzHandler.class);
    private static final String GET_REQUEST = "json.htm?type=command&param=";
    private static final String DEVICES_TYPE = "getdevices";
    private static final String SCENES_TYPE = "getscenes";
    private static final String FILTER_USED = "&used=true";
    private NamedIP domoticzAddress;
Anybody can help to update the code so we get the correct DomoticzHandler.class compiled into .jar so we can try it out?

Re: Habridge Error - undefined with status: Server Error - 500

Posted: Monday 07 April 2025 19:28
by Gingerpale
As I got no response here, I figured out how to compile (using maven) a new ha-bridge .jar based on the source code of bwssystems with my above mentioned changes implemented and now everything works again!