Max Binding Thermostat Mode with HomeKit Automations issues

Hey There,

I just started to Build my SmartHome with openhab and added my MAX Thermostats with the binding. With updating hap to Version 1.1.4 and openhab to 2.2 unstable I am now able change the Mode of my Thermostats with HomeKit.

But when i run an automation in HomeKit it allways Sets the mode after Setting the Target Temperature. With that Mode command my Temperature is reset to the modes default.

My Log Shows this:
23:50:35.507 [INFO ] [hap.impl.http.HomekitClientConnection] - 204 /characteristics
23:50:35.516 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘BZSetTemp’ received command 19.0
23:50:35.519 [INFO ] [.impl.connections.SubscriptionManager] - Publishing changes for 101748
23:50:35.525 [INFO ] [smarthome.event.ItemStateChangedEvent] - BZSetTemp changed from 17.0 to 19.0
23:50:35.536 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘BZMode’ received command BOOST
23:50:35.540 [INFO ] [.impl.connections.SubscriptionManager] - Publishing changes for 101748
23:50:35.544 [INFO ] [.impl.connections.SubscriptionManager] - Publishing changes for 101748
23:50:35.551 [INFO ] [smarthome.event.ItemStateChangedEvent] - BZMode changed from AUTOMATIC to BOOST
23:50:39.704 [INFO ] [smarthome.event.ItemStateChangedEvent] - MAXCubeAuslastung changed from 40 to 43
23:50:44.909 [INFO ] [smarthome.event.ItemStateChangedEvent] - MAXCubeAuslastung changed from 43 to 46
23:50:51.623 [INFO ] [.impl.connections.SubscriptionManager] - Publishing changes for 101748
23:50:51.634 [INFO ] [smarthome.event.ItemStateChangedEvent] - BZSetTemp changed from 19.0 to 17.0

I think HomeKit is doing the Order of the Commands been send, but is there any way to send the target Temperature after the Mode is send? Or does anybody has an idea for a workaround?

I don’t understand why you’re trying to use openHAB AND homekit to control your MAX thermostats at the same time.
You can only be one master’s slave, can’t you?
If you want to use Siri or whatever to change your room temperature then connect your homekit to openHAB and not directly to MAX.

I dont want to use Booth for automation. Because its easier to set the automation in iOS HomeKit App than in openhab i want to manage them in My iOS App.

Maybe i didn‘t explain my Setup good enough.

Have a RP3 with openhab 2, the HomeKit binding an the Max binding and its working Fine.

For better understanding, here is my item config

//Badezimmer
Group gBZ"Badezimmer" (gThermo) [ “Thermostat” ]
String BZMode “Thermostat Mode Setting” (gBZ) [ “homekit:HeatingCoolingMode” ] {channel=“max:thermostat:KMD1054933:KMD3048874:mode”}
Number BZActual “Actual measured room temperature” (gBZ) [ “CurrentTemperature” ] {channel=“max:thermostat:KMD1054933:KMD3048874:actual_temp”}
Number BZSetTemp “Thermostat temperature setpoint” (gBZ) [ “TargetTemperature” ] {channel=“max:thermostat:KMD1054933:KMD3048874:set_temp”}

That’s conceptually no good approach to home automation and will get you into trouble on many occasions.
I guess that’s also why people will not be fond of helping you sort this out.
There’s various ways to make your iPhone or Homekit devices interact with openHAB instead of talking to MAX,
and any “automation” should be done in OpenHAB, not in the frontend.
openHAB will “consolidate” and then “forward” your Homekit commands (or send its own) by means of its MAX binding.
Or are you trying to tell me you already handle it that way? Your log does not show any communication to a MAX cube.

My Max Cube is working with Fine with everything. I can Control my Thermostats with openhab, Siri/iOS Homekit and alexa. Just the automation in iOS Homekit App sends the Set temp and also the Mode. In Automations its Not possible only to Send temp Set without a Mode Set. The Problem is the Mode is send After the temp from the Homekit App

Thats what is shown in my log:
Thermostat gets new temp 19°
Thermostat gets new Mode „automatic“

Every Mode has it‘s Standard temp Preset in the Cube. When you Set the Mode the temp will be Set to it’s Standard.
Because of the Second command the Temperature is Set back to the automatic Temperature which is Set in the Cube to 17°.

See above, while you didn’t explain well enough to be sure, I understand that your Homekit talks directly to maxcube and openHAB isn’t involved in your problem, so why do you ask this on a openHAB forum.

Because my HomeKit Talks throug openhab and the MAX binding, which comes with openhab, to my MAX Cube.

In iOS HomeKit App my automation is programmed to turn up the Thermostat in bathroom at 7:00 AM to 19°. The Apple iOS HomeKit App sends the Target Temperature AND, about 0,2 Seconds, later the Mode. Even if the Mode is the same as before it is send by the HomeKit App and the Temperature will be set to the modes default, which ist 17°. The 19° were set in the Thermostat for about 0,2 Seconds and then set back to 17°

In fact that neather i can Programm in iOS automations only to send the Target Temperatur without the Mode nor tell HomeKit to send the Mode before the Target Temperature, i thougt it would be possible to do a change in the binding or to do a workaround in openhab rule or item config.

I think it could be possible to make automations on iOS HomeKit working if there where a Delay of about 0,5 Seconds before sending the command when the Target Temperature is changed. My questions is How to do that. Can it be done by myself in a rule in openhab or only by a change in the binding?

If my question is wrong here in the forum i‘m Sorry for that. In fact that i‘m not a programmer or so I tried my best to explain my problem.

Maybe someone understands my problem and can help or tell me that the problem can’t be solved by myself.

Thank you MStormi, for trying to understand my problem.

Hi,

I do not use Apple homekit, but Amazon Alexa. I have the same “problem”. if I change the temperature over Alexa, still follows the automatic mode.
Is this perhaps due to the concept for the targets and not to Apple Homekit?

It’s part of the MAX concept that if you tell it to switch to automatic mode, it`ll retrieve the target temperature from its own config (the heating program you maintain on the maxcube). If Homekit tells the target thermostat to go into automatic mode after sending a new target temperature, it’s broken (or to be more polite, it’s incompatible with MAX) so it is not advisable to do the automation in Homekit which is what I said from the beginning.
You might be able to work around that if you point Homekit to a dummy item and use a openHAB rule to change the target temperature for the thermostat if the dummy item is changed (but don’t duplicate the mode switch, of course).
Or you might trigger on that ‘automatic’ mode command and make openHAB repeat the target temperature command.

When i tell alexa to turn bathroom to 19° it’s working Fine. In my log i See no Mode send, just the Target Temperature. But alexas Return is „automatic Mode is Set to 19°„
Changing the Mode with alexa doesnt work in my Setup. If i Tell her to Set a Mode She tells me „I dont know How to do that Setting for the room“. Maybe thats why i dont have that Problem you have.

When i Talk to siri to change the temp it works also Fine. No Mode is send with the Target temp command. When i Tell Siri to change the Mode it works also without Problems.

So you Can Set the Modes for Max Thermostates with alexa? Which command do you Talk to alexa?
Which openhab Version do you use?

Thanks for the tip with dummy item or to resend the command. I will try that.

When i go in the homekit app to Set my rooms Temperature to 20° for example it’s Not sending the Mode command with it. So at this usage there is No Problem.

Only by Programming an Automation in the homekit App, for example bathroom to 19° at 7:00 AM, the Mode command will be send 0,2 Seconds After the Target temp command. I dont Know why, but in homekits scheduled commands it is Not possible to set only a Target Temperature without a mode setting. And for this reason the Mode is always send with a scheduled Thermostate Temperature.

The problem is not a big one and I could schedule the temperature in the cube. But everytime I want to go to settings in the cube I have to stop max binding cause the max cube only allows one connection at time.

You can also set the MAX binding to not stay permanently connected but to connect in defined intervals.

I have the same problem, but i do not use homekit. I just use openHAB2 and max!binding. When i change the temeperature via rule the mode goes back to Automatic. Did anyone solve this problem?

Items:
Switch maxKellerBattery “Battery Low” (gMAX) {channel=“max:thermostatplus:KEQ0536422:MEQ1293208:battery_low”}
String maxKellerMode “Thermostat Modus” (gMAX) {channel=“max:thermostatplus:KEQ0536422:MEQ1293208:mode”}
Number maxKellerActual “Actual measured room temperature [%.1f °C]” (gMAX) {channel=“max:thermostatplus:KEQ0536422:MEQ1293208:actual_temp”}
Number maxKellerSetTemp “Thermostat temperature setpoint [%.1f °C]” (gMAX) {channel=“max:thermostatplus:KEQ0536422:MEQ1293208:set_temp”}
Number maxKellerValve “Valve opening in %” (gMAX) {channel=“max:thermostatplus:KEQ0536422:MEQ1293208:valve”}
Switch maxKellerOff “ON / OFF”

Rules:
rule "ON / OFF"
when
Item maxKellerOff changed
then
if ( maxKellerOff.state == OFF ) {
sendCommand ( maxKellerMode , “MANUAL” )
sendCommand ( maxKellerSetTemp , 4.5 )
} else {
sendCommand ( maxKellerMode , “AUTOMATIC” )
}
end

You shouldn’t send MANUAL in the first place. Simply setting the target temp will override the current one but MAX/maxcube binding will not setback/override your temperature setting until it’s time for a change according to the heating plan you configured inside MAX.

So what is the best way if i want to set the heater with 1 click to MANUAL and OFF (4.5 degrees)? You say i should leave it in Automatic and just change the temperature to 4.5 ?

Not sure what you mean by “the heater” but if you’re referring to the radiator (and not the furnace or other part of the system), then yes.
I believe you can also send OFF instead of MANUAL, but I haven’t tried that.

Ah sorry, i mean my eq3 Thermosatate+. 4.5 degrees sets it to OFF, but because of the set_temp it gets into the Automatic mode. Setting the mode to OFF does not seem to work.

May I ask what´s the setup of your Homekit binding in Paper UI. I´m also using Max eq3 and always have issues with the heating cooling mode.