The total Energy consumption counter is the simplest way to use this driver.
If you know the device’s fixed power consumption and the device’s On/Off status information is available to SmartThings,
you can make the total Energy consumption counter.
Use these settings
In my example fixed power consumption is 1000W.
Set your device’s fixed power consumption value to Total.
This Rules API rule calculates estimated total Energy consumption.
{
"name": "Every 6 min Energy Consumption Calculation from Power",
"actions": [
{
"every": {
"interval": {
"value": {
"integer": 6
},
"unit": "Minute"
},
"actions": [
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"-- ID Monitored Device --"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
}
},
"right": {
"string": "on"
}
},
"then": [
{
"command": {
"devices": [
"-- ID Energy-Power Device --"
],
"commands": [
{
"component": "main",
"capability": "islandtheme02751.setPower",
"command": "setPower",
"arguments": [
{
"device": {
"devices": [
"-- ID Energy-Power Device --"
],
"component": "main",
"capability": "islandtheme02751.total",
"attribute": "total"
}
}
]
}
]
}
}
]
}
}
]
}
}
]
}
When the device is on, the energy consumption according to the power is added to the total energy consumption.
When the device is off, the total energy consumption value remains unchanged.
The rule is executed every 6 minute. 6 minute execution interval corresponds to a scaling factor of 0.1
This Rules API rule calculates estimated total Energy consumption.
Use this rule if you are using AWA
{
"every": {
"interval": {
"value": {
"integer": 6
},
"unit": "Minute"
},
"actions": [
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"-- ID Monitored Device --"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
}
},
"right": {
"string": "on"
}
},
"then": [
{
"command": {
"devices": [
"-- ID Energy-Power Device --"
],
"commands": [
{
"component": "main",
"capability": "islandtheme02751.setPower",
"command": "setPower",
"arguments": [
{
"device": {
"devices": [
"-- ID Energy-Power Device --"
],
"component": "main",
"capability": "islandtheme02751.total",
"attribute": "total"
}
}
]
}
]
}
}
]
}
}
]
}
}