Skip to content

Fix NuosSplit operative mode changes (GREEN mode not working) - #174

Closed
eye0fra wants to merge 3 commits into
fustom:mainfrom
eye0fra:main
Closed

eye0fra wants to merge 3 commits into
fustom:mainfrom
eye0fra:main

Conversation

@eye0fra

@eye0fra eye0fra commented Dec 9, 2025

Copy link
Copy Markdown

Problem

Setting the operative mode on NuosSplit devices (e.g., Nuos Plus S2) via set_nuos_mode() / async_set_nuos_mode() returned {"success": true} but the mode never actually changed.

Root Cause

The Ariston API requires the "old" field in the request payload to apply operative mode changes. The library was only sending {"new": value}.

Fix

  • Updated set_nuos_mode() and async_set_nuos_mode() in ariston_api.py to accept and include the old_value parameter
  • Updated set_water_heater_operation_mode() and async_set_water_heater_operation_mode() in nuos_split_device.py to pass the current mode value as old

Before

{"new": 0}  # Accepted but ignored

After

{"new": 0, "old": 1}  # Actually applies the change

Related to fustom/ariston-remotethermo-home-assistant-v3#407

@agustinscaz

Copy link
Copy Markdown

Confirming this fix is still needed, tested today (2026-10-12) on an Ariston NUOS PLUS S2 WIFI 200L FS with ariston 0.19.9 (latest release).

  • POST velis/slpPlantData/{gw}/operativeMode with {"new": 0} returns {"success": true} but the mode stays unchanged, so GREEN can't be selected from Home Assistant. HA shows GREEN (optimistic state) until the next poll, then it flips back.
  • The same call with {"new": 0, "old": <anything>} applies the change. I tried the real current opMode and also a wrong value, and both worked, so old isn't validated, it just has to be present.
  • FAST (2), IMEMORY (3) and GREEN+ (6) are accepted without old; only GREEN (0) fails.
  • new: 1 (COMFORT) returns 400 on this model.

After patching my local copy to send old (current opMode) I switched GREEN, FAST, IMEMORY, GREEN+ and back, checking the cloud state each time, and left it in GREEN+ for 5 minutes without it reverting.

This matches the root cause described here, so it would be great to get this merged and released.

self.gw, NuosSplitOperativeMode[operation_mode], old_value
)
self.data[NuosSplitProperties.MODE] = NuosSplitOperativeMode[
self.data[NuosSplitProperties.OP_MODE] = NuosSplitOperativeMode[

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update test_nuos_split_properties_sync_async_and_missing_state_defaults with this OP_MODE cache change. Its fixture omits MODE but the sync and async checks still index that key after setters, so this change makes the existing suite raise KeyError and leaves the getter-backed cache unverified. Assert OP_MODE/water_heater_mode_value and verify the previous mode passed to each API call.

"""Set water heater operation mode"""
self.api.set_nuos_mode(self.gw, NuosSplitOperativeMode[operation_mode])
self.data[NuosSplitProperties.MODE] = NuosSplitOperativeMode[
old_value = self.water_heater_mode_value if self.water_heater_mode_value is not None else 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid hardcoding old=1 when the cached mode is unknown. Nuos value 1 is COMFORT, so a newly created device or empty cache sends COMFORT as the previous value regardless of the device's actual mode; since this endpoint's old field is the previous mode, the write can be rejected. Fetch the current state before both writes or handle an unknown previous value explicitly.

@astrinh0 astrinh0 closed this Nov 22, 2026
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

Successfully merging this pull request may close these issues.

3 participants