Ich habe ein Problem mit dem „Modus“-Gerät der Heizung.
Wenn ich es auf dem Dashboard einstelle und den Heizmodus ändern möchte, beginnt es zu blinken, wie im Video. Dadurch stürzt die Gladys-Oberfläche ab. Ich muss sie schließen und neu öffnen.
Ich weiß nicht, ob das Problem am Gerät selbst oder an meinen Szenen liegt, die dieses Z-Wave-Modul verwenden.
Hat jemand das gleiche Problem?
Hallo @gaetanb76 ,
Danke für das Feedback und das Video, das hilft sehr!
Laut dem, was ich gesehen habe, liegt das Problem weder an deinem Z-Wave-Modul noch an deinen Szenen, sondern an der Gladys-Oberfläche. Jedes Mal, wenn ein Gerät einen Status meldet, wird das Widget neu angezeigt, und auf Android führt dies dazu, dass das Auswahlmenü für den Modus geschlossen und dann wieder geöffnet wird, wodurch das Flackern entsteht. Deine Szenen und dein Modul machen diese Aktualisierungen nur häufiger, wodurch der Fehler sichtbarer wird.
Ich habe ein GitHub-Ticket eröffnet, um das Problem zu verfolgen:
ouvert 08:36AM - 23 Nov 26 UTC
type:fix
Forum: https://community.gladysassistant.com/t/clignotement-selection-mode-chauf… fage-sur-android/11655
### Describe the bug
On Android, a "Devices" box showing a heater **pilot wire mode** feature (`heater` / `pilot-wire-mode`) renders a native `<select>` (Off / Frost protection / Eco / Comfort -2 °C / Comfort -1 °C / Comfort). When the user taps it, the native picker keeps closing and reopening in a loop: it flickers (the video in the forum topic shows two copies of the picker at once, one of them fading in again) and no option can be picked. The user has to close and reopen Gladys.
The user's setup: a Z-Wave pilot wire module, plus scenes that write the mode into a text feature shown in the same box ("Chauffage Cuisine Mode").
### Likely cause (from reading the code, not reproduced on a device yet)
Two things add up:
1. **`DevicesBox` re-renders on every device event, even for features it does not show.** `updateDeviceStateWebsocket` and `updateDeviceTextWebsocket` (`front/src/components/boxs/device-in-room/DevicesBox.jsx`) call `setState` with a new array (`deviceFeatures.map(...)`) for every `device.new-state` / `device.new-string-state` message, whatever the feature. With Z-Wave devices reporting often and scenes writing text states, every Devices box on the dashboard re-renders continuously.
2. **Each render writes `select.value` again.** The widget passes `value={props.deviceFeature.last_value}`, a number (`PILOT_WIRE_MODE.COMFORT === 5`), while `dom.value` is the string `"5"`. Preact compares `5 !== "5"`, sees a difference, and sets `select.value` on every render. As far as we know, Chrome on Android hides and re-shows the native picker of an open `<select>` when its value or options are updated from script. This Chromium behavior hasn't been checked on a device, but it matches the video.
The same `value={last_value}` pattern exists in:
- `PilotWireModeDeviceFeature.jsx`
- `FanModeDeviceFeature.jsx`
- `FanLabeledSelectDeviceFeature.jsx`
- `VacuumCleanerModeDeviceFeature.jsx`
- `VacuumCleanerCleanModeDeviceFeature.jsx`
(all in `front/src/components/boxs/device-in-room/device-features/`)
The scenes and the Z-Wave module are not the cause: they only make the device events more frequent, so the picker resets more often.
### To reproduce
1. On a dashboard, add a "Devices" box with a pilot wire mode feature.
2. Have other devices sending states frequently (any sensor, or a scene writing a text feature every few seconds).
3. Open the dashboard in Chrome on Android (or the PWA) and tap the mode select.
4. The picker flickers (closes and reopens) and cannot be used.
### Expected behavior
The picker stays open until the user picks an option or dismisses it, whatever device events arrive meanwhile.
### Suggested fix
- In `DevicesBox`, skip the `setState` when the event's feature is not one of the box's features. This avoids re-rendering every box on each event, which also helps performance.
- In the select-based widgets above, pass the value as a string (`value={last_value === null ? '' : String(last_value)}` or similar), so that a render that does not change the value does not touch the DOM. This also covers an event for the shown feature arriving while the picker is open.
### Gladys Assistant version
Not given in the forum report.
### Installation type
Not given in the forum report. The issue is on the client side (Android browser / PWA).
Ich habe auch dein Thema in die richtige Kategorie verschoben, damit es nicht verloren geht