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

1.2.1 - bad gateway errors regularly in HA log #79

Open
derekcentrico opened this issue Jan 4, 2025 · 8 comments
Open

1.2.1 - bad gateway errors regularly in HA log #79

derekcentrico opened this issue Jan 4, 2025 · 8 comments

Comments

@derekcentrico
Copy link

The problem

Regularly I'm seeing bad gateway errors in the HA logs. I assume this means the automations aren't working as a result. They're designed to shut off the Puras when the house is empty...

Logger: pypura.pura
Source: /usr/local/lib/python3.13/site-packages/pypura/pura.py:221
First occurred: 9:07:23 AM (2 occurrences)
Last logged: 9:34:24 AM

Status: 502 - <html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> </body> </html>
This error originated from a custom integration.

Logger: custom_components.pura.coordinator
Source: custom_components/pura/coordinator.py:51
integration: Pura (documentation, issues)
First occurred: 9:07:23 AM (2 occurrences)
Last logged: 9:34:24 AM

Unknown exception while updating Pura data: 502 Server Error: Bad Gateway for url: https://trypura.io/mobile/api/v2/users/devices
Traceback (most recent call last):
  File "/config/custom_components/pura/coordinator.py", line 51, in _async_update_data
    if devices := await self.hass.async_add_executor_job(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.api.get_devices_v2
        ^^^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/pypura/pura.py", line 102, in get_devices_v2
    return self.__get("v2/users/devices")
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pypura/pura.py", line 227, in __get
    return self.__request("get", url, **kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pypura/pura.py", line 222, in __request
    response.raise_for_status()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://trypura.io/mobile/api/v2/users/devices
This error originated from a custom integration.

Logger: custom_components.pura.coordinator
Source: helpers/update_coordinator.py:411
integration: Pura (documentation, issues)
First occurred: 9:07:23 AM (2 occurrences)
Last logged: 9:34:24 AM

Error fetching pura data: 502 Server Error: Bad Gateway for url: https://trypura.io/mobile/api/v2/users/devices

What version of Home Assistant Core are you running?

core-2024.12.5

What was the last working version of Home Assistant Core?

No response

Diagnostics information

{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2024.12.5",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.13.0",
"docker": true,
"arch": "x86_64",
"timezone": "America/New_York",
"os_name": "Linux",
"os_version": "6.6.66-haos",
"supervisor": "2024.12.3",
"host_os": "Home Assistant OS 14.1",
"docker_version": "27.2.0",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"ge_home": {
"documentation": "https://github.com/simbaja/ha_gehome",
"version": "0.6.14",
"requirements": [
"gehomesdk==0.5.30",
"magicattr==0.1.6",
"slixmpp==1.8.3"
]
},
"pura": {
"documentation": "https://github.com/natekspencer/hacs-pura",
"version": "1.2.1",
"requirements": [
"pypura==0.2.0",
"deepdiff",
"ical"
]
},
"pyscript": {
"documentation": "https://github.com/custom-components/pyscript",
"version": "1.6.1",
"requirements": [
"croniter==2.0.2",
"watchdog==2.3.1"
]
},
"adaptive_lighting": {
"documentation": "https://github.com/basnijholt/adaptive-lighting#readme",
"version": "1.25.0",
"requirements": [
"ulid-transform"
]
},
"browser_mod": {
"documentation": "https://github.com/thomasloven/hass-browser_mod/blob/master/README.md",
"version": "2.3.1",
"requirements": []
},
"frigate": {
"documentation": "https://github.com/blakeblackshear/frigate",
"version": "5.6.0",
"requirements": [
"hass-web-proxy-lib==0.0.7"
]
},
"enphase_envoy": {
"documentation": "https://github.com/briancmpbll/home_assistant_custom_envoy#readme",
"version": "0.0.20",
"requirements": [
"pyjwt",
"xmltodict",
"httpx",
"envoy_utils"
]
},
"ui_lovelace_minimalist": {
"documentation": "https://ui-lovelace-minimalist.github.io/UI/",
"version": "v1.3.14",
"requirements": [
"aiofiles>=0.8.0",
"aiogithubapi>=22.2.4"
]
},
"wyzeapi": {
"documentation": "https://github.com/SecKatie/ha-wyzeapi#readme",
"version": "0.1.30",
"requirements": [
"wyzeapy>=0.5.26,<0.6"
]
},
"dwains_dashboard": {
"documentation": "https://dwainscheeren.github.io/dwains-lovelace-dashboard/",
"version": "3.7.1",
"requirements": []
},
"hacs": {
"documentation": "https://hacs.xyz/docs/configuration/start",
"version": "2.0.1",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"dahua": {
"documentation": "https://github.com/rroller/dahua",
"version": "0.9.70",
"requirements": []
},
"scheduler": {
"documentation": "https://github.com/nielsfaber/scheduler-component",
"version": "v0.0.0",
"requirements": []
},
"chime_tts": {
"documentation": "https://nimroddolev.github.io/chime_tts",
"version": "v1.2.2",
"requirements": [
"pydub",
"aiofiles"
]
},
"smart_irrigation": {
"documentation": "https://github.com/jeroenterheerdt/HASmartIrrigation",
"version": "v2024.10.3",
"requirements": []
}
},
"integration_manifest": {
"domain": "pura",
"name": "Pura",
"codeowners": [
"natekspencer"
],
"config_flow": true,
"documentation": "https://github.com/natekspencer/hacs-pura",
"integration_type": "hub",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/natekspencer/hacs-pura/issues",
"loggers": [
"custom_components.pura",
"pypura"
],
"requirements": [
"pypura==0.2.0",
"deepdiff",
"ical"
],
"version": "1.2.1",
"is_built_in": false,
"overwrites_built_in": false
},
"setup_times": {
"null": {
"setup": 1.532500027678907e-05
},
"01J5B0K282KFDCTDJDG1A2WA3F": {
"wait_import_platforms": -1.7651602850237396,
"config_entry_setup": 6.013078283984214
}
},
"data": {
"car": [],
"mini": [],
"plus": [],
"wall": [
{
"awayMode": {
"away": false,
"enabled": true
},
"bay1": {
"msg": "",
"wearingTime": 187609,
"code": "HSPH",
"vialId": "51f13a33-a2ab-4dea-92a7-4ed8318011bc",
"id": 1734182892,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall_-Holiday_Spice-BKGD.png?v=1634768359",
"brandName": "K. Hall Designs",
"description": "Cranberry, spiced orange peel, and creamy woods",
"name": "Holiday Spice",
"fragranceCode": "HSPH",
"fragranceFormat": "vial",
"id": "a79fe7ce-e81b-4d50-addc-6b43a2b2b129",
"placeholderColor": "8B2234",
"sqImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall-Designs-HolidaySpice-Icon.png?v=1634768359",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K_Hall_Designs-Holiday_Spice-Vial-CapOff.png?v=1717780952",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Cinnamon-DeviceControl-Background-0424.png?v=1714155373",
"scentNotes": {
"top": [
"fresh cranberry",
"cinnamon"
],
"bottom": [
"white amber",
"creamy woods"
],
"middle": [
"spiced orange peel",
"touch of nutmeg"
]
},
"scentTypes": [
{
"name": "Fruity",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fruity_8f5d5087-6241-4032-b0c0-d11a71aad749.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "51f13a33-a2ab-4dea-92a7-4ed8318011bc"
},
"connected": true,
"controller": "default",
"deviceDefaults": {
"bay": 0,
"bay1Intensity": "strong",
"bay2Intensity": "medium",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
}
},
"deviceId": "REDACTED",
"deviceVer": null,
"deviceLocation": {
"radius": 150,
"timezone": "America/New_York",
"latitude": "REDACTED",
"longitude": "REDACTED"
},
"disconnectReason": null,
"displayName": {
"name": "Living Room",
"type": "living_room"
},
"fwVersion": "2.8.8",
"hwVersion": "2.1",
"lastConnectedAt": null,
"lastDisconnectedAt": null,
"model": 1,
"onboardedAt": 1662846685,
"ota": null,
"otaVer": null,
"position": 2,
"setupComplete": true,
"schedules": [
{
"id": "e25f3b08-16f0-407a-9358-1280a36ee064",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735684500,
"end": "1735",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 4,
"start": "1635"
},
{
"id": "1d5e436d-d584-4f97-8f80-78f753d85799",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735578000,
"end": "1200",
"intensity": "subtle",
"name": "Schedule 4",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 3,
"start": "1100"
},
{
"id": "6967f1df-a70d-46bc-8525-1f2b0b293aa0",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735691100,
"end": "1925",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 5,
"start": "1825"
},
{
"id": "4a0356ad-c5be-4043-b2ec-66d296701603",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735484400,
"end": "1000",
"intensity": "subtle",
"name": "Schedule 3",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 2,
"start": "0900"
},
{
"id": "70415837-2df0-445b-9b16-f97f2fe3a6cb",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735849800,
"end": "1530",
"intensity": "subtle",
"name": "Schedule 2",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 1,
"start": "1400"
},
{
"id": "6a1d39cd-3174-4a0a-80aa-a0ea9552b4d6",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735822800,
"end": "0800",
"intensity": "subtle",
"name": "Schedule 1",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 0,
"start": "0700"
}
],
"timer": null,
"wifi": {
"rssi": "good",
"ssid": "dgaptwifi"
},
"ambientMode": false,
"bay2": {
"msg": "",
"wearingTime": 208725,
"code": "LXNH",
"vialId": "35b10cf3-f3a6-4363-a5dd-6a7a1224914c",
"id": 1734182914,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-FrasierFir-BKGD.png?v=1646072848",
"brandName": "Thymes",
"description": "Siberian fir, cedarwood and earthy sandalwood.",
"name": "Frasier Fir",
"fragranceCode": "LXNH",
"fragranceFormat": "vial",
"id": "d3fa885f-1466-44a0-b2bc-2f5994aa6c62",
"placeholderColor": "4c542a",
"sqImgUrl": "https://firebasestorage.googleapis.com/v0/b/purascents.appspot.com/o/sq_images%2FThymes%2FPura_Square_App_BG_Thymes%20Frasier%20Fir_logo(1).jpg?alt=media&token=bffe3088-10ca-4f23-8b3c-9f4ef0dc8f93",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-Frasier_Fir-Vial-CapOff.png?v=1718037975",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Pine-DeviceControl-Background-0424.png?v=1714422275",
"scentNotes": {
"top": [
"Siberian fir"
],
"bottom": [
"sandalwood"
],
"middle": [
"cedarwood"
]
},
"scentTypes": [
{
"name": "Fresh",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fresh_791ba4e6-a252-49c7-8e40-aa3cd9a83cd7.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "35b10cf3-f3a6-4363-a5dd-6a7a1224914c"
}
},
{
"awayMode": {
"away": false,
"enabled": true
},
"bay1": {
"msg": "",
"wearingTime": 201621,
"code": "HSPH",
"vialId": "0c9592b0-b028-46b5-916e-dc24410763a1",
"id": 1734182814,
"activeAt": 1736005743,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall
-Holiday_Spice-BKGD.png?v=1634768359",
"brandName": "K. Hall Designs",
"description": "Cranberry, spiced orange peel, and creamy woods",
"name": "Holiday Spice",
"fragranceCode": "HSPH",
"fragranceFormat": "vial",
"id": "a79fe7ce-e81b-4d50-addc-6b43a2b2b129",
"placeholderColor": "8B2234",
"sqImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall-Designs-HolidaySpice-Icon.png?v=1634768359",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K_Hall_Designs-Holiday_Spice-Vial-CapOff.png?v=1717780952",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Cinnamon-DeviceControl-Background-0424.png?v=1714155373",
"scentNotes": {
"top": [
"fresh cranberry",
"cinnamon"
],
"bottom": [
"white amber",
"creamy woods"
],
"middle": [
"spiced orange peel",
"touch of nutmeg"
]
},
"scentTypes": [
{
"name": "Fruity",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fruity_8f5d5087-6241-4032-b0c0-d11a71aad749.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "0c9592b0-b028-46b5-916e-dc24410763a1"
},
"connected": true,
"controller": "3",
"deviceDefaults": {
"bay": 0,
"bay1Intensity": "strong",
"bay2Intensity": "medium",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 4
}
},
"deviceId": "REDACTED",
"deviceVer": null,
"deviceLocation": {
"radius": 150,
"timezone": "America/New_York",
"latitude": "REDACTED",
"longitude": "REDACTED"
},
"disconnectReason": null,
"displayName": {
"name": "Family Room",
"type": "family_room"
},
"fwVersion": "2.8.8",
"hwVersion": "2.1",
"lastConnectedAt": null,
"lastDisconnectedAt": null,
"model": 1,
"onboardedAt": 1662233589,
"ota": null,
"otaVer": null,
"position": 4,
"setupComplete": true,
"schedules": [
{
"id": "52c3e75c-c105-49ec-85a2-bcaf7546009e",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735691700,
"end": "1935",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 5,
"start": "1800"
},
{
"id": "af9fe1ac-9cac-4ec9-ab59-449bdbf3d169",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735675200,
"end": "1500",
"intensity": "subtle",
"name": "Schedule 2",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 1,
"start": "1400"
},
{
"id": "27f0ce5a-330a-41ae-83ca-bd4c6aad6c3c",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735578000,
"end": "1200",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 3,
"start": "1050"
},
{
"id": "1a2cd570-baaa-43f9-8be1-d3013e17dbb6",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735249500,
"end": "1645",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 4,
"start": "1545"
},
{
"id": "5d3722d0-e4be-4c5e-acdd-95345de5d965",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735822800,
"end": "0800",
"intensity": "subtle",
"name": "Schedule 1",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 0,
"start": "0700"
},
{
"id": "517b405e-d3c3-4502-9f43-abf0e209bbad",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735483500,
"end": "0945",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 2,
"start": "0845"
}
],
"timer": null,
"wifi": {
"rssi": "excellent",
"ssid": "dgaptwifi"
},
"ambientMode": false,
"bay2": {
"msg": "",
"wearingTime": 220687,
"code": "LXNH",
"vialId": "d190a5db-15c7-4ec7-9ff5-44d97e2fe2fb",
"id": 1734182837,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-FrasierFir-BKGD.png?v=1646072848",
"brandName": "Thymes",
"description": "Siberian fir, cedarwood and earthy sandalwood.",
"name": "Frasier Fir",
"fragranceCode": "LXNH",
"fragranceFormat": "vial",
"id": "d3fa885f-1466-44a0-b2bc-2f5994aa6c62",
"placeholderColor": "4c542a",
"sqImgUrl": "https://firebasestorage.googleapis.com/v0/b/purascents.appspot.com/o/sq_images%2FThymes%2FPura_Square_App_BG_Thymes%20Frasier%20Fir_logo(1).jpg?alt=media&token=bffe3088-10ca-4f23-8b3c-9f4ef0dc8f93",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-Frasier_Fir-Vial-CapOff.png?v=1718037975",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Pine-DeviceControl-Background-0424.png?v=1714422275",
"scentNotes": {
"top": [
"Siberian fir"
],
"bottom": [
"sandalwood"
],
"middle": [
"cedarwood"
]
},
"scentTypes": [
{
"name": "Fresh",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fresh_791ba4e6-a252-49c7-8e40-aa3cd9a83cd7.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "d190a5db-15c7-4ec7-9ff5-44d97e2fe2fb"
}
},
{
"awayMode": {
"away": false,
"enabled": true
},
"bay1": {
"msg": "",
"wearingTime": 185467,
"code": "HSPH",
"vialId": "5c6aa2d5-660b-4a62-b28a-ba8137d1f9cb",
"id": 1734182722,
"activeAt": 1736005743,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall
-Holiday_Spice-BKGD.png?v=1634768359",
"brandName": "K. Hall Designs",
"description": "Cranberry, spiced orange peel, and creamy woods",
"name": "Holiday Spice",
"fragranceCode": "HSPH",
"fragranceFormat": "vial",
"id": "a79fe7ce-e81b-4d50-addc-6b43a2b2b129",
"placeholderColor": "8B2234",
"sqImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall-Designs-HolidaySpice-Icon.png?v=1634768359",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K_Hall_Designs-Holiday_Spice-Vial-CapOff.png?v=1717780952",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Cinnamon-DeviceControl-Background-0424.png?v=1714155373",
"scentNotes": {
"top": [
"fresh cranberry",
"cinnamon"
],
"bottom": [
"white amber",
"creamy woods"
],
"middle": [
"spiced orange peel",
"touch of nutmeg"
]
},
"scentTypes": [
{
"name": "Fruity",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fruity_8f5d5087-6241-4032-b0c0-d11a71aad749.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "5c6aa2d5-660b-4a62-b28a-ba8137d1f9cb"
},
"connected": true,
"controller": "1",
"deviceDefaults": {
"bay": 0,
"bay1Intensity": "subtle",
"bay2Intensity": "medium",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 2
}
},
"deviceId": "REDACTED",
"deviceVer": null,
"deviceLocation": {
"radius": 150,
"timezone": "America/New_York",
"longitude": "REDACTED",
"latitude": "REDACTED"
},
"disconnectReason": null,
"displayName": {
"name": "Basement",
"type": "custom"
},
"fwVersion": "2.8.8",
"hwVersion": "2.1",
"lastConnectedAt": null,
"lastDisconnectedAt": null,
"model": 1,
"onboardedAt": 1690216863,
"ota": null,
"otaVer": null,
"position": 3,
"setupComplete": true,
"schedules": [
{
"id": "c391c759-d19e-4add-b818-a7c38dc81d82",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735250100,
"end": "1655",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 5,
"start": "1555"
},
{
"id": "63688f80-e5d4-4abe-805f-4cfc4991c460",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735824900,
"end": "0835",
"intensity": "subtle",
"name": "Schedule 3",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 2,
"start": "0735"
},
{
"id": "26c918cd-1d1a-4b23-bbd0-d871e1994d85",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735577400,
"end": "1150",
"intensity": "subtle",
"name": "Schedule 2",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 1,
"start": "1050"
},
{
"id": "4a4084b0-f82e-4a4e-9569-dce8f92eb994",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735849500,
"end": "1525",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 4,
"start": "1425"
},
{
"id": "27982ef6-5879-400f-ae4d-77aa94e73eaf",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735671600,
"end": "1400",
"intensity": "subtle",
"name": "Relaxing wind down",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 3,
"start": "1300"
},
{
"id": "dde7359c-4fa8-4fb5-b78a-651406ac7315",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": false,
"wednesday": false,
"thursday": false,
"friday": false,
"monday": false
},
"disableUntil": 1734824700,
"end": "1845",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 6,
"start": "1745"
},
{
"id": "723bde1b-5485-43ff-aea4-d46629d5bfa0",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735485300,
"end": "1015",
"intensity": "subtle",
"name": "Schedule 1",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 0,
"start": "0915"
}
],
"timer": null,
"wifi": {
"rssi": "N/A",
"ssid": "dgaptwifi"
},
"ambientMode": false,
"bay2": {
"msg": "",
"wearingTime": 207979,
"code": "LXNH",
"vialId": "615073e5-9434-4cd7-9cc8-fdf9d043ca8f",
"id": 1734182747,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-FrasierFir-BKGD.png?v=1646072848",
"brandName": "Thymes",
"description": "Siberian fir, cedarwood and earthy sandalwood.",
"name": "Frasier Fir",
"fragranceCode": "LXNH",
"fragranceFormat": "vial",
"id": "d3fa885f-1466-44a0-b2bc-2f5994aa6c62",
"placeholderColor": "4c542a",
"sqImgUrl": "https://firebasestorage.googleapis.com/v0/b/purascents.appspot.com/o/sq_images%2FThymes%2FPura_Square_App_BG_Thymes%20Frasier%20Fir_logo(1).jpg?alt=media&token=bffe3088-10ca-4f23-8b3c-9f4ef0dc8f93",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-Frasier_Fir-Vial-CapOff.png?v=1718037975",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Pine-DeviceControl-Background-0424.png?v=1714422275",
"scentNotes": {
"top": [
"Siberian fir"
],
"bottom": [
"sandalwood"
],
"middle": [
"cedarwood"
]
},
"scentTypes": [
{
"name": "Fresh",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fresh_791ba4e6-a252-49c7-8e40-aa3cd9a83cd7.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "615073e5-9434-4cd7-9cc8-fdf9d043ca8f"
}
},
{
"awayMode": {
"away": false,
"enabled": true
},
"bay1": {
"msg": "",
"wearingTime": 216406,
"code": "HSPH",
"vialId": "c2c13d9e-241c-42c1-872c-6f943601de5c",
"id": 1734183021,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall
-_Holiday_Spice-BKGD.png?v=1634768359",
"brandName": "K. Hall Designs",
"description": "Cranberry, spiced orange peel, and creamy woods",
"name": "Holiday Spice",
"fragranceCode": "HSPH",
"fragranceFormat": "vial",
"id": "a79fe7ce-e81b-4d50-addc-6b43a2b2b129",
"placeholderColor": "8B2234",
"sqImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K.Hall-Designs-HolidaySpice-Icon.png?v=1634768359",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/K_Hall_Designs-Holiday_Spice-Vial-CapOff.png?v=1717780952",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Cinnamon-DeviceControl-Background-0424.png?v=1714155373",
"scentNotes": {
"top": [
"fresh cranberry",
"cinnamon"
],
"bottom": [
"white amber",
"creamy woods"
],
"middle": [
"spiced orange peel",
"touch of nutmeg"
]
},
"scentTypes": [
{
"name": "Fruity",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fruity_8f5d5087-6241-4032-b0c0-d11a71aad749.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "c2c13d9e-241c-42c1-872c-6f943601de5c"
},
"connected": true,
"controller": "default",
"deviceDefaults": {
"bay": 0,
"bay1Intensity": "strong",
"bay2Intensity": "medium",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 2
}
},
"deviceId": "REDACTED",
"deviceVer": "v3l",
"deviceLocation": {
"radius": 150,
"timezone": "America/New_York",
"latitude": "REDACTED",
"longitude": "REDACTED"
},
"disconnectReason": null,
"displayName": {
"name": "Upstairs",
"type": "upstairs"
},
"fwVersion": "2.6.0",
"hwVersion": "3.0",
"lastConnectedAt": null,
"lastDisconnectedAt": null,
"model": 1,
"onboardedAt": 1663880137,
"ota": null,
"otaVer": 132698134,
"position": 6,
"setupComplete": true,
"schedules": [
{
"id": "cbd7cd8b-38d1-45eb-9256-773a309d639b",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735485300,
"end": "1015",
"intensity": "subtle",
"name": "Schedule 3",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 1,
"start": "0915"
},
{
"id": "c0f97e64-1c13-41ec-b36e-d22cbef0366f",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735578000,
"end": "1200",
"intensity": "subtle",
"name": "Schedule 4",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 2,
"start": "1100"
},
{
"id": "998786a1-7093-4108-97fa-2910adcd9857",
"bay": 1,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735824600,
"end": "0830",
"intensity": "subtle",
"name": "Schedule 1",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 0,
"start": "0705"
},
{
"id": "4bb97a3c-b58a-40b1-a04c-511763fbcab2",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735852200,
"end": "1610",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 4,
"start": "1510"
},
{
"id": "a7395ffb-ad9e-4a60-a6fb-3f18bc65ee00",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735673400,
"end": "1430",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "FFFFFF",
"active": false,
"brightness": 10
},
"number": 3,
"start": "1330"
},
{
"id": "05f5e30a-3b18-4c70-9433-730d3066e299",
"bay": 2,
"days": {
"sunday": true,
"saturday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"monday": true
},
"disableUntil": 1735685700,
"end": "1755",
"intensity": "subtle",
"name": "All day long",
"nightlight": {
"color": "C8FF12",
"active": false,
"brightness": 10
},
"number": 5,
"start": "1635"
}
],
"timer": null,
"wifi": {
"rssi": "good",
"ssid": "dgaptwifi"
},
"ambientMode": false,
"bay2": {
"msg": "",
"wearingTime": 229114,
"code": "LXNH",
"vialId": "0bce68c1-d8de-4ea7-babe-450cf8e40eda",
"id": 1734183037,
"activeAt": 0,
"isSmartVial": true,
"fragrance": {
"bgImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-FrasierFir-BKGD.png?v=1646072848",
"brandName": "Thymes",
"description": "Siberian fir, cedarwood and earthy sandalwood.",
"name": "Frasier Fir",
"fragranceCode": "LXNH",
"fragranceFormat": "vial",
"id": "d3fa885f-1466-44a0-b2bc-2f5994aa6c62",
"placeholderColor": "4c542a",
"sqImgUrl": "https://firebasestorage.googleapis.com/v0/b/purascents.appspot.com/o/sq_images%2FThymes%2FPura_Square_App_BG_Thymes%20Frasier%20Fir_logo(1).jpg?alt=media&token=bffe3088-10ca-4f23-8b3c-9f4ef0dc8f93",
"vialUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Thymes-Frasier_Fir-Vial-CapOff.png?v=1718037975",
"bgScentImgUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/Pine-DeviceControl-Background-0424.png?v=1714422275",
"scentNotes": {
"top": [
"Siberian fir"
],
"bottom": [
"sandalwood"
],
"middle": [
"cedarwood"
]
},
"scentTypes": [
{
"name": "Fresh",
"iconUrl": "https://cdn.shopify.com/s/files/1/0023/0021/5405/files/fresh_791ba4e6-a252-49c7-8e40-aa3cd9a83cd7.svg?v=1713898595"
}
],
"expectedLifeHours": 147
},
"lowFragrance": false,
"refillId": "0bce68c1-d8de-4ea7-babe-450cf8e40eda"
}
}
]
}
}

Anything in the logs that might be useful?

No response

Additional information

No response

@derekcentrico
Copy link
Author

For reference - I created something for a similar issue prior to API 2 which seemed to have been resolved at some point per the comment/merge/closure. #70

@natekspencer
Copy link
Owner

@derekcentrico this shows you had two occurrences 27 minutes apart. How often are you actually seeing this error? The v2 endpoint is the same the app still uses and 502's are indicative of server issues, so I can't really fix that if the Pura server is overloaded. Are you also actually seeing your automations fail?

@derekcentrico
Copy link
Author

derekcentrico commented Jan 4, 2025

@natekspencer so I'm unsure the failure rate if any. The only automation setup is to shutoff Puras if they are on when we depart or to shutoff Puras if they come on while we are out. I don't see failures in the very limited historical data (5 days). However, I wasn't sure if there was a change in their API like using a different default endpoint or something so decided to post after seeing this in logs for at least 3 weeks.

@eddyg
Copy link

eddyg commented Jan 8, 2025

I'm also seeing regular problems connecting to the Pura servers. From the Home Assistant "Logs" page (note the "28 occurrences" since 2 days ago...)

First occurred: January 6, 2025 at 12:39:19 PM (28 occurrences)
Last logged: 3:24:40 PM

Error fetching pura data: HTTPSConnectionPool(host='trypura.io', port=443): Max retries exceeded with url: /mobile/api/v2/users/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fdba288c910>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching pura data: HTTPSConnectionPool(host='trypura.io', port=443): Max retries exceeded with url: /mobile/api/v2/users/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fdb8f40e490>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching pura data: 502 Server Error: Bad Gateway for url: https://trypura.io/mobile/api/v2/users/devices
Error fetching pura data: HTTPSConnectionPool(host='trypura.io', port=443): Max retries exceeded with url: /mobile/api/v2/users/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fdb8ea62d50>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching pura data: HTTPSConnectionPool(host='trypura.io', port=443): Max retries exceeded with url: /mobile/api/v2/users/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fdb8f40b610>: Failed to establish a new connection: [Errno -3] Try again'))

@natekspencer
Copy link
Owner

I see similar logs myself. Unfortunately this issue is on Pura's servers. Right now, the integration requests an update every 30 seconds. I could mitigate this by reducing the updates to, say, every minute, but that comes at the expense of getting status updates less frequently.

@derekcentrico
Copy link
Author

I see similar logs myself. Unfortunately this issue is on Pura's servers. Right now, the integration requests an update every 30 seconds. I could mitigate this by reducing the updates to, say, every minute, but that comes at the expense of getting status updates less frequently.

Let it ride I suppose.

@eddyg
Copy link

eddyg commented Jan 8, 2025

Thanks for the quick reply! Is it possible the Pura servers have some kind of API rate limit, and hitting it every 30s causes issues? (If only they had local control! 😭)

@natekspencer
Copy link
Owner

A 429 (rather than a 502) error is more likely to be used if properly rate limited. But that doesn't mean it can't still be the result of too many requests.

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