ich habe hardwaretechnisch folgendes Projekt umgesetzt https://github.com/absalom-muc/MHI-AC-Ctrl um meine Klimaanlage von
openHAB 4 aus über MQTT zu steuern. Probleme habe ich nur beim Ein-und Ausschalten mit dem Item "Aircondition_Power".
Wiederrum funktioniert das Ein-und Ausschalten im MQTT-Explorer und MQTT.fx durch Eingabe des Topics MHI-AC-Ctrl-Wz/Wohnzimmer/set/Power mit dem Befehl On oder Off einwandfrei. Die Schreibweise: ON oder OFF funktioniert nicht !
Die drei nachfolgenden items funktionieren auch einwandfrei (Aircondition_Status,String Aircondition_Fanspeed, String Aircondition_Vanes).
Konfiguration:
klimaanlage.things
Code: Alles auswählen
Thing topic MHI-AC-CTRL-WZ "Klimaanlage" @ "Wohnzimmer" {
Channels:
Type string : power "Power" [ stateTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/Power", commandTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/set/Power" ]
Type string : status "Status" [ stateTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/Mode", commandTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/set/Mode" ]
Type string : fanspeed "Fanspeed" [ stateTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/Fan", commandTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/set/Fan" ]
Type string : vanes "Vanes" [ stateTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/Vanes", commandTopic="MHI-AC-Ctrl-Wz/Wohnzimmer/set/Vanes" ]
}
Code: Alles auswählen
Switch Aircondition_Power "Power [%s]" { channel="mqtt:topic:mosquitto:MHI-AC-CTRL-WZ:power"}
String Aircondition_Status "Status [%s]" { channel="mqtt:topic:mosquitto:MHI-AC-CTRL-WZ:status"}
String Aircondition_Fanspeed "Fanspeed [%s]" { channel="mqtt:topic:mosquitto:MHI-AC-CTRL-WZ:fanspeed" }
String Aircondition_Vanes "Vanes [%s]" { channel="mqtt:topic:mosquitto:MHI-AC-CTRL-WZ:vanes" }
Code: Alles auswählen
Frame label="Klimaanlage" icon=climate {
Switch item=Aircondition_Power
Selection item=Aircondition_Status icon=climate mappings=["Off"="Aus", "Dry"="Trocknen", "Cool"="Kühlen", "Heat"="Heizen", "Fan"="Lüfter", "On"="An"]
Setpoint item=Aircondition_Fanspeed icon=fan minValue=1 maxValue=4 step=1
Selection item=Aircondition_Vanes icon=smoke mappings=[1="Pos 1 (hoch)", 2="Pos 2", 3="Pos 3", 4="Pos 4 (runter)", "Swing"="Swing"]
}
Code: Alles auswählen
20:16:37.118 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Aircondition_Power' received command ON
20:16:37.118 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Aircondition_Power' predicted to become ON
20:16:37.119 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Aircondition_Power' changed from OFF to ON
oder
20:16:39.039 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Aircondition_Power' received command OFF
20:16:39.039 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Aircondition_Power' predicted to become OFF
20:16:39.040 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Aircondition_Power' changed from ON to OFF
Code: Alles auswählen
#define HOSTNAME "MHI-AC-Ctrl-Wz"
#define MQTT_PREFIX HOSTNAME "/Wohnzimmer/" // basic prefix used for publishing AC data (e.g. for status),
// replace "/" by e.g. "/Living-Room/" when you have multiple ACs
#define MQTT_SET_PREFIX MQTT_PREFIX "set/" // prefix for subscribing set commands, must end with a "/"
Gruß
Carsten