Advertisement
__Dave__

Alexa Status Waschmaschine

Feb 4th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. val Number STATE_OFF = 0
  2. val Number STATE_STANDBY = 1
  3. val Number STATE_ACTIVE = 2
  4. val Number STATE_FINISHED = 3
  5. var logName = "waschmaschine.rules"
  6.  
  7. rule "Alexa Status Waschmaschine"
  8. when
  9.     Item AlexaStatusWaschmachine received command ON
  10. then
  11.     logInfo(logName, "current state: " + Waschmaschine_Status.state)
  12.     switch (Waschmaschine_Status.state) {
  13.         case STATE_OFF: {
  14.             EchoUeberallTTS.sendCommand("Die Waschmaschine ist ausgeschaltet.")
  15.         }
  16.         case STATE_STANDBY: {
  17.             EchoUeberallTTS.sendCommand("Die Waschmaschine befindet sich im Bereitschaftsmodus.")
  18.         }
  19.         case STATE_ACTIVE: {
  20.             EchoUeberallTTS.sendCommand("Die Waschmaschine lΓΆuft gerade.")
  21.         }
  22.         case STATE_FINISHED: {
  23.             EchoUeberallTTS.sendCommand("Die Waschmaschine ist fertig.")
  24.         }
  25.         default: {
  26.             EchoUeberallTTS.sendCommand("Der aktuelle Status der Waschmaschine ist mir nicht bekannt.")
  27.         }
  28.     }
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement