Skip to content

Error 500 when updating state #172

Description

@TheoLeCalvar

I have a strange behavior with my install, the following code fails because the API returns an error 500.
It's a SERELIA GREEN LINK which is recognized as a a Galevo. It used to work fine a few months back.

import asyncio
from ariston import Ariston


ariston = Ariston()

user = "my_user"
passwd = "my_pass"
dev_id = "gw_id"

asyncio.run(ariston.async_connect(user, passwd))

device = asyncio.run(ariston.async_hello(dev_id))


device.update_state()
Traceback (most recent call last):
  File "/home/goldensuneur/work/ariston/test.py", line 16, in <module>
    device.update_state()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/home/goldensuneur/work/ariston/ariston/galevo_device.py", line 96, in update_state
    self.data = self.api.get_properties(
                ~~~~~~~~~~~~~~~~~~~~~~~^
        self.gw,
        ^^^^^^^^
    ...<2 lines>...
        self.umsys,
        ^^^^^^^^^^^
    )
    ^
  File "/home/goldensuneur/work/ariston/ariston/ariston_api.py", line 166, in get_properties
    properties = self._post(
        f"{self.__api_url}{ARISTON_REMOTE}/{ARISTON_DATA_ITEMS}/{gw_id}/get?umsys={umsys}",
    ...<5 lines>...
        },
    )
  File "/home/goldensuneur/work/ariston/ariston/ariston_api.py", line 515, in _post
    return self.__request("POST", path, None, body)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldensuneur/work/ariston/ariston/ariston_api.py", line 503, in __request
    return self.__request(method, path, params, body, True)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldensuneur/work/ariston/ariston/ariston_api.py", line 504, in __request
    raise ConnectionException(response.status_code)
ariston.ariston_api.ConnectionException: 500

After a bit of investigation I noticed that the backend fails only when specific items are asked. After trial and error I found that asking for any of the commented properties will trigger a 500 error.

class DeviceProperties(ExtendedStrEnum):
    """Constants for device properties"""

    # PLANT_MODE = "PlantMode"
    IS_FLAME_ON = "IsFlameOn"
    IS_HEATING_PUMP_ON = "IsHeatingPumpOn"
    HOLIDAY = "Holiday"
    OUTSIDE_TEMP = "OutsideTemp"
    # WEATHER = "Weather"
    # HEATING_CIRCUIT_PRESSURE = "HeatingCircuitPressure"
    CH_FLOW_TEMP = "ChFlowTemp"
    # CH_FLOW_SETPOINT_TEMP = "ChFlowSetpointTemp"
    # DHW_TEMP = "DhwTemp"
    DHW_STORAGE_TEMPERATURE = "DhwStorageTemperature"
    # DHW_TIMEPROG_COMFORT_TEMP = "DhwTimeProgComfortTemp"
    # DHW_TIMEPROG_ECONOMY_TEMP = "DhwTimeProgEconomyTemp"
    # DHW_MODE = "DhwMode"
    # AUTOMATIC_THERMOREGULATION = "AutomaticThermoregulation"
    # ANTILEGIONELLA_ON_OFF = "AntilegionellaOnOff"
    ANTILEGIONELLA_TEMP = "AntilegionellaTemp"
    # ANTILEGIONELLA_FREQ = "AntilegionellaFreq"
    HYBRID_MODE = "HybridMode"
    BUFFER_CONTROL_MODE = "BufferControlMode"
    BUFFER_TIME_PROG_COMFORT_HEATING_TEMP = "BufferTimeProgComfortHeatingTemp"
    BUFFER_TIME_PROG_ECONOMY_HEATING_TEMP = "BufferTimeProgEconomyHeatingTemp"
    BUFFER_TIME_PROG_COMFORT_COOLING_TEMP = "BufferTimeProgComfortCoolingTemp"
    BUFFER_TIME_PROG_ECONOMY_COOLING_TEMP = "BufferTimeProgEconomyCoolingTemp"
    IS_QUIET = "IsQuite"  # ariston misspelled IsQuiet


class ThermostatProperties(ExtendedStrEnum):
    """Constants for thermostat properties"""

    # ZONE_MEASURED_TEMP = "ZoneMeasuredTemp"
    # ZONE_DESIRED_TEMP = "ZoneDesiredTemp"
    # ZONE_COMFORT_TEMP = "ZoneComfortTemp"
    # ZONE_MODE = "ZoneMode"
    # ZONE_HEAT_REQUEST = "ZoneHeatRequest"
    # ZONE_ECONOMY_TEMP = "ZoneEconomyTemp"
    ZONE_DEROGA = "ZoneDeroga"
    # ZONE_IS_ZONE_PILOT_ON = "IsZonePilotOn"
    # ZONE_VIRT_TEMP_OFFSET_HEAT = "VirtTempOffsetHeat"
    # HEATING_FLOW_TEMP = "HeatingFlowTemp"
    # HEATING_FLOW_OFFSET = "HeatingFlowOffset"
    COOLING_FLOW_TEMP = "CoolingFlowTemp"
    COOLING_FLOW_OFFSET = "CoolingFlowOffset"
    ZONE_NAME = "ZoneName"
    # VIRT_TEMP_SETPOINT_HEAT = "VirtTempSetpointHeat"
    VIRT_TEMP_SETPOINT_COOL = "VirtTempSetpointCool"
    # VIRT_COMFORT_TEMP = "VirtComfortTemp"
    # VIRT_REDUCED_TEMP = "VirtReducedTemp"
    ZONE_VIRT_TEMP_OFFSET_COOL = "VirtTempOffsetCool"

Do you have any idea of the source of the problem and how I can troubleshoot it ? There is no problems when I use the official website so do you have advice on what to check to find what is different between the call made by the official website and your project ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions