Thermostat Google Home Integration MODE missing?

  • Platform information:
    • Hardware: RaspberryPi 3
    • OS: openhabian
    • openHAB version: openHAB 2.5.0 Release Build

Hello all,

im new to openhab and managed since a couple of weeks to get use of some features but now i got somehow stuck in something. My problem are the thermostats duscovered trough the router (Fritzbox).
Thermostats used are ComedDect. They were discovered with no problem but now i get issues with getting them over google home usable.

Here is my Item

Group   BueroThermostat "Büro Thermostat" { ga="Thermostat" }
String               BueroMode           "Mode"           (BueroThermostat)             {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:mode" , ga="thermostatMode"}
Number:Temperature   BueroTemperature    "Current temperature"   (BueroThermostat)      {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:temperature" , ga="thermostatTemperatureAmbient" }
Number:Temperature   BueroSetTemp        "Setpoint temperature"  (BueroThermostat)      {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:set_temp", ga="thermostatTemperatureSetpoint"}

In the image is the result with no functions

What am i doing wrong?

I’ve read that the MODE must be set manually eventually but right now im not getting it how!

If i set from Google Home the MODE to “Heizen” (Heat) i can change the setpoint, voice commands also working, but every time i get into the Thermostat i got “Anderer Modus” (other MODE). Actually i have a other Link using the thermostats over Google but i want to delete them as soon as i got this work with openhab.

FB Smart Home is still using the link to my Thermostats and working well, but i’m looking to get rid of it and change over of all my items to openhab.

The actual “Büro Thermostat” is not linked with the FB Smart Home to Google for trying to get them over to openhab after i got them working.

Please advise

Welcome to openHAB!

I don’t have a Fritzbox, but I think you’ve called the wrong channel. The AVM Fritz documentation says:

mode | String | States the mode of the device (MANUAL/AUTOMATIC/VACATION)

So, Google is sending a “heat” string state, but your item is looking for MANUAL, AUTOMATIC, or VACATION. I think you need to send commands to the radiator_mode channel.

radiator_mode | String | Mode of heating thermostat (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN)

I suspect that you’ll need to transform the states so that they match, which you can do by using an unbound item (not attached to a channel) as an intermediary between Google and Fritzbox. So, you would have:

Group BueroThermostat "Büro Thermostat" { ga="Thermostat" }
String BueroModeGoogle "Mode for Google Assistant" (BueroThermostat) {ga="thermostatMode"}
String BueroMode "Mode" {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:radiator_mode"}
Number:Temperature BueroTemperature "Current temperature" (BueroThermostat) {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:temperature" , ga="thermostatTemperatureAmbient" }
Number:Temperature BueroSetTemp "Setpoint temperature" (BueroThermostat) {channel="avmfritz:Comet_DECT:192_168_178_1:119630365160:set_temp", ga="thermostatTemperatureSetpoint"}

And then you’d need two rules: one that takes in the BueroModeGoogle state and sends a command to BeuroMode, and one that goes in the opposite direction when radiator_mode is updated.

One thing to note is that in the Google world, the on state is equivalent to “Other”. From what I’ve seen, Google can send four states: heat, cool, on, off. I think you’ll want:

heat = ON
off = OFF

But again, the intermediary item and rules are only necessary if radiator_mode won’t directly accept the states sent by Google.

Thanks for the reply, I think i had a long day and overseen that I got the wrong mode channel from the Thermostat. I’ll try it out and get back. Thanks for the hint @rpwong

I’m still on discovering the power of openhab and doing my best to understand it. But they will be more moments of stuck and therefore I’m glad to have a community with wise people around.

Edit:changing the to right channel solves a part of it. now im dont get it with the rule and the mode mappings

Here are the options from the other thermostat linked app

here is the one from openhab to google


before i remove the other link i need help to get this working.
how do i make same modes be displayed?

I updated the config and is working, but I’ll looking to figure out the modes to be displayed as they should. Mapping is just a workaround.

There’s an upcoming change that will eliminate your need for a rule. You should follow this ongoing discussion:

Once this is up and running, you’l be able to specify a mode map in your metadata so that your thermostat and GA show the same mode.

1 Like

I also have a setup with fritzbox and comet thermostats running. I can share my configuration that is now working with my PR.

1 Like

Hi @michikrug,

Would be nice to share it so I can compare and see if I missed something (specially rules). I have now rule set up over paperui. I’m still extending my knowing about rules…my weak point for now.

Here is my setup (already based on my latest PR for the assistant - will not work with the current official integration!):

Group Thermostat_Bad          "Heizung Bad Thermostat"          { ga="Thermostat" [ modes="off=OFF:WINDOW_OPEN,heat=COMFORT:BOOST:ON,eco=ECO,auto=AUTOMATIC" ] }

The setpoint and ambient temperature is normally assigned to the appropriate ga="…" value. E.g. HeizungBad_CurrentTemperature, HeizungBad_SetpointTemperature.
The mode is assigned to the RadiatorMode item as already stated, e.g. HeizungBad_RadiatorMode
All those three using PaperUI and the API.

With my PR no additional rules are required.


With the current official integration the way to go would be having a intermediate item for the mode:

String HeizungBad_Mode_GA          "Heizung Bad Mode GA"          (Thermostat_Bad)          { ga="thermostatMode" }

and a set of rules and maps to transform the value in both directions:

rule "Update Heizung Bad Mode -> GA"
when
        Item HeizungBad_RadiatorMode changed
then
        HeizungBad_Mode_GA.postUpdate(transform("MAP", "modes_ga.map", HeizungBad_RadiatorMode.state.toString))
end

rule "Update Heizung Bad Mode <- GA"
when
        Item HeizungBad_Mode_Ga changed
then
        HeizungBad_RadiatorMode.sendCommand(transform("MAP", "modes.map", HeizungBad_Mode_Ga.state.toString))
end

modes.map:

eco=ECO
heat=COMFORT
=ON

modes_ga.map:

WINDOW_OPEN=off
ECO=eco
ON=heat
COMFORT=heat
BOOST=heat
=heat

The mapping can be adjusted to fit your own needs.

Can those 2 rules be in one file or has to be in 2 different?

@Br3Ak3R Yes, the rules can be in the same file. If you wanted, all of your OH rules could be in a single file (but that’s not recommended).

@michikrug Would you like help with the GA documentation? I’m just figuring out how to submit PRs, and I think it would be great to include some examples for connecting thermostats as you’ve done above.

Hello everyone.

Is this pullrequest already sync?
I am trying to make it work but failing. It seems the wiki is already updated with @michikrug method.

I don’t think so. I tried it out yesterday and was able to define which modes show up in Google Assistant, but not transform their values. So, you can have this:

[modes=“off,heat,cool,on”]

But not this:

[modes=“off=OFF,heat=HEAT,cool=COOL,on=ON”]

Exactly! I’m facing the same issue. Is there an ETA to merge thr PR?

PR is already merged some weeks ago, but somehow the deployment of the code is not yet done :confused:

only @MARZIMA can do so and tell the status

It is all merged. Not sure if this issue still exits.

after sorting a bit my items in VSCode i tried to update the codes for this to get rid of rules for the MODE.

Group                ThermostatKinderzimmer               "Kinderzimmer"                { ga="Thermostat" [modes="off=WINDOW_OPEN,heat=COMFORT,eco=ECO,on=ON"] }
String               ThermostatKinderzimmerRadiatorMode   "Radiator mode"               {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:radiator_mode", ga="thermostatMode" }
Number:Temperature   ThermostatKinderzimmerTemperature    "Current temperature"         {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:temperature" , ga="thermostatTemperatureAmbient"}
Number:Temperature   ThermostatKinderzimmerSetTemp        "Setpoint temperature"        {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:set_temp", ga="thermostatTemperatureSetpoint"}

What did i do wrong?

EDIT:
:man_facepalming: forgot to group the ITEMS

Group                ThermostatKinderzimmer               "Kinderzimmer"                { ga="Thermostat" [modes="off=WINDOW_OPEN,heat=COMFORT,eco=ECO,on=ON"] }
String               ThermostatKinderzimmerRadiatorMode   "Radiator mode"           (ThermostatKinderzimmer)    {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:radiator_mode", ga="thermostatMode" }
Number:Temperature   ThermostatKinderzimmerTemperature    "Current temperature"     (ThermostatKinderzimmer)    {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:temperature" , ga="thermostatTemperatureAmbient"}
Number:Temperature   ThermostatKinderzimmerSetTemp        "Setpoint temperature"    (ThermostatKinderzimmer)    {channel="avmfritz:Comet_DECT:192_168_178_1:119630369472:set_temp", ga="thermostatTemperatureSetpoint"}

Stumbled upon this thread after searching.
I can confirm that the mode mapping does not work.

I tried the two definitions below but did not see any change in my google home app, even after syncing and resyncing.

Group   HallAC2           "HallAC2"                                        {ga="thermostat"}
String  HallACMode2       "Hall AC Mode2"                  (HallAC2)       { ga="ThermostatMode" [modes="off,heat,cool,on"] }                                      Number  HALLACTemp2       "Temperature Ambient2"           (HALLAC2)       { ga="thermostatTemperatureAmbient" }
Number  HALLACTemp22       "Hall AC Temperature Setpoint2" (HALLAC2)       { ga="thermostatTemperatureSetpoint" }

Group   HallAC2           "HallAC2"                                        {ga="thermostat"}
String  HallACMode2       "Hall AC Mode2"                  (HallAC2)       { ga="ThermostatMode" [modes="off=OFF,heat=HEAT,cool=COOL,on=ON"] }                     Number  HALLACTemp2       "Temperature Ambient2"           (HALLAC2)       { ga="thermostatTemperatureAmbient" }
Number  HALLACTemp22       "Hall AC Temperature Setpoint2" (HALLAC2)       { ga="thermostatTemperatureSetpoint" } 

That’s because the modes need to be applied to the group.

Group HallAC2 "HallAC2" { ga="thermostat" [modes="off=OFF,heat=HEAT,cool=COOL,on=ON"] }

Oops. Thanks for that. It worked. And the mapping is working too.

Group   HallAC2   "HallAC2"     {ga="thermostat" [ modes="off=WINDOW_OPEN,heat=COMFORT:BOOST,eco=ECO,on=ON,auto=AUTO" ]} 
2020-07-05 01:48:57.953 [ome.event.ItemCommandEvent] - Item 'HallACMode2' received command COMFORT
2020-07-05 01:48:58.123 [vent.ItemStateChangedEvent] - HallACMode2 changed from COOL to COMFORT
2020-07-05 01:49:11.727 [ome.event.ItemCommandEvent] - Item 'HallACMode2' received command WINDOW_OPEN
2020-07-05 01:49:11.902 [vent.ItemStateChangedEvent] - HallACMode2 changed from COMFORT to WINDOW_OPEN

But the Auto and On modes don’t show up in the GA GUI. Voice command to set to AUTO mode works and it sets it to ‘other’.

2020-07-05 01:50:47.174 [ome.event.ItemCommandEvent] - Item 'HallACMode2' received command AUTO
2020-07-05 01:50:47.345 [vent.ItemStateChangedEvent] - HallACMode2 changed from WINDOW_OPEN to AUTO

1 Like

I seem to think that the Home app won’t display modes that aren’t pre-defined by Google, probably because the text labels are hard-coded in at some point. However, if you define custom modes and leave out pre-defined ones, you can remove them from the UI. I only show heat, cool, and off in mine.

In case anyone is interested, this is what I have loaded and it seems to be working.

In so much as when the Google Assistant Thermostat is set to Heat mode, it displays the target temperature and allows me to change it.

In all modes, it displays the current temperature.

(this is a Velbus thermostat, as discussed here - openHAB Google Assistant Integration v2.0 )

// New Google Assistant and Alexa Metadata tagging (I'm still experimenting with)

	Group 	Kitchen_Thermostat																						{ga="Thermostat" [roomHint="Kitchen", modes="off=SAFE,heat=DAY,eco=NIGHT,on=DAY"], alexa="Endpoint.Thermostat" }
	Number 	Kitchen_CurrentTemperature 			"Kitchen Current Temperature" 			(Kitchen_Thermostat,WholeHouse_CurrentTemperature		)		{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:input#CH9", 								ga="thermostatTemperatureAmbient" ,		 alexa="TemperatureSensor.temperature" }
	Number 	Kitchen_CurrentTargetTemperature	"Kitchen Current Target Temperature"	(Kitchen_Thermostat,WholeHouse_CurrentTargetTemperature	)		{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#CURRENTTEMPERATURESETPOINT", 	ga="thermostatTemperatureSetpoint",		 alexa="ThermostatController.targetSetpoint"}
	String 	Kitchen_ThermostatMode 				"Kitchen Thermostat mode"	  	 		(Kitchen_Thermostat, WholeHouse_ThermostatMode)					{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#MODE",							ga="thermostatMode" ,					alexa="ModeController.mode" [friendlyNames="@Setting.Preset", supportedModes="SAFE=Safe,NIGHT=Night,DAY=Day,COMFORT=Comfort"]}
	String 	Kitchen_ThermostatOperatingMode 	"Kitchen Thermostat operating mode"		(Kitchen_Thermostat, WholeHouse_ThermostatOperatingMode)		{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#OPERATINGMODE"	,														alexa="ThermostatController.thermostatMode" [COOL="COOLING",HEAT="HEATING"]}

  
	Number	Kitchen_HeatingComfortTarget 		"Kitchen Heating Comfort Target Temperature"						{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#HEATINGMODECOMFORTTEMPERATURESETPOINT"		,		alexa="ThermostatController.lowerSetpoint#HEAT"		}
	Number	Kitchen_HeatingDayTarget 			"Kitchen Heating Day Target Temperature"	  						{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#HEATINGMODEDAYTEMPERATURESETPOINT"			,		alexa="ThermostatController.lowerSetpoint#ECO"		}
	Number	Kitchen_HeatingNightTarget 			"Kitchen Heating Night Target Temperature"	 						{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#HEATINGMODENIGHTTEMPERATURESETPOINT"																	}																									 
	Number	Kitchen_HeatingAntifrostTarget		"Kitchen Heating Antifrost Target Temperature"						{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#HEATINGMODEANTIFROSTTEMPERATURESETPOINT"	,		alexa="ThermostatController.lowerSetpoint#OFF"		}

																											
//	Number	Kitchen_CoolingComfortTarget 		"Kitchen Cooling Comfort Target Temperature"						{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#COOLINGMODECOMFORTTEMPERATURESETPOINT"		,		alexa="ThermostatController.upperSetpoint#COOL"		}
//	Number	Kitchen_CoolingDayTarget			"Kitchen Cooling Day Target Temperature"							{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#COOLINGMODEDAYTEMPERATURESETPOINT"			,		alexa="ThermostatController.upperSetpoint#ECO"		}
//	Number	Kitchen_CoolingNightTarget 			"Kitchen Cooling Night Target Temperature"							{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#COOLINGMODENIGHTTEMPERATURESETPOINT"																	}
//	Number	Kitchen_CoolingSafeTarget			"Kitchen Cooling Safe Target Temperature"							{channel="velbus:vmbgp4pir:VelbusNetworkBridge:32:thermostat#COOLINGMODESAFETEMPERATURESETPOINT"		,		alexa="ThermostatController.upperSetpoint#OFF"		}
2 Likes