@@ -9860,12 +9860,42 @@ class FastSearchCard extends HTMLElement {
98609860 try {
98619861 console.log(`🗑️ Timer löschen: ${timerId}`);
98629862
9863- // KORRIGIERT: Entity-ID Format schedule.{id}
9864- const scheduleEntityId = `schedule.${timerId}`;
9865- console.log(`🔍 Lösche schedule entity: ${scheduleEntityId}`);
9863+ // Debug: Schauen Sie, welche schedule-Entitäten existieren
9864+ const allEntities = Object.keys(this._hass.states);
9865+ const scheduleEntities = allEntities.filter(e => e.includes(timerId));
9866+
9867+ console.log(`🔍 Alle Entitäten mit ${timerId}:`, scheduleEntities);
9868+
9869+ // Verschiedene Format-Optionen probieren
9870+ const possibleFormats = [
9871+ `schedule.${timerId}`,
9872+ `switch.schedule_${timerId}`,
9873+ timerId,
9874+ `scheduler_${timerId}`
9875+ ];
9876+
9877+ let foundEntity = null;
9878+
9879+ for (const format of possibleFormats) {
9880+ if (this._hass.states[format]) {
9881+ foundEntity = format;
9882+ console.log(`✅ Entität gefunden: ${format}`);
9883+ break;
9884+ }
9885+ }
9886+
9887+ if (!foundEntity) {
9888+ console.error(`❌ Keine passende Entität für ${timerId} gefunden`);
9889+ console.log('🔍 Verfügbare schedule/switch Entitäten:');
9890+ allEntities.filter(e => e.startsWith('schedule.') || e.startsWith('switch.')).forEach(e => {
9891+ if (e.includes('schedule')) console.log(` - ${e}`);
9892+ });
9893+ return;
9894+ }
98669895
9896+ // Versuche zu löschen
98679897 await this._hass.callService('scheduler', 'remove', {
9868- entity_id: scheduleEntityId // ← schedule.{id} Format
9898+ entity_id: foundEntity
98699899 });
98709900
98719901 console.log(`✅ Timer ${timerId} erfolgreich gelöscht`);
0 commit comments