jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
327 stars 34 forks source link

Central configuration UI shows motion detection ON even though it is OFF #442

Closed brunoleon closed 7 months ago

brunoleon commented 7 months ago

Version of the custom_component

6.2.1

Configuration

{'use_window_feature': False, 'use_motion_feature': False, 'use_power_feature': False, 'use_presence_feature': False, 'use_central_boiler_feature': False, 'use_main_central_config': False, 'use_tpi_central_config': False, 'use_window_central_config': False, 'use_motion_central_config': False, 'use_power_central_config': False, 'use_presets_central_config': False, 'use_presence_central_config': False, 'use_advanced_central_config': False, 'thermostat_type': 'thermostat_central_config', 'name': 'Central configuration', 'external_temperature_sensor_entity_id': 'sensor.test_sensor_temperature', 'temp_min': 7.0, 'temp_max': 35.0, 'step_temperature': 0.1, 'window_sensor_entity_id': None, 'window_auto_close_threshold': None, 'window_auto_open_threshold': None, 'window_auto_max_duration': None, 'power_sensor_entity_id': None, 'max_power_sensor_entity_id': None, 'presence_sensor_entity_id': None, 'central_boiler_activation_service': None, 'central_boiler_deactivation_service': None, 'motion_delay': 301, 'motion_off_delay': 300, 'motion_preset': 'comfort', 'no_motion_preset': 'eco', 'motion_sensor_entity_id': None}

Describe the bug

On a fresh installation of HA, the "central configuration" config UI keeps showing the "motion detection" feature as enabled, even though it has never been selected.

The feature seems disabled though in the device config as shown above in the json log.

I'm trying to: Disable "motion detection"

And I expect: Motion detection to be shown as disabled in UI

But I observe this .... UI show motion detection enabled Screenshot_20240410_10-18-36 Screenshot_20240410_10-13-51

brunoleon commented 7 months ago

It looks like it may be the behavior of add_suggested_values_to_schema when editing the config, filling in "motion detection" to on by default, but that seems counter intuitive to me that the config does not reflect the real state of the device.

jmcollin78 commented 7 months ago

This looks like a bug.

jmcollin78 commented 7 months ago

Hello @brunoleon ,

I have reproduce the bug and finally this is normal but I admit this could be confusing. Motion sensor are not centralized, but only some configuration is. So this is not a real feature in the central configuration but more some default configuration. And default configuration is always present and can't be removed. That is why the checkbox keep checked.

The real motion detection feature is on each VTherm (not central).

Because there is no impact, I will keep that, else we could have side effect on Vtherm if central is not activated and Vtherm is.

I will close this issue, don't hesitate to reopen if you think I'm wrong.