Sorry I don’t use RulesDSL anymore so I haven’t tested it. Try enclosing the thinguid in double quotes like this:
when
Thing "daikin:airbase_ac_unit:DaikinAP12345" changed from ONLINE
Sorry I don’t use RulesDSL anymore so I haven’t tested it. Try enclosing the thinguid in double quotes like this:
when
Thing "daikin:airbase_ac_unit:DaikinAP12345" changed from ONLINE
Try:
Channel "daikin:airbase_ac_unit:DaikinAP12345" changed from ONLINE
You’re using the channel name, not the Thing name…
it accepts quotes but sorry I’m confused what is the “Channel” should I use that instead?
currently:
Thing “daikin:airbase_ac_unit:DaikinAP60751” changed from ONLINE
Just try the Thing offline first and see how it goes.
Still on 2.4, cant beat it for stability. 2.5 - no where near stable enough in my view
AFAIK 2.5 is far better than 2.4. There are many things that got fixed in 2.5, the absolute major thing being the MQTT stuff. I would not want to go back to 2.4, that’s for sure.
I’ve never had an issue with MQTT on 2.4, rock solid. Infact, I use it for its Bus capability to link 2 x OpenHABs. The only reason id want to upgrade is to fix the refresh issue in the Daikin binding
The mqtt on 2.4 has non functioning outgoingtransformation amongst other things. Afaik it also doesn’t support tranformation chaining. If you aren’t using any of that, then you won’t care
Gents,anyone seen this? Just started happening today.
Seems to be related to the rules Jim I used of yours, that ‘off change’ appears to be doing it. I removed it. Seems OK again.
Had to restart openhab, as it starts to turn the item on/off thousands of times!
21:22:42.934 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.daikin.internal.handler.DaikinAcUnitHandler@4e0c7491': No enum constant org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseMode.OFF
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums.AirbaseMode.OFF
at java.lang.Enum.valueOf(Enum.java:238) ~[?:?]
at org.openhab.binding.daikin.internal.api.airbase.AirbaseEnums$AirbaseMode.valueOf(AirbaseEnums.java:1) ~[?:?]
at org.openhab.binding.daikin.internal.handler.DaikinAcUnitHandler.handleCommandInternal(DaikinAcUnitHandler.java:126) ~[?:?]
at org.openhab.binding.daikin.internal.handler.DaikinAcUnitHandler.handleCommand(DaikinAcUnitHandler.java:78) ~[?:?]
at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at com.sun.proxy.$Proxy193.handleCommand(Unknown Source) [281:org.openhab.binding.daikin:2.5.0.201911100837]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
I’ve created a small patch / PR to improve the handling of invalid values.
Only works on 2.5
Why would off be invalid ?
Please post your rules so we’re discussing the same thing.
The channel “mode” for the binding allows: COLD, HEAT, FAN, DRY, AUTO
To turn the aircon on/off, you use the channel “power”
Don’t confuse it with the “Alexa” / Google Assistant “mode” which is not the same as binding’s mode. Alexa/google assistant’s mode is a hybrid mode that allows “off, on, cool, heat, auto, coolheat”.
This is the reason why you need to write a rule to translate the binding mode/power which is held in two channels / items, into one item that’s compatible with alexa and vice versa.
Ahhh! I have a switch item for the binding but I wanted to be able to turn the unit on/off by using the thermostat controller. So effectively I never wanted to use the SWITCH
String DaikinACUnit_Mode "Mode" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:mode", alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO",OFF="OFF"] }
Switch DaikinACUnit_Power "AC" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:power", alexa="PowerController.powerState"}
rule "Update Aircon Mode"
when
Item DaikinACUnit_Mode changed
or
Item DaikinACUnit_Power changed
then
if (DaikinACUnit_Power.state == OFF) {
Aircon_Mode_Alexa.sendCommand("off")
return
}
switch (DaikinACUnit_Mode.toString) {
case "COLD": Aircon_Mode_Alexa.sendCommand("cool")
case "HEAT": Aircon_Mode_Alexa.sendCommand("heat")
case "AUTO": Aircon_Mode_Alexa.sendCommand("auto")
case "FAN",
case "DEHUMIDIFIER": Aircon_Mode_Alexa.sendCommand("on")
}
end
rule "Received changes from Alexa mode"
when
Item Aircon_Mode_Alexa received update
then
var command = ""
switch (Aircon_Mode_Alexa.state.toString) {
case "off": DaikinACUnit_Power.sendCommand(OFF)
case "on": DaikinACUnit_Power.sendCommand(ON)
case "cool": command = "COLD"
case "auto": command = "AUTO"
case "heat": command = "HEAT"
}
if (command != "") {
if (DaikinACUnit_Power.state != ON) {
DaikinACUnit_Power.sendCommand(ON)
}
DaikinACUnit_Mode.sendCommand(command)
}
end
String DaikinACUnit_Mode "Mode" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:mode", alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO",OFF="OFF"] }
This is the problem.
Remove the alexa metadata from the mode.
You need a String item called “Aircon_Mode_Alexa” and attach the metadata on it.
String DaikinACUnit_Mode "Mode" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:mode" }
String Aircon_Mode_Alexa "Alexa Aircon Mode" (Daikin_Thermostat) { alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO",OFF="OFF"] }
I presume your “Daikin_Thermostat” group is the one with alexa="Endpoint.Thermostat"
metadata…?
Hi Jim
Yes, correct, the group has the Endpoint.Thermostat on it. Updaitng the items, now the modes dont change (from heat to cool for example)
Group Daikin_Thermostat "Air" {alexa="Endpoint.Thermostat"}
Number DaikinACUnit_SetPoint "Temperature" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:settemp", alexa="ThermostatController.targetSetpoint" }
String DaikinACUnit_Mode "Mode" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:mode" }
String DaikinACUnit_Fan "Fan Speed" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:airbasefanspeed", alexa="ModeController.mode" [supportedModes="AUTO=Auto,LEVEL_1=@Value.Low,LEVEL_2=@Value.Medium,LEVEL_3=@Value.High"] }
Number DaikinACUnit_IndoorTemp "Inside Temp" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:indoortemp", alexa="TemperatureSensor.temperature" }
String Aircon_Mode_Alexa "Mode" (Daikin_Thermostat) { alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO",OFF="OFF"] }
This is correct but you haven’t got the daikin power item (Switch) yet. This should not have alexa metadata. After that you just need the rules to link Aircon_Mode_Alexa with DaikinACUnit_Mode and the daikin power item together.
Sorry, yes I do but its not in the group
Switch DaikinACUnit_Power "AC" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:power", alexa="PowerController.powerState"}
Switch DaikinACUnit_Zone1 "Front Room Zone" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:zone1", alexa="PowerController.powerState"}
Switch DaikinACUnit_Zone2 "Study Zone" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:zone2", alexa="PowerController.powerState"}
Switch DaikinACUnit_Zone3 "Bedroom Zone" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:zone3", alexa="PowerController.powerState"}
Switch DaikinACUnit_Zone4 "Living Zone" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:zone4", alexa="PowerController.powerState"}
Group Daikin_Thermostat "Air" {alexa="Endpoint.Thermostat"}
Number DaikinACUnit_SetPoint "Temperature" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:settemp", alexa="ThermostatController.targetSetpoint" }
String DaikinACUnit_Mode "Mode" (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:mode" }
String DaikinACUnit_Fan "Fan Speed" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:airbasefanspeed", alexa="ModeController.mode" [supportedModes="AUTO=Auto,LEVEL_1=@Value.Low,LEVEL_2=@Value.Medium,LEVEL_3=@Value.High"] }
Number DaikinACUnit_IndoorTemp "Inside Temp" (Group_HabPanel_Dashboard,Daikin_Thermostat) { channel="daikin:airbase_ac_unit:ducted_ac:indoortemp", alexa="TemperatureSensor.temperature" }
String Aircon_Mode_Alexa "Mode" (Daikin_Thermostat) { alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO",OFF="OFF"] }
Rules
rule "Update Aircon Mode"
when
Item DaikinACUnit_Mode changed
or
Item DaikinACUnit_Power changed
then
if (DaikinACUnit_Power.state == OFF) {
Aircon_Mode_Alexa.sendCommand("off")
return
}
switch (DaikinACUnit_Mode.toString) {
case "COLD": Aircon_Mode_Alexa.sendCommand("cool")
case "HEAT": Aircon_Mode_Alexa.sendCommand("heat")
case "AUTO": Aircon_Mode_Alexa.sendCommand("auto")
case "FAN",
case "DEHUMIDIFIER": Aircon_Mode_Alexa.sendCommand("on")
}
end
rule "Received changes from Alexa mode"
when
Item Aircon_Mode_Alexa received update
then
var command = ""
switch (Aircon_Mode_Alexa.state.toString) {
case "off": DaikinACUnit_Power.sendCommand(OFF)
case "on": DaikinACUnit_Power.sendCommand(ON)
case "cool": command = "COLD"
case "auto": command = "AUTO"
case "heat": command = "HEAT"
}
if (command != "") {
if (DaikinACUnit_Power.state != ON) {
DaikinACUnit_Power.sendCommand(ON)
}
DaikinACUnit_Mode.sendCommand(command)
}
end
Slight changes below. Alexa uses upper case strings, unlike google assistant
rule "Update Aircon Mode"
when
Item DaikinACUnit_Mode changed
or
Item DaikinACUnit_Power changed
then
if (DaikinACUnit_Power.state == OFF) {
Aircon_Mode_Alexa.sendCommand("OFF")
return
}
switch (DaikinACUnit_Mode.toString) {
case "COLD": Aircon_Mode_Alexa.sendCommand("COOL")
case "HEAT": Aircon_Mode_Alexa.sendCommand("HEAT")
case "AUTO": Aircon_Mode_Alexa.sendCommand("AUTO")
}
end
rule "Received changes from Alexa mode"
when
Item Aircon_Mode_Alexa received update
then
var command = ""
switch (Aircon_Mode_Alexa.state.toString.toUpperCase) {
case "OFF": DaikinACUnit_Power.sendCommand(OFF)
case "ON": DaikinACUnit_Power.sendCommand(ON)
case "COOL": command = "COLD"
case "AUTO": command = "AUTO"
case "HEAT": command = "HEAT"
}
if (command != "") {
if (DaikinACUnit_Power.state != ON) {
DaikinACUnit_Power.sendCommand(ON)
}
DaikinACUnit_Mode.sendCommand(command)
}
end
Thanks Jim, does the String item with the daikin binding channel still need to be part of the Group? Whilst the Proxy item changes mode, its not changing the real channel bound item
No
Try this rule instead:
rule "Received changes from Alexa mode"
when
Item Aircon_Mode_Alexa received update
then
if (Aircon_Mode_Alexa.state.toString == "OFF") {
DaikinACUnit_Power.sendCommand(OFF)
} else {
if (DaikinACUnit_Power.state != ON) {
DaikinACUnit_Power.sendCommand(ON)
}
DaikinACUnit_Mode.sendCommand(Aircon_Mode_Alexa.state.toString)
}
end