[gelöst] Alexa + homebridgeMapping für Steuerung einer Klimaanlage mit ON/OFF

Begonnen von fireball, 29 Juli 2025, 14:23:38

Vorheriges Thema - Nächstes Thema

Moli

Zitat von: passibe am 16 April 2026, 16:16:14
Zitat von: passibe am 16 April 2026, 12:14:14Vermutlich fehlt CurrentHeatingCoolingState und TargetHeatingCooolingState? Das bitte mal ausprobieren


Was steht denn da bei dir drin? off und wird übersetzt zu OFF und auto und dann übersetzt auf AUTO nehme ich an?

passibe

Zitat von: passibe am 16 April 2026, 18:15:17Ganz eventuell könntest du das Device auch mal in FHEM löschen und (ggfs. mit anderem Namen + anderem Alexa Name?) neu anlegen, vielleicht hilft das auch was. Oder das gesamte Device einfach mal kopieren und parallel ein zweites mit anderem Name und anderem Alexa Name anlegen, nur um auszuschließen, dass sich da irgendwo irgendetwas festgefahren hat. Auch wenn das wohl eher unüblich wäre.

Hattest du das mal getestet?

Jedenfalls: Ich habe mal deine Definition aus deinem letzten Post genommen: https://forum.fhem.de/index.php?msg=1362160
und etwas angepasst, vor allem ein bisschen entschlackt:
  • RegEx aus homebridgeMapping entfernt
  • nicht mehr eventMap für dieses "Automatic" nutzen, sondern "Automatic" komplett verbannen, es ist jetzt einfach immer "auto"
  • event-on-change-reading vorerst raus

Quasi eine Minimalkonfiguration:
defmod esp_klima_gaeste MQTT2_DEVICE esp_klima_gaeste
attr esp_klima_gaeste IODev MyBrokerClient
attr esp_klima_gaeste alexaName Klima Gäste
attr esp_klima_gaeste alias Klima Gäste
attr esp_klima_gaeste event-min-interval temperature:60,temperatureOutside:60
attr esp_klima_gaeste genericDeviceType thermostat
attr esp_klima_gaeste group TemperaturDG
attr esp_klima_gaeste homebridgeMapping clear\
On=mode,valueOn=/heat|cool|auto/,valueOff=off,cmdOn=mode+auto,cmdOff=mode+off\
CurrentTemperature=temperatureExt1\
TargetTemperature=target,cmd=target,minValue=16,maxValue=30\
CurrentHeatingCoolingState=mode,values=off:OFF;;cool:COOL;;heat:HEAT;;auto:AUTO\
TargetHeatingCoolingState=mode,values=off:OFF;;cool:COOL;;heat:HEAT;;auto:AUTO,cmds=OFF:mode+off;;COOL:mode+cool;;HEAT:mode+heat;;AUTO:mode+auto
attr esp_klima_gaeste readingList MyBrokerClient:esp_klima_gaeste/status:.* status\
MyBrokerClient:esp_klima_gaeste/sensor/temperatureext1/state:.* temperatureExt1\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/mode/state:.* { { mode => $EVENT, state => $EVENT } }\
MyBrokerClient:esp_klima_gaeste/sensor/panasonic_ac_power_consumption/state:.* power\
MyBrokerClient:esp_klima_gaeste/sensor/panasonic_ac_outside_temperature/state:.* temperatureOutside\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/current_temperature/state:.* temperature\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/fan_mode/state:.* fan\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/preset/state:.* preset\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/action/state:.* action\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/swing_mode/state:.* swingMode\
MyBrokerClient:esp_klima_gaeste/switch/panasonic_ac_nanoex_switch/state:.* nanoex\
MyBrokerClient:esp_klima_gaeste/climate/panasonic_ac/target_temperature/state:.* target\
MyBrokerClient:esp_klima_gaeste/select/panasonic_ac_vertical_swing_mode/state:.* v_swing\
MyBrokerClient:esp_klima_gaeste/select/panasonic_ac_horizontal_swing_mode/state:.* h_swing
attr esp_klima_gaeste room Regeln
attr esp_klima_gaeste setList mode:off,cool,heat,fan_only,dry,auto esp_klima_gaeste/climate/panasonic_ac/mode/command $EVTPART1\
target:slider,16,0.5,30,1 esp_klima_gaeste/climate/panasonic_ac/target_temperature/command $EVTPART1\
nanoex:ON,OFF esp_klima_gaeste/switch/panasonic_ac_nanoex_switch/command $EVTPART1\
swingMode:auto,up,middle,down,down_max,swing esp_klima_gaeste/climate/panasonic_ac/swing_mode/command $EVTPART1\
fan:A,1,2,3,4,5 esp_klima_gaeste/climate/panasonic_ac/fan_mode/command $EVTPART1\
v_swing:auto,up,up_center,center,down_center,down esp_klima_gaeste/select/panasonic_ac_vertical_swing_mode/command $EVTPART1\
h_swing:auto,left,right,left_center,right_center,center esp_klima_gaeste/select/panasonic_ac_horizontal_swing_mode/command $EVTPART1\
preset:Normal,Quiet,Powerful esp_klima_gaeste/climate/panasonic_ac/preset/command $EVTPART1

Damit kriege ich:

[4/18/2026, 8:38:01 PM] [FHEM] esp_klima_gaeste is thermostat
[4/18/2026, 8:38:01 PM] [FHEM] esp_klima_gaeste has
[4/18/2026, 8:38:01 PM] [FHEM]   On [mode;mode auto,mode off]
[4/18/2026, 8:38:01 PM] [FHEM]   CurrentTemperature [temperatureExt1]
[4/18/2026, 8:38:01 PM] [FHEM]   TargetTemperature [target]
[4/18/2026, 8:38:01 PM] [FHEM]   CurrentHeatingCoolingState [mode]
[4/18/2026, 8:38:01 PM] [FHEM]   TargetHeatingCoolingState [mode]
[4/18/2026, 8:38:01 PM] [FHEM] esp_klima_gaeste will not send proactive events
[4/18/2026, 8:38:01 PM] [FHEM] esp_klima_gaeste uses ID: 69e3c75a-f33f-fcd4-1d94-1c4bd94022f56375
  2026-04-18 20:38:01 caching: esp_klima_gaeste-mode: auto
  2026-04-18 20:38:01 caching: esp_klima_gaeste-temperatureExt1: 24
  2026-04-18 20:38:01 caching: esp_klima_gaeste-target: 22
und[4/18/2026, 8:38:29 PM] {
  On: {
    reading: 'mode',
    valueOn: '/heat|cool|auto/',
    valueOff: 'off',
    cmdOn: 'mode auto',
    cmdOff: 'mode off',
    device: 'esp_klima_gaeste',
    informId: 'esp_klima_gaeste-mode',
    characteristic_type: 'On',
    log: [Function: bound ] {
      debug: [Function (anonymous)],
      info: [Function (anonymous)],
      warn: [Function (anonymous)],
      error: [Function (anonymous)],
      log: [Function (anonymous)],
      prefix: 'FHEM'
    },
    characteristic: undefined
  },
  CurrentTemperature: {
    reading: 'temperatureExt1',
    device: 'esp_klima_gaeste',
    informId: 'esp_klima_gaeste-temperatureExt1',
    characteristic_type: 'CurrentTemperature',
    log: [Function: bound ] {
      debug: [Function (anonymous)],
      info: [Function (anonymous)],
      warn: [Function (anonymous)],
      error: [Function (anonymous)],
      log: [Function (anonymous)],
      prefix: 'FHEM'
    },
    characteristic: undefined
  },
  TargetTemperature: {
    reading: 'target',
    cmd: 'target',
    minValue: 16,
    maxValue: 30,
    device: 'esp_klima_gaeste',
    informId: 'esp_klima_gaeste-target',
    characteristic_type: 'TargetTemperature',
    log: [Function: bound ] {
      debug: [Function (anonymous)],
      info: [Function (anonymous)],
      warn: [Function (anonymous)],
      error: [Function (anonymous)],
      log: [Function (anonymous)],
      prefix: 'FHEM'
    },
    characteristic: undefined
  },
  CurrentHeatingCoolingState: {
    reading: 'mode',
    values: [ 'off:OFF', 'cool:COOL', 'heat:HEAT', 'auto:AUTO' ],
    device: 'esp_klima_gaeste',
    informId: 'esp_klima_gaeste-mode',
    characteristic_type: 'CurrentHeatingCoolingState',
    log: [Function: bound ] {
      debug: [Function (anonymous)],
      info: [Function (anonymous)],
      warn: [Function (anonymous)],
      error: [Function (anonymous)],
      log: [Function (anonymous)],
      prefix: 'FHEM'
    },
    value2homekit: { off: 'OFF', cool: 'COOL', heat: 'HEAT', auto: 'AUTO' },
    value2homekit_re: [],
    characteristic: undefined
  },
  TargetHeatingCoolingState: {
    reading: 'mode',
    values: [ 'off:OFF', 'cool:COOL', 'heat:HEAT', 'auto:AUTO' ],
    cmds: [
      'OFF:mode+off',
      'COOL:mode+cool',
      'HEAT:mode+heat',
      'AUTO:mode+auto'
    ],
    device: 'esp_klima_gaeste',
    informId: 'esp_klima_gaeste-mode',
    characteristic_type: 'TargetHeatingCoolingState',
    log: [Function: bound ] {
      debug: [Function (anonymous)],
      info: [Function (anonymous)],
      warn: [Function (anonymous)],
      error: [Function (anonymous)],
      log: [Function (anonymous)],
      prefix: 'FHEM'
    },
    value2homekit: { off: 'OFF', cool: 'COOL', heat: 'HEAT', auto: 'AUTO' },
    value2homekit_re: [],
    homekit2cmd: {
      OFF: 'mode off',
      COOL: 'mode cool',
      HEAT: 'mode heat',
      AUTO: 'mode auto'
    },
    homekit2cmd_re: [],
    characteristic: undefined
  }
}

Du kannst jetzt Folgendes SCHRITT FÜR SCHRITT befolgen:

1. In der Alexa-App das Gerät löschen (Gerät auswählen -> Zahnrad -> Mülltonne)
2. In FHEM das Gerät löschen.
3. alexa-fhem neu starten
4. In FHEM das Gerät neu anlegen mit der Definition so, wie ich sie oben gepostet habe.
5. Warten, bis die relevanten Readings befüllt sind bzw. diese manuell per setreading befüllen (also mode, temperatureExt1 und target)
5. alexa-fhem neu starten
6. Bei Alexa die Discovery starten
7. Testen, ob alles funktioniert

Bin gespannt, ob es damit klappt. Bitte wirklich aber die Schritte auch haargenau so durchführen.