Open ClintEastwood1337 opened 15 hours ago
Hi. I cannot check this at the moment, but I assume, the slot field is not the problem (it is just ignored).
Instead, I think the error stems from the device missing a name (it is null in the response). I know there are two places to set a device name in the Shelly App, and there is also a setting to keep them synchronized. I never understood why there are two places but probably you can fix it by setting the name in both (and/or toggling the sync option).
We’ve made some progress. I have equated the names and also tried out the sync The "GetDeviceInfo" call is now working; however, I still have an issue with the "GetStatus" call.
Here is an excerpt from the debug log:
2024-11-24T18:09:32.618Z INFO 1 --- [ main] c.d.s.e.ShellyExporterApplicationKt : Started ShellyExporterApplicationKt in 18.838 seconds (process running for 21.708)
2024-11-24T18:09:32.628Z DEBUG 1 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2024-11-24T18:09:32.647Z DEBUG 1 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2024-11-24T18:09:32.650Z INFO 1 --- [ scheduling-1] c.d.s.e.d.ShellyGen2DeviceRegistry : Updating device addresses.
2024-11-24T18:09:32.780Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : HTTP GET http://192.168.178.23/rpc/Shelly.GetDeviceInfo
2024-11-24T18:09:33.271Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Accept=[application/json, application/*+json]
2024-11-24T18:09:33.474Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Response 200 OK
2024-11-24T18:09:33.482Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Reading to [click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyDeviceInfo]
2024-11-24T18:09:33.629Z INFO 1 --- [ scheduling-1] c.d.s.e.d.ShellyGen2DeviceRegistry : Added 1, removed 0, current amount: 1 devices.
2024-11-24T18:09:33.658Z INFO 1 --- [ scheduling-1] c.d.s.e.metrics.ShellyGen2Metrics : Registering ShellyDevice(mac=78EE4CC93840, address=192.168.178.23, name=Plus1PM, type=SNSW-001P16EU, firmwareVersion=20241011-114445/1.4.4-g6d2a586).
2024-11-24T18:09:33.745Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : HTTP GET http://192.168.178.23/rpc/Shelly.GetStatus
2024-11-24T18:09:35.268Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Accept=[application/json, application/*+json]
2024-11-24T18:09:35.351Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Response 200 OK
2024-11-24T18:09:35.353Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Reading to [click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyStatus]
2024-11-24T18:09:35.376Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : HTTP GET http://192.168.178.23/rpc/Shelly.GetStatus
2024-11-24T18:09:35.378Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Accept=[application/json, application/*+json]
2024-11-24T18:09:35.441Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Response 200 OK
2024-11-24T18:09:35.443Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Reading to [click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyStatus]
2024-11-24T18:09:35.453Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : HTTP GET http://192.168.178.23/rpc/Shelly.GetStatus
2024-11-24T18:09:35.455Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Accept=[application/json, application/*+json]
2024-11-24T18:09:35.525Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Response 200 OK
2024-11-24T18:09:35.526Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Reading to [click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyStatus]
2024-11-24T18:09:35.534Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : HTTP GET http://192.168.178.23/rpc/Shelly.GetStatus
2024-11-24T18:09:35.537Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Accept=[application/json, application/*+json]
2024-11-24T18:09:35.597Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Response 200 OK
2024-11-24T18:09:35.598Z DEBUG 1 --- [ scheduling-1] o.s.web.client.RestTemplate : Reading to [click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyStatus]
2024-11-24T18:09:35.609Z WARN 1 --- [ scheduling-1] c.d.s.exporter.client.ShellyGen2Client : GET http://192.168.178.23/rpc/Shelly.GetStatus: HTTP Request failure: Error while extracting response for type [class click.dobel.shelly.exporter.client.api.gen2.Gen2ShellyStatus] and content type [application/json]
2024-11-24T18:09:35.613Z INFO 1 --- [ scheduling-1] c.d.s.e.d.ShellyGen1DeviceRegistry : Updating device addresses.
2024-11-24T18:09:35.614Z INFO 1 --- [ scheduling-1] c.d.s.e.d.ShellyGen1DeviceRegistry : Added 0, removed 0, current amount: 0 devices.
When accessing http://192.168.178.23/rpc/Shelly.GetStatus, I receive the following response:
{
"ble": {
},
"cloud": {
"connected": true
},
"input:0": {
"id": 0,
"state": false
},
"mqtt": {
"connected": false
},
"switch:0": {
"id": 0,
"source": "init",
"output": false,
"apower": 0,
"voltage": 238.1,
"current": 0,
"aenergy": {
"total": 0,
"by_minute": [0, 0, 0],
"minute_ts": 1732472940
},
"temperature": {
"tC": 40.1,
"tF": 104.2
}
},
"sys": {
"mac": "78EE4CC93840",
"restart_required": false,
"time": "19:29",
"unixtime": 1732472984,
"uptime": 1369,
"ram_size": 253572,
"ram_free": 132860,
"fs_size": 393216,
"fs_free": 106496,
"cfg_rev": 21,
"kvs_rev": 1,
"schedule_rev": 5,
"webhook_rev": 0,
"available_updates": {
},
"reset_reason": 1
},
"wifi": {
"sta_ip": "192.168.178.23",
"status": "got ip",
"ssid": "#####",
"rssi": -29
},
"ws": {
"connected": false
}
}
One more piece of information: I am currently operating the Shelly without a consumer, and have only connected it for set-up purposes
Hi easimon, when interacting with a Shelly Plus1PM device, the current firmware introduces a new slot field in the response from http://192.168.178.23/rpc/Shelly.GetDeviceInfo.
However, this field is not yet included in the Gen2ShellyDeviceInfo data class, causing deserialization issues.
The data class currently defined in
src/main/kotlin/click/dobel/shelly/exporter/client/api/gen2/Gen2ShellyDeviceInfo.kt:
The new slot field is missing, leading to the following sample response being problematic for deserialization: http://192.168.178.23/rpc/Shelly.GetDeviceInfo
Here’s a relevant snippet from the debug log showing the issue:
Let me know if any additional details are needed.
I have no idea where this slot comes from in my case, it's not in the official documentation either https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Shelly/#shellygetdeviceinfo