Dear all,
after a long time I was able to get my Eurotronics Z-Wave thermostat running.
To get Google Home and Alexa involved, I needed to create rules that translate between the voice commands and the thermostate modes (see Thermostat items for voice control (Echo/Alexa and Google Assistant)).
That means I have to synchonize between the hardware modes (Thermostate_Mode_Office
) of the thermostat and the “dummy” item Homekit_HeatingCoolingMode_Office
that receives the voice commands.
Plus, there is an issue with Alexa which is not able to switch the thermotat on or off (see Thermostat works well in Google Home, but not with Alexa). This is why I created an additional switch (Heating_Mode_Office
) that serves as a representative and also needs to be synchronized with the other two items.
In total, this leads to three items receiving commands and thus three blocks that care for the synchronization. But as upon a change all items will change (one by the user command, the other two by the first rule that is executed), always all three blocks are executed. This works, but is clearly redundant and very unelegant.
Does someone have a proposal to simplify these rules? Thanks a lot!
rule "Heizungsregelung Büro Switch"
when
Item Heating_Mode_Office changed
then
if (Heating_Mode_Office.state == ON)
{
Homekit_HeatingCoolingMode_Office.sendCommand("heat")
Thermostate_Mode_Office.sendCommand(0x01)
}
else if (Heating_Mode_Office.state == OFF)
{
Homekit_HeatingCoolingMode_Office.sendCommand("off")
Thermostate_Mode_Office.sendCommand(0x00)
}
end
rule "Heizungsregelung Büro Homekit"
when
Item Homekit_HeatingCoolingMode_Office changed
then
if (Homekit_HeatingCoolingMode_Office.state == "on")
Homekit_HeatingCoolingMode_Office.sendCommand("heat")
if (Homekit_HeatingCoolingMode_Office.state == "heat" || Homekit_HeatingCoolingMode_Office.state == "auto" || Homekit_HeatingCoolingMode_Office.state == "heatcool")
{
Heating_Mode_Office.sendCommand(ON)
Thermostate_Mode_Office.sendCommand(0x01)
}
else if (Homekit_HeatingCoolingMode_Office.state == "off")
{
Heating_Mode_Office.sendCommand(OFF)
Thermostate_Mode_Office.sendCommand(0x00)
}
end
rule "Heizungsregelung Büro Eurotronics"
when
Item Thermostate_Mode_Office changed
then
if (Thermostate_Mode_Office.state == 0x0F || Thermostate_Mode_Office.state == 0x01 || Thermostate_Mode_Office.state == 0x0B)
{
Homekit_HeatingCoolingMode_Office.sendCommand("heat")
Heating_Mode_Office.sendCommand(ON)
}
else if (Thermostate_Mode_Office.state == 0x00)
{
Homekit_HeatingCoolingMode_Office.sendCommand("off")
Heating_Mode_Office.sendCommand(OFF)
}
end