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

Problems with retrieving temperature readings #153

Open
tkallsen opened this issue May 31, 2023 · 1 comment
Open

Problems with retrieving temperature readings #153

tkallsen opened this issue May 31, 2023 · 1 comment

Comments

@tkallsen
Copy link

Describe the bug
I get a KeyError related to line 262 in coordinator.py, when it tries to read temperatures from the JSON response from /api/Panel/GetTemperatures.

As far as I have been able to figure out this is because it only creates entries in the temp(erature) dictionary from the GetPanel-response and I get more entries from GetTemperatures.

Response from GetPanel (only two temperatures):

"Temperatures": [
        {
            "Id": "8897303",
            "Label": "<redacted>",
            "SerialNo": "8897303",
            "Temprature": "0",
            "Temperature": "0",
            "DeviceId": "8897303"
        },
        {
            "Id": "5858192",
            "Label": "<redacted>",
            "SerialNo": "5858192",
            "Temprature": "0",
            "Temperature": "0",
            "DeviceId": "5858192"
        }
    ],

Response from GetTemperatures (12 entries):

[
    {
        "Id": "0",
        "Label": "entréplan ingång",
        "SerialNo": "5858192",
        "Temprature": "23",
        "Temperature": "23",
        "DeviceId": "5858192"
    },
    {
        "Id": "1",
        "Label": "<redacted>",
        "SerialNo": "6610978",
        "Temprature": "23",
        "Temperature": "23",
        "DeviceId": "6610978"
    },
    {
        "Id": "2",
        "Label": "<redacted>",
        "SerialNo": "6701423",
        "Temprature": "28",
        "Temperature": "28",
        "DeviceId": "6701423"
    },
    {
        "Id": "3",
        "Label": "<redacted>",
        "SerialNo": "6706123",
        "Temprature": "34",
        "Temperature": "34",
        "DeviceId": "6706123"
    },
    {
        "Id": "4",
        "Label": "<redacted>",
        "SerialNo": "6706423",
        "Temprature": "23",
        "Temperature": "23",
        "DeviceId": "6706423"
    },
    {
        "Id": "5",
        "Label": "<redacted>",
        "SerialNo": "6707623",
        "Temprature": "25",
        "Temperature": "25",
        "DeviceId": "6707623"
    },
    {
        "Id": "6",
        "Label": "<redacted>",
        "SerialNo": "6708223",
        "Temprature": "22",
        "Temperature": "22",
        "DeviceId": "6708223"
    },
    {
        "Id": "7",
        "Label": "<redacted>",
        "SerialNo": "8190053",
        "Temprature": "26",
        "Temperature": "26",
        "DeviceId": "8190053"
    },
    {
        "Id": "8",
        "Label": "<redacted>",
        "SerialNo": "8199433",
        "Temprature": "24",
        "Temperature": "24",
        "DeviceId": "8199433"
    },
    {
        "Id": "9",
        "Label": "<redacted>",
        "SerialNo": "8891331",
        "Temprature": "26",
        "Temperature": "26",
        "DeviceId": "8891331"
    },
    {
        "Id": "10",
        "Label": "<redacted>",
        "SerialNo": "8893611",
        "Temprature": "26",
        "Temperature": "26",
        "DeviceId": "8893611"
    },
    {
        "Id": "11",
        "Label": "<redacted>",
        "SerialNo": "8897303",
        "Temprature": "23",
        "Temperature": "23",
        "DeviceId": "8897303"
    }
]

I have no idea why the two API-calls returns different numbers of devices.

Version
Latest/HACS

@cerede2000
Copy link

Hi,
I have same problem.
After check Sector Alarm app HTTP API calls the API for temperatures reading change to :
https://mypagesapi.sectoralarm.net/api/v2/housecheck/temperatures

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

2 participants