Hi, @hntmor
Here’s an example using another capability but I think this provides a good starting point.
The way this one works is:
- There are three virtual dimmer-switch devices (S1,S2,S3)
- If the switch level on S1 is set and it’s greater or equals to than the current level on S2
- Then, turn S3 on
- Otherwise, it will turn off
{
"name": "condition based on another device",
"actions": [
{
"if": {
"greaterThanOrEquals": {
"left": {
"device": {
"devices": [
"S1"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level"
}
},
"right": {
"device": {
"devices": [
"S2"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level"
}
}
},
"then": [
{
"command": {
"devices": [
"S3"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
]
}
}
]
},
"else": [
{
"command": {
"devices": [
"S3"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
]
}
}
]
}
]
}
You can use the Advanced Users App to create this Rule, but based on your case, it would look more like this:
Make sure you replace the text like “attic sensor ID” with the real device ID which you can also see in the Advanced Users App (devices section)
[
{
"if": {
"greaterThanOrEquals": {
"left": {
"device": {
"devices": [
"attic sensor ID"
],
"component": "main",
"capability": "temperatureMeasurement",
"attribute": "temperature"
}
},
"right": {
"device": {
"devices": [
"outdoor sensor device id"
],
"component": "main",
"capability": "temperatureMeasurement",
"attribute": "temperature"
}
}
},
"then": [
{
"command": {
"devices": [
"Fan 1 device Id", "Fan 2 device Id"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
]
}
}
]
},
"else": [
{
"command": {
"devices": [
"S3"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
]
}
}
]
}
]
About this, do you mean to use how much you’re spending based on your energy consumption?