securechicken / homebridge-micronova-agua-iot-stove

Homebridge plugin to manage stoves/heaters with Micronova's Agua IOT module and HTTP API
GNU Affero General Public License v3.0
6 stars 3 forks source link

[REQ] Support Piazzetta in 2022 (all or new models) #10

Open robkrause opened 1 year ago

robkrause commented 1 year ago

Description

I bought a Piazzetta P930 M-C just recently and tried our your impressive Homebridge Implementation. Unfortunately I get this error: _setAPILogin HTTP login request failed. Retrying... Reason: _setAPILogin did not get the expected JWT token back from API: {"Error":"INVALID_APP_ERROR","Success":false,"Source":"BRIDGE"}

Investigating using https://proxyman.io/ios I noticed that the auth flow seems to be slightly altered compared to your code. I'm unsure if this is only the case fore newer stoves. Can't create a branch/PR, therefor find my suggested code changes below.

Interest

Possible implementation

index.js Line 53:
["piazzetta", ["458632", "https://piazzetta.agua-iot.com/", "https://piazzetta-iot.app2cloud.it/api/bridge/endpoint/"]],

index.js Line 93:
const HTTP_REQ_PIAZZETTA_APP_VERSION_VALUE = "1.9.0";
Readme Line 53
"name": "<stove name, MUST be the same than one you configured in official stove mobile app, and you now want to control from HomeBridge, use '-' for Piazzetta>",
securechicken commented 1 year ago

Thanks a lot for having checked and explored this properly @robkrause, very useful. Unfortunately I'm not using Homebridge anymore, and as a consequence does not maintain the plugin - which can still be forked and updated elsewhere if need be. But I recall that last year I was exploring similar issues, Piazzetta asked some changes to the API maintainer (Micronova) to enforce going through their own endpoint, so likely they indeed changed the way the authentication is done (and possibly even API calls). I leave this issue open so that the community can benefit from your solution!