Hi @TapioX
Just update,
I’ve tried it again, and it works, I had some issues with attributes and because of that, I couldn’t successfully execute the create Rule request.
Right now I managed to do it, Thanks a lot.
BTW:
Here is the Rule that I’ve created, maybe for somebody it can be helpful
{
"name": "Controll Living Room AC via Google Nest Thermostat",
"actions": [
{
"if": {
"and": [
{
"equals": {
"left": {
"location": {
"attribute": "Mode",
"trigger": "Always"
}
},
"right": {
"string": "xxxxxxx-xxxxx-4xx8-xxxx-37xx5xxxxxx" // Home mode id
}
}
},
{
"greaterThanOrEquals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "temperatureMeasurement",
"attribute": "temperature",
"trigger": "Always"
}
},
"right": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatCoolingSetpoint",
"attribute": "coolingSetpoint",
"trigger": "Always"
}
}
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatMode",
"attribute": "thermostatMode",
"trigger": "Always"
}
},
"right": {
"string": "auto"
}
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"AC-PLUG-ID"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
},
"right": {
"string": "off"
}
}
}
],
"then": [
{
"command": {
"devices": [
"AC-PLUG-ID"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on",
"arguments": []
}
]
}
}
]
}
},
{
"if": {
"and": [
{
"lessThanOrEquals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "temperatureMeasurement",
"attribute": "temperature",
"trigger": "Always"
}
},
"right": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatHeatingSetpoint",
"attribute": "heatingSetpoint",
"trigger": "Always"
}
}
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatMode",
"attribute": "thermostatMode",
"trigger": "Always"
}
},
"right": {
"string": "auto"
}
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"AC-PLUG-ID"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
},
"right": {
"string": "on"
}
}
}
],
"then": [
{
"command": {
"devices": [
"AC-PLUG-ID"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off",
"arguments": []
}
]
}
}
]
}
},
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatMode",
"attribute": "thermostatMode",
"trigger": "Always"
}
},
"right": {
"string": "off"
}
},
"then": [
{
"command": {
"devices": [
"AC-PLUG-ID"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off",
"arguments": []
}
]
}
}
]
}
},
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"AC-PLUG-ID"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
}
},
"right": {
"string": "on"
}
},
"then": [
{
"command": {
"devices": [
"GNT-ID"
],
"commands": [
{
"component": "main",
"capability": "thermostatMode",
"command": "auto",
"arguments": []
}
]
}
}
]
}
},
{
"if": {
"or": [
{
"equals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatMode",
"attribute": "thermostatMode",
"trigger": "Always"
}
},
"right": {
"string": "cool"
}
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"GNT-ID"
],
"component": "main",
"capability": "thermostatMode",
"attribute": "thermostatMode",
"trigger": "Always"
}
},
"right": {
"string": "heat"
}
}
}
],
"then": [
{
"command": {
"devices": [
"GNT-ID"
],
"commands": [
{
"component": "main",
"capability": "thermostatMode",
"command": "auto",
"arguments": []
}
]
}
}
]
}
}
]
}