Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Wrong serial for gateways? #335

Open
CFenner opened this issue Oct 19, 2023 · 3 comments
Open

Question: Wrong serial for gateways? #335

CFenner opened this issue Oct 19, 2023 · 3 comments

Comments

@CFenner
Copy link
Member

CFenner commented Oct 19, 2023

When I print the serials of my device, I get two times the same number for the heating device and the gateway. Is this due to the missing autodetect and fallback to HeatingDevice? Would a dedicated gateway class as in #334 help?

2023-10-19 23:22:24.938 INFO (SyncWorker_6) [ViCare] detected VScotHO1_40 asGazBoiler
2023-10-19 23:22:25.181 INFO (SyncWorker_6) [custom_components.vicare] Found device: xxx572105 <class 'PyViCare.PyViCareGazBoiler.GazBoiler'>

2023-10-19 23:22:25.185 INFO (SyncWorker_6) [ViCare] Could not auto detect Heatbox1. Use generic device.
2023-10-19 23:22:25.326 INFO (SyncWorker_6) [custom_components.vicare] Found device: xxx572105 <class 'PyViCare.PyViCareHeatingDevice.HeatingDevice'>

2023-10-19 23:22:25.327 INFO (SyncWorker_6) [ViCare] detected VScotHO1_72 asGazBoiler
2023-10-19 23:22:25.563 INFO (SyncWorker_6) [custom_components.vicare] Found device: xxx545103 <class 'PyViCare.PyViCareGazBoiler.GazBoiler'>

2023-10-19 23:22:25.563 INFO (SyncWorker_6) [ViCare] Could not auto detect Heatbox1. Use generic device.
2023-10-19 23:22:25.745 INFO (SyncWorker_6) [custom_components.vicare] Found device: xxx545103 <class 'PyViCare.PyViCareHeatingDevice.HeatingDevice'>

API gives these values:

{
    "data": [
        {
            "gatewaySerial": "xxx160106",
            "id": "0",
            "boilerSerial": "xxx545103",
            "boilerSerialEditor": "DeviceCommunication",
            "bmuSerial": "xxx740107",
            "bmuSerialEditor": "DeviceCommunication",
            "createdAt": "2018-06-08T12:48:28.806Z",
            "editedAt": "2023-07-04T12:25:31.733Z",
            "modelId": "VScotHO1_72",
            "status": "Online",
            "deviceType": "heating",
            "roles": [
                "type:boiler",
                "type:legacy",
                "type:product;VScotHO1"
            ],
            "isBoilerSerialEditable": false
        },
        {
            "gatewaySerial": "xxx160106",
            "id": "gateway",
            "boilerSerial": null,
            "boilerSerialEditor": null,
            "bmuSerial": null,
            "bmuSerialEditor": null,
            "createdAt": "2021-05-19T06:32:22.925Z",
            "editedAt": "2023-10-09T14:23:14.464Z",
            "modelId": "Heatbox1",
            "status": "Online",
            "deviceType": "vitoconnect",
            "roles": [
                "type:gateway;VitoconnectOpto1",
                "type:legacy"
            ],
            "isBoilerSerialEditable": false
        }
    ]
}
@CFenner CFenner changed the title Wrong serial for gateways Question: Wrong serial for gateways? Oct 20, 2023
@Nibot1
Copy link
Contributor

Nibot1 commented Apr 2, 2024

This issue can be closed because with the merged PR it should be fixed, right?

@CFenner
Copy link
Member Author

CFenner commented Apr 2, 2024

Not sure, the log from above is from Home Assistant Integration. In there the serial is currently fetched with deviceConfig.getConfig().serial which always gives the gateway serial.
Instead the integration should use device.getSerial() which should now also be possible for the gateways with the PR merged.

To me it's unclear if the behavior is correct that deviceConfig.getConfig().serial gives the gateway serial.

@woehrl01
Copy link
Collaborator

woehrl01 commented Apr 3, 2024

@CFenner returning the gateway is correct as this value returns the accessor id which is the gateway. It also returns the device id. That method is basically an implementation detail how the url for the rest call is constructed.

We could argue if the method should be renamed to make this more obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants