[gelöst] Wie steuere ich einen Satreceiver mit Alexa und IR-Blaster?

Begonnen von locodriver, 21 Juli 2021, 18:09:05

Vorheriges Thema - Nächstes Thema

locodriver

Hallo, im Titel ist meine Fragestellung umrissen...

Ich möchte einen Satreceiver von Technisat mit Alexa steuern. Leider hat er noch keine Webschnittstelle, sodass dies über den IR-Blaster geschehen muss. Die Kanalwahl habe ich über den GenericDeviceType "Thermostat" gelöst, da die Speicherplätze als Temperaturwerte verarbeitet werden können. Alexa quittiert die Ausführung dann zwar mit "xx Grad eingestellt" - aber damit kann ich gut leben (ähnliches habe ich schon an einem Ventilator am Laufen).

Nun will ich die wichtigsten Navigationsfunktionen zugänglich machen und habe - erstmal - einen weiteren Thermostat (WZ_SAT_Command) angelegt.
Die Steuerung soll dann so sein: "Alexa stelle Kommando auf grün..."
Natürlich funzt das so nicht. Mir "fehlt" so eine Art "Multi -Switch" mit x Stellungen. Die Idee, für jede Taste einen Dummy anzulegen, habe ich verworfen, da es zu viele sind. Sicher müsste der Skill erweitert werden, da fehlt mir aber einfach der "Durchblick"...

Deshalb hier die Frage, gibt es so etwas schon? Oder kann man einen anderen Ansatz verfolgen?

Hier die Defs:

Dummy:
Internals:
   CFGFN     
   DEF       
   FUUID      60f7e4d7-f33f-b425-d974-e709c93285fa2443
   NAME       WZ_Sat_Command
   NR         2273
   STATE      ???
   TYPE       dummy
   READINGS:
     2021-07-21 11:24:15   desired-temp    stumm
Attributes:
   alexaName  Kommando
   alexaProactiveEvents 1
   eventMap   on:Ein off:Aus
   genericDeviceType thermostat
   homebridgeMapping On:reading=state,cmdOn=on,cmdOff=off
   readingList desired-temp measured-temp
   room       001Wohnzimmer
   setList    on off desired-temp measured-temp stumm SFI TV aufnahme rot grün gelb blau hoch runter links rechts OK rückwärts stop pause wiedergabe play vorwärts exit info


Auswertung mit DOIF:
Internals:
   CFGFN     
   DEF        ([WZ_Sat_Command:"^desired-temp:.stumm$"]) (set IR_Blaster send IR_SAT_Mute)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.SFI$"]) (set IR_Blaster send IR_SAT_SFI)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.TV$"]) (set IR_Blaster send IR_SAT_TV)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.aufnahme$"]) (set IR_Blaster send IR_SAT_Rec)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.rot$"]) (set IR_Blaster send IR_SAT_red)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.grün$"]) (set IR_Blaster send IR_SAT_green)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.gelb$"]) (set IR_Blaster send IR_SAT_yellow)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.blau$"]) (set IR_Blaster send IR_SAT_blue)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.hoch$"]) (set IR_Blaster send IR_SAT_up)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.runter$"]) (set IR_Blaster send IR_SAT_down)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.links$"]) (set IR_Blaster send IR_SAT_left)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.rechts$"]) (set IR_Blaster send IR_SAT_right)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.OK$"]) (set IR_Blaster send IR_SAT_OK)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.rückwärts$"]) (set IR_Blaster send IR_SAT_Bckw)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.stop$"]) (set IR_Blaster send IR_SAT_Stop)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.pause$"]) (set IR_Blaster send IR_SAT_Play)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.wiedergabe$"]) (set IR_Blaster send IR_Play)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.play$"]) (set IR_Blaster send IR_SAT_Play)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.vorwärts$"]) (set IR_Blaster send IR_SAT_Ffwd)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.exit$"]) (set IR_Blaster send IR_SAT_Exit)
DOELSEIF
([WZ_Sat_Command:"^desired-temp:.info$"]) (set IR_Blaster send IR_SAT_Info)
   FUUID      60f7e6bc-f33f-b425-472a-6792c90d34bf9c41
   MODEL      FHEM
   NAME       WZ_Sat_exec
   NOTIFYDEV  global,WZ_Sat_Command
   NR         2385
   NTFY_ORDER 50-WZ_Sat_exec
   STATE      initialized
   TYPE       DOIF
   VERSION    24755 2021-07-15 16:40:59
   READINGS:
     2021-07-21 11:47:41   cmd             0
     2021-07-21 11:47:41   mode            enabled
     2021-07-21 11:47:41   state           initialized
   Regex:
     accu:
     collect:
     cond:
       WZ_Sat_Command:
         0:
           &STATE     ^WZ_Sat_Command$
         1:
           &STATE     ^WZ_Sat_Command$
         10:
           &STATE     ^WZ_Sat_Command$
         11:
           &STATE     ^WZ_Sat_Command$
         12:
           &STATE     ^WZ_Sat_Command$
         13:
           &STATE     ^WZ_Sat_Command$
         14:
           &STATE     ^WZ_Sat_Command$
         15:
           &STATE     ^WZ_Sat_Command$
         16:
           &STATE     ^WZ_Sat_Command$
         17:
           &STATE     ^WZ_Sat_Command$
         18:
           &STATE     ^WZ_Sat_Command$
         19:
           &STATE     ^WZ_Sat_Command$
         2:
           &STATE     ^WZ_Sat_Command$
         20:
           &STATE     ^WZ_Sat_Command$
         3:
           &STATE     ^WZ_Sat_Command$
         4:
           &STATE     ^WZ_Sat_Command$
         5:
           &STATE     ^WZ_Sat_Command$
         6:
           &STATE     ^WZ_Sat_Command$
         7:
           &STATE     ^WZ_Sat_Command$
         8:
           &STATE     ^WZ_Sat_Command$
         9:
           &STATE     ^WZ_Sat_Command$
   attr:
   condition:
     0          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.stumm$',1)
     1          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.SFI$',1)
     10         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.links$',1)
     11         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.rechts$',1)
     12         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.OK$',1)
     13         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.rückwärts$',1)
     14         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.stop$',1)
     15         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.pause$',1)
     16         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.wiedergabe$',1)
     17         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.play$',1)
     18         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.vorwärts$',1)
     19         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.exit$',1)
     2          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.TV$',1)
     20         ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.info$',1)
     3          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.aufnahme$',1)
     4          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.rot$',1)
     5          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.grün$',1)
     6          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.gelb$',1)
     7          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.blau$',1)
     8          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.hoch$',1)
     9          ::EventDoIf('WZ_Sat_Command',$hash,'^desired-temp:.runter$',1)
   do:
     0:
       0          set IR_Blaster send IR_SAT_Mute
     1:
       0          set IR_Blaster send IR_SAT_SFI
     10:
       0          set IR_Blaster send IR_SAT_left
     11:
       0          set IR_Blaster send IR_SAT_right
     12:
       0          set IR_Blaster send IR_SAT_OK
     13:
       0          set IR_Blaster send IR_SAT_Bckw
     14:
       0          set IR_Blaster send IR_SAT_Stop
     15:
       0          set IR_Blaster send IR_SAT_Play
     16:
       0          set IR_Blaster send IR_Play
     17:
       0          set IR_Blaster send IR_SAT_Play
     18:
       0          set IR_Blaster send IR_SAT_Ffwd
     19:
       0          set IR_Blaster send IR_SAT_Exit
     2:
       0          set IR_Blaster send IR_SAT_TV
     20:
       0          set IR_Blaster send IR_SAT_Info
     21:
     3:
       0          set IR_Blaster send IR_SAT_Rec
     4:
       0          set IR_Blaster send IR_SAT_red
     5:
       0          set IR_Blaster send IR_SAT_green
     6:
       0          set IR_Blaster send IR_SAT_yellow
     7:
       0          set IR_Blaster send IR_SAT_blue
     8:
       0          set IR_Blaster send IR_SAT_up
     9:
       0          set IR_Blaster send IR_SAT_down
   helper:
     DEVFILTER  ^global$|^WZ_Sat_Command$
     NOTIFYDEV  global|WZ_Sat_Command
     globalinit 1
     last_timer 0
     sleeptimer -1
   trigger:
     all         WZ_Sat_Command
   uiState:
   uiTable:
Attributes:
   addStateEvent 1
   do         always
   icon       it_satellite_dish
   room       001Wohnzimmer,070Audio/Video


Sicher kann man den Code an sich auch noch optimieren, aber erstmal benötige ich eine Lösung bzw. einen guten Ansatz...

Diesen "Multi-Switch" könnte ich auch noch für andere Geräte gebrauchen. Der Typ "Scene" kommt mir dabei noch in den Sinn, ich habe aber keine Ahnung, ob er hier funzen würde (da gibt es doch u.a. eine Beschrankung auf 12).

Danke für eure Ideen.
Falls noch Infos fehlen - bitte fragen.

Uwe
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

ReviloEgros

Ich steuere meinen Receiver über einen Dummy, auf welchen ich dann per Notify reagiere.

defmod dreambox_dummy dummy
attr dreambox_dummy alexaName Fernseher
attr dreambox_dummy alias DM900UHD Dummy
attr dreambox_dummy genericDeviceType media
attr dreambox_dummy group Fernseher
attr dreambox_dummy homebridgeMapping InputController:reading=input,cmd=input Volume:reading=volume,cmd=volume Mute:reading=mute,cmd=mute PlaybackController:reading=playback,values=Play;;Pause;;Stop;;Record;;Previous;;Next,cmd=playback ChannelController:reading=channel,cmd=channel
attr dreambox_dummy icon rc_MEDIAMENU
attr dreambox_dummy oldreadings volume
attr dreambox_dummy readingList volume mute playback channel input
attr dreambox_dummy room 01_Wohnzimmer
attr dreambox_dummy setList on off volume mute channel input playback

MadMax-FHEM

Naja zuerst einmal ist wichtig zu verstehen, dass:

nur geht (sprachlich) was Amazon/Alexa auch versteht!!

Man kann nicht einfach sprechen was man möchte und dann kommt der Text irgendwo an...
...sondern Amazon analysiert und gibt nur "Steuerbefehle" an den Skill weiter.

D.h. erst mal schauen bei AMAZON! was geht, Link im Connector Wiki (oder hier: https://developer.amazon.com/es-ES/docs/alexa/device-apis/list-of-interfaces.html)

Wenn man ein passendes "Interface" gefunden hat, dann muss man eben sehen, wie das (u.U. mittels homebridgeMapping) alexa-fhem "beizubringen" ist.
Vieles geht "out of the box", manches braucht etwas "Unterstützung"...

Steht auch so im Wiki: https://wiki.fhem.de/wiki/FHEM_Connector_f%C3%BCr_Amazon_Alexa#Ger.C3.A4te_im_FHEM-Webfrontend_zuweisen

Auch, dass man mittels homebridgeMapping NICHT neue Sätze/Anweisungen "erfinden" kann.


Was noch geht und dann ist man praktisch "komplett frei": Custom Skill!

Geht auch parallel mit alexa-fhem Connector, dann "einfach" die Daten bzgl. Custom Skill in die alexa-fhem.cfg eintragen und nat. den Port öffnen/weiterleiten und (eh klar) natürlich einen Custom Skill bei Amazon AWS anlegen etc.

Aber: die Anleitung im Wiki ist schon sehr alt und Amazon hat mitlerweile die AWS Seiten etc. (bestimmt mehrfach) verändert...

Soll heißen: ist nicht wirklich einfach und man muss sich (verm.) selbst "durchkämpfen", weil es hier kaum jemanden gibt/geben dürfte, der "kürzlich" einen Custom Skill angelegt hat und auch nicht wirklich viele die noch einen betreiben.
(Dazu gehöre ich auch, hatte mal einige Custom Skills aber schon lange "außer Dienst gestellt")

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

locodriver

#3
Danke für die beiden Antworten - auch wenn sie mein Anliegen - wie ich schon befürchtet hatte - nicht lösen.

Das Gerät als media-Typ anzulegen, passt nicht so einfach, da die Anzahl der benötigten Befehle, um den Receiver sinnvoll bedienen zu können, zu groß ist (bei mir hier 21).
Und ein Costom Skill ist wirklich eine Herausforderung... ich hatte mich da auch mal versucht einzulesen, aber ich habe dann "den Faden verloren" und kapituliert.

Vielleicht erweitert Amazon irgendwann mal die unterstützten Geräte...
Oder man müsste vor der Übergabe der Befehle an Alexa diese irgendwie mappen (z.B. auf Temperaturen oder Prozent - da wären ausreichend Befehle möglich). Da die Befehle aber unmittelbar von Alexa verarbeitet werden, wird das wohl auch nicht klappen...

Ich habe gerade nochmal den Link bei Amazon durchforstet: der Skill "ModeController" scheint meinen Anforderungen am nächsten zu kommen... Hat den hier schon ein User in Benutzung? Die Beschreibung ist ziemlich umfangreich - ehe ich mir etwas "zerlege", wäre ein funktionierendes Beispiel für eine Umsetzung in fhem eine gute Unterstützung.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

MadMax-FHEM

#4
Naja, was noch geht aber ist Aufwand:

Für jeden Befehl eine Routine anlegen.
Da kannst du ja dann angeben was du sagen willst bzw. dann aber auch GENAU SO "sagen musst".

Dann kannst du ja am Ende jeder Routine z.B. einen "Licht-Dummy" auf eine andere Prozentzahl schalten und mit einem DOIF etc. dann bei jedem Prozent einen anderen Befehl starten.

Beispiel(e):

R1: "Alexa stelle Kommando auf grün" -> schalte dmAlexaRoutine auf 1%

R2: "Alexa stelle Kommando auf blau" -> schalte dmAlexaRoutine auf 2%

R3: "Alexa stelle Kommando auf rot" -> schalte dmAlexaRoutine auf 3%

Und dann eben ein DOIF o.ä. wo du eben je nachdem wie der dmAlexaRoutine geschalten wird, also auf wieviel Prozent den dazu passenden Befehl...

dmAlexaRoutine wäre dann eben z.B. ein dummy genericDeviceType light und mit den settern on/off/dim

RawDef:

defmod dmAlexaRoutine dummy
attr dmAlexaRoutine alexaName alexaRoutine
attr dmAlexaRoutine comment 0 - nichts\
1 - check Wohnung
attr dmAlexaRoutine genericDeviceType light
attr dmAlexaRoutine homebridgeMapping Brightness=dim,cmd=dim On=state,valueOn=on,valueOff=off
attr dmAlexaRoutine readingList dim
attr dmAlexaRoutine room alexa
attr dmAlexaRoutine setList on off dim

setstate dmAlexaRoutine on
setstate dmAlexaRoutine 2021-03-20 13:34:17 dim 1
setstate dmAlexaRoutine 2020-11-24 14:38:56 state on


Inkl. der setstate! Oder selber die Readings "anlegen" damit alexa-fhem das korrekt erkennt.

Allerdings reagiere ich auf die einzelnen Prozente mittels "spezifischen" notify...
...und: es war (wie so vieles) nur "Spielerei"...

Hatte keine Lust so viele Routinen "reinzuklopfen"... ;)

EDIT: es gibt im Forum (denke ich) auch ein Beispiel inkl. passendes DOIF...
https://forum.fhem.de/index.php/topic,111280.msg1054941.html#msg1054941
https://forum.fhem.de/index.php/topic,109973.msg1040118.html#msg1040118

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

locodriver

So etwas in der Art habe ich auch gerade noch gefunden: https://forum.fhem.de/index.php/topic,104685.msg986710.html#msg986710

Das scheint mir ein guter Kompromiss zwischen Nutzbarkeit und Aufwand.
Ich werde das mal mit ein paar Funktionen testen...

@MadMax-FHEM: Danke für die beiden Links und die Erleuterungen.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

locodriver

Ich möchte noch meine Umsetzung zeigen und dann das Thema - für mich - als erledigt ansehen.

Danke nochmal an die User, die mir mit ihren Tipps auf die Sprünge geholfen haben.

Den Sat-Receiver habe ich zur Bedienung per Alexa und IR-Blaster in zwei Geräte aufgeteilt.
Das erste realisiert die Programmwahl, die habe ich über den GDT "Thermostat" gelöst, da nur ganze Zahlen vorkommen und man sich die Arbeit mit Alexaroutinen sparen kann. Der Aufruf erfolgt mit: "Alexa, stelle Programm auf xx" - ihre Antwort lautet dann - wie schon geschrieben - "xx Grad eingestellt".

Der dummy:
defmod WZ_Sat_Rec dummy
attr WZ_Sat_Rec alexaName Programm
attr WZ_Sat_Rec alexaProactiveEvents 1
attr WZ_Sat_Rec eventMap on:Ein off:Aus
attr WZ_Sat_Rec genericDeviceType thermostat
attr WZ_Sat_Rec homebridgeMapping On:reading=state,cmdOn=on,cmdOff=off
attr WZ_Sat_Rec readingList desired-temp measured-temp
attr WZ_Sat_Rec room 001Wohnzimmer
attr WZ_Sat_Rec setList on off desired-temp measured-temp 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 Ein Aus

setstate WZ_Sat_Rec Aus
setstate WZ_Sat_Rec 2021-07-27 20:19:49 desired-temp 5
setstate WZ_Sat_Rec 2021-07-21 23:31:26 state off



Das DOIF:

defmod WZ_Sat_switch DOIF ([WZ_Sat_Rec:"^desired-temp:.1$"]) (set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.2$"]) (set IR_Blaster send IR_SAT_2)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.3$"]) (set IR_Blaster send IR_SAT_3)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.4$"]) (set IR_Blaster send IR_SAT_4)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.5$"]) (set IR_Blaster send IR_SAT_5)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.6$"]) (set IR_Blaster send IR_SAT_6)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.7$"]) (set IR_Blaster send IR_SAT_7)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.8$"]) (set IR_Blaster send IR_SAT_8)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.9$"]) (set IR_Blaster send IR_SAT_9)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.10$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_0)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.11$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.12$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_2)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.13$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_3)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.14$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_4)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.15$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_5)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.16$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_6)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.17$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_7)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.18$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_8)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.19$"]) (set IR_Blaster send IR_SAT_1)(set IR_Blaster send IR_SAT_9)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.20$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_0)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.21$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.22$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_2)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.23$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_3)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.24$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_4)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.25$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_5)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.26$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_6)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.27$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_7)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.28$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_8)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.29$"]) (set IR_Blaster send IR_SAT_2)(set IR_Blaster send IR_SAT_9)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.30$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_0)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.31$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.32$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_2)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.33$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_3)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.34$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_4)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.35$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_5)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.36$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_6)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.37$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_7)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.38$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_8)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.39$"]) (set IR_Blaster send IR_SAT_3)(set IR_Blaster send IR_SAT_9)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.40$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_0)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.41$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.42$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_2)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.43$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_3)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.44$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_4)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.45$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_5)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.46$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_6)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.47$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_7)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.48$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_8)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.49$"]) (set IR_Blaster send IR_SAT_4)(set IR_Blaster send IR_SAT_9)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.50$"]) (set IR_Blaster send IR_SAT_5)(set IR_Blaster send IR_SAT_0)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.51$"]) (set IR_Blaster send IR_SAT_5)(set IR_Blaster send IR_SAT_1)\
DOELSEIF\
([WZ_Sat_Rec:"^desired-temp:.0$"]) (set IR_Blaster send IR_SAT_0)\

attr WZ_Sat_switch addStateEvent 1
attr WZ_Sat_switch do always
attr WZ_Sat_switch icon it_satellite_dish
attr WZ_Sat_switch room 001Wohnzimmer,070Audio/Video
attr WZ_Sat_switch wait 0:0:0:0:0:0:0:0:0:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0,1

setstate WZ_Sat_switch cmd_5
setstate WZ_Sat_switch 2021-07-27 20:19:49 Device WZ_Sat_Rec
setstate WZ_Sat_switch 2021-07-27 20:19:49 cmd 5
setstate WZ_Sat_switch 2021-07-27 20:19:49 cmd_event WZ_Sat_Rec
setstate WZ_Sat_switch 2021-07-27 20:19:49 cmd_nr 5
setstate WZ_Sat_switch 2021-07-27 20:19:49 e_WZ_Sat_Rec_events desired-temp: 5
setstate WZ_Sat_switch 2021-07-21 11:53:44 mode enabled
setstate WZ_Sat_switch 2021-07-27 20:19:49 state cmd_5
setstate WZ_Sat_switch 2021-07-21 12:00:51 wait_timer no timer



Die anderen Funktionen habe ich mit dem GDT "light" und den Dimmerwerten umgesetzt. Hier ist dann für jede Funktion eine Alexaroutine notwendig: "Alexa, stelle SAT auf grün" -> die Alexaaktion ist in diesem Fall: "Kommando Helligkeit 6%".

Der dummy:

defmod WZ_Sat_Command dummy
attr WZ_Sat_Command alexaName Kommando
attr WZ_Sat_Command alexaProactiveEvents 1
attr WZ_Sat_Command eventMap on:Ein off:Aus
attr WZ_Sat_Command genericDeviceType light
attr WZ_Sat_Command homebridgeMapping Brightness=dim,cmd=dim On=state,valueOn=on,valueOff=off
attr WZ_Sat_Command readingList dim
attr WZ_Sat_Command room 001Wohnzimmer
attr WZ_Sat_Command setList on off dim

setstate WZ_Sat_Command Ein
setstate WZ_Sat_Command 2021-07-26 20:00:26 dim 6
setstate WZ_Sat_Command 2020-11-24 14:38:56 state on



Das DOIF:

defmod WZ_Sat_exec DOIF ([WZ_Sat_Command:"^dim:.1$"]) (set IR_Blaster send IR_SAT_Mute)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.2$"]) (set IR_Blaster send IR_SAT_SFI)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.3$"]) (set IR_Blaster send IR_SAT_TV)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.4$"]) (set IR_Blaster send IR_SAT_Rec)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.5$"]) (set IR_Blaster send IR_SAT_red)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.6$"]) (set IR_Blaster send IR_SAT_green)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.7$"]) (set IR_Blaster send IR_SAT_yellow)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.8$"]) (set IR_Blaster send IR_SAT_blue)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.9$"]) (set IR_Blaster send IR_SAT_up)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.10$"]) (set IR_Blaster send IR_SAT_down)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.11$"]) (set IR_Blaster send IR_SAT_left)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.12$"]) (set IR_Blaster send IR_SAT_right)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.13$"]) (set IR_Blaster send IR_SAT_OK)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.14$"]) (set IR_Blaster send IR_SAT_Bckw)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.15$"]) (set IR_Blaster send IR_SAT_Stop)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.16$"]) (set IR_Blaster send IR_SAT_Play)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.17$"]) (set IR_Blaster send IR_Play)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.18$"]) (set IR_Blaster send IR_SAT_Play)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.19$"]) (set IR_Blaster send IR_SAT_Ffwd)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.20$"]) (set IR_Blaster send IR_SAT_Exit)\
DOELSEIF\
([WZ_Sat_Command:"^dim:.21$"]) (set IR_Blaster send IR_SAT_Info)

attr WZ_Sat_exec addStateEvent 1
attr WZ_Sat_exec do always
attr WZ_Sat_exec icon it_satellite_dish
attr WZ_Sat_exec room 001Wohnzimmer,070Audio/Video

setstate WZ_Sat_exec cmd_6
setstate WZ_Sat_exec 2021-07-26 20:00:26 Device WZ_Sat_Command
setstate WZ_Sat_exec 2021-07-28 10:33:48 cmd 0
setstate WZ_Sat_exec 2021-07-26 20:00:26 cmd_event WZ_Sat_Command
setstate WZ_Sat_exec 2021-07-26 20:00:26 cmd_nr 6
setstate WZ_Sat_exec 2021-07-26 20:00:26 e_WZ_Sat_Command_events dim: 6
setstate WZ_Sat_exec 2021-07-28 10:33:48 mode enabled
setstate WZ_Sat_exec 2021-07-28 10:33:48 state initialized



Das funzt für meine Ansprüche sehr gut.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

MadMax-FHEM

#7
Zitat
Das erste realisiert die Programmwahl, die habe ich über den GDT "Thermostat" gelöst, da nur ganze Zahlen vorkommen und man sich die Arbeit mit Alexaroutinen sparen kann. Der Aufruf erfolgt mit: "Alexa, stelle Programm auf xx" - ihre Antwort lautet dann - wie schon geschrieben - "xx Grad eingestellt".

Eventuell mal genericDeviceType "media" anschauen.
Da wird die an Alexa angesagte Kanalnummer direkt in ein Reading geschrieben, damit sparst du dir die DOIF-Orgel ;)

Hier mal eine RAW-Def meines media-dummy (inkl. setstate eingeben oder Readings volume, channel etc. selbst anlegen):


defmod dmControl_MediaBox dummy
attr dmControl_MediaBox alexaName media box
attr dmControl_MediaBox alias Mediabox
attr dmControl_MediaBox comment Wechsel auf media box auf Kanal Nummer | Name\
Nächsten Kanal auf media box\
Mach media box lauter\
Mach media box leiser\
Schalte media box stumm | Schalte den Ton von media box aus\
Schalte media box wieder lauter | Schalte den Ton von media box wieder an\
Wiedergabe von media box fortsetzen | starten?\
Wiedergabe von media box pausieren | pause\
Wiedergabe von media box stoppen
attr dmControl_MediaBox genericDeviceType media
attr dmControl_MediaBox group Multimedia
attr dmControl_MediaBox homebridgeMapping PlaybackController:reading=playback,values=Play;;Pause;;Stop;;Previous;;Next,cmd=playback ChannelController:reading=channel,cmd=channel
attr dmControl_MediaBox icon rc_MEDIAMENU
attr dmControl_MediaBox oldreadings volume
attr dmControl_MediaBox readingList volume mute playback channel
attr dmControl_MediaBox room Wohnzimmer,alexa
attr dmControl_MediaBox setList playback:Play,Pause on off volume mute:0,1 channel:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
attr dmControl_MediaBox stateFormat channel
attr dmControl_MediaBox webCmd :

setstate dmControl_MediaBox 2
setstate dmControl_MediaBox 2021-04-19 19:39:22 channel 2
setstate dmControl_MediaBox 2021-02-18 21:10:37 mute 0
setstate dmControl_MediaBox 2021-06-08 20:00:17 playback Play
setstate dmControl_MediaBox 2021-07-27 01:33:50 state off
setstate dmControl_MediaBox 2021-05-25 20:20:15 volume 90


Ich habe dann ein notify.
Das zu posten macht aber kaum Sinn, da ich eine myUtils aufrufe wo ich noch weitere Dinge tue.
Das oldReadings volume brauche ich, um bei Lauter/Leiser etc. meine "Sprungweite" zu "berechnen" etc. kannst du (verm.) weglassen.

Für die Kanalumschaltung reicht (verm.) ein simples notify in etwa so (ungetestet und nur "beispielhaft"):


define nChannel notify dmControl_MediaBox:channel.* set Receiver channel $EVENT


EDIT: ok du kannst ja nicht einfach die Kanalnummer weitergeben, dann evtl. so:

define nChannel notify dmControl_MediaBox:channel.* {fhem("set IR_Blaster send IR_SAT_".$EVENT)}

(könnte statt $EVENT auch $EVTPART1 oder so sein)

Aber wenn es für dich mit Thermometer passt und dich die "komische" Rückmeldung von Alexa nicht stört: have fun ;)

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

locodriver

@Joachim: Danke für deinen nochmaligen Post.

Das werde ich mir noch in Ruhe ansehen, jetzt wird erstmal der Urlaub vorbereitet...
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

MadMax-FHEM

Zitat von: locodriver am 28 Juli 2021, 11:35:07
@Joachim: Danke für deinen nochmaligen Post.

Das werde ich mir noch in Ruhe ansehen, jetzt wird erstmal der Urlaub vorbereitet...

Gerne.

Schönen Urlaub!

Äh, die "komplizierte" setList muss auch nicht.
Lasse ich normalerweise beim Posten auch weg bzw. reduziere ich sie auf's Nötigste...
...so kann man aber auch per dropDown wählen/einstellen.

Aber wie geschrieben bin ich nicht sicher wie das bei dir geht/gehen kann, da du ja noch die "Umsetzung" auf IR-Kommandos hast/brauchst...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)