plugwise / plugwise-beta

Custom-component / development version of the Plugwise Home Assistant platform
MIT License
24 stars 8 forks source link

[BUG]: Cannot set temprature #620

Closed johanb7 closed 4 months ago

johanb7 commented 4 months ago

Describe the bug.

When I try to change the temprature I receive the error: Failed to call service climate/set_temperature. Error communicating with API: This is in the logs:

Logger: plugwise.constants
Source: custom_components/plugwise/climate.py:244
integration: Plugwise Smile/Stretch Beta (documentation)
First occurred: 8:18:52 AM (2 occurrences)
Last logged: 8:20:15 AM

Smile response empty or error in <?xml version="1.0" encoding="UTF-8"?>
 <error>
 <code>400 Bad Request</code>
 <reason-phrase>XML validation failed: : Extra element setpoint in interleave setpoint:1: Element thermostat_functionality failed to validate content thermostat_functionality</reason-phrase>
 </error>

What version of Plugwise Beta are you using?

1.48.1

What was the last working version of Plugwise Beta (or Core if not using beta before)?

No response

What version of Home Assistant Core are you using?

2024.4.3

What type of installation are you running?

Home Assistant Supervised

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

Smile: Anna

What firmware version is your Plugwise product at?

1.8.22

Logging

2024-04-19 08:20:15.680 WARNING (MainThread) [plugwise.constants] Smile response empty or error in <?xml version="1.0" encoding="UTF-8"?>

400 Bad Request XML validation failed: : Extra element setpoint in interleave setpoint:1: Element thermostat_functionality failed to validate content thermostat_functionality

2024-04-19 08:20:15.680 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140204938971456] Error communicating with API: Traceback (most recent call last): File "/config/custom_components/plugwise/util.py", line 36, in handler return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/plugwise/climate.py", line 244, in async_set_temperature await self.coordinator.api.set_temperature(self.device["location"], data) File "/usr/local/lib/python3.12/site-packages/plugwise/init.py", line 324, in set_temperature await self._smile_api.set_temperature(loc_id, items) File "/usr/local/lib/python3.12/site-packages/plugwise/legacy/smile.py", line 266, in set_temperature await self._request(uri, method="put", data=data) File "/usr/local/lib/python3.12/site-packages/plugwise/helper.py", line 154, in _request return await self._request_validate(resp, method) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/plugwise/helper.py", line 173, in _request_validate raise ResponseError plugwise.exceptions.ResponseError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 917, in async_service_temperature_set await entity.async_set_temperature(**kwargs) File "/config/custom_components/plugwise/util.py", line 38, in handler raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Error communicating with API: 2024-04-19 08:20:25.425 DEBUG (MainThread) [custom_components.plugwise] Smile Anna data: PlugwiseData(gateway={'gateway_id': '0000aaaa0000aaaa0000aaaa0000aa00', 'item_count': 32, 'smile_name': 'Smile Anna', 'heater_id': 'f61779aab355405087d1a83e5dd9255e', 'cooling_present': False}, devices={'0000aaaa0000aaaa0000aaaa0000aa00': {'dev_class': 'gateway', 'firmware': '1.8.22', 'location': '0000aaaa0000aaaa0000aaaa0000aa00', 'mac_address': 'C4:93:00:03:FE:04', 'model': 'Gateway', 'name': 'Smile Anna', 'vendor': 'Plugwise'}, 'f61779aab355405087d1a83e5dd9255e': {'dev_class': 'heater_central', 'location': '0000aaaa0000aaaa0000aaaa0000aa00', 'model': 'Unknown', 'name': 'OnOff', 'binary_sensors': {'flame_state': True, 'heating_state': True}}, '6cb56f958b45412eb2fa4b1c9aac9e6c': {'dev_class': 'thermostat', 'firmware': '2017-03-13T11:54:58+01:00', 'hardware': '6539-1301-5002', 'location': '0000aaaa0000aaaa0000aaaa0000aa00', 'model': 'ThermoTouch', 'name': 'Anna', 'vendor': 'Plugwise', 'sensors': {'temperature': 18.5, 'setpoint': 18.8, 'illuminance': 1.5}, 'thermostat': {'setpoint': 18.8, 'resolution': 0.1, 'lower_bound': 4.0, 'upper_bound': 30.0}, 'preset_modes': ['away', 'home', 'vacation', 'asleep', 'no_frost'], 'active_preset': None, 'available_schedules': ['Thermostat schedule'], 'select_schedule': 'None', 'mode': 'heat'}}) 2024-04-19 08:20:25.425 DEBUG (MainThread) [custom_components.plugwise] Finished fetching plugwise data in 8.245 seconds (success: True)

Diagnostics information

No response

Additional information

No response

bouwew commented 4 months ago

Thanks for creating this Issue, I will look at it later today or during the weekend.

bouwew commented 4 months ago

@johanb7 Can you please upgrade to v0.48.2a0 and test?

bouwew commented 4 months ago

The new version will become visible in HACS when you enable Show beta versions for the Plugwise-beta integration.

johanb7 commented 4 months ago

Update and I’m now able to set the temperature again. Thanks!

bouwew commented 4 months ago

Thanks for reporting back the positive result!

Solved via #622

bouwew commented 3 months ago

@johanb7 I'm looking at our code for the legacy Anna that you have, I wonder if something is not working maybe? In HA does the Anna have a Thermostat-schedule Select? If yes, how many options does that select have?