Good day. I have a Error problem with virtual sensor difference calculate. Error adding rule вычисление влажности разницы" 422 the request is malformed. name. unrecognised field “name” (CLS v20190122.internal.st.behaviors.Action) not marked as ignorable.
Maybe this is the reason
If you are using AWA add only actions (not name as using CLI)
Paste the rule here. Make sure to add ``` before and after the paste.
```
paste
```
Tplink tapo soket plugs 115 and tapo temperature and humidity sensor
{
“name”: “Вычисление разницы влажности”,
“actions”: [
{
“command”: {
“devices”: [
“8df7b9a0-11bd-40f7-aca7-5fbc8aa21786”
],
“command”: “setHumidity”,
“arguments”: [
{
“math”: {
“expression”: “abs(humidity1 - humidity2)”
}
}
]
}
}
],
“enabled”: true,
“time”: “any”,
“events”: [
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“attribute”: “humidity”,
“device”: “2ed1e0b3-24c8-410b-8da3-7586704d2515”,
“action”: “subscribe”
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“attribute”: “humidity”,
“device”: “e13276f1-d39f-4f69-96c9-8e1626903147”,
“action”: “subscribe”
}
]
}
Error adding rule “Вычисление разницы влажности”. 422 The request is malformed. name: Unrecognized field “name” (class v20190122.internal.st.behaviors.Action), not marked as ignorable.
Добавил квадратные скобки [ ] в начале и в конце код ошибки изменился на то что на фото и написано выше.
Paste this in the web interface between the brackets [ ]
{
"if": {
"or": [
{
"changes": {
"operand": {
"device": {
"devices": [
"2ed1e0b3-24c8-410b-8da3-7586704d2515"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity",
"trigger": "Always"
}
}
}
},
{
"changes": {
"operand": {
"device": {
"devices": [
"e13276f1-d39f-4f69-96c9-8e1626903147"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity",
"trigger": "Always"
}
}
}
}
],
"then": [
{
"command": {
"devices": [
"NUMBER_FIELD_DEVICE_ID"
],
"commands": [
{
"component": "main",
"capability": "legendabsolute60149.numberFieldOne",
"command": "setNumberFieldOne",
"arguments": [
{
"device": {
"devices": [
"2ed1e0b3-24c8-410b-8da3-7586704d2515"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity"
}
}
]
},
{
"component": "main",
"capability": "legendabsolute60149.numberFieldTwo",
"command": "setNumberFieldTwo",
"arguments": [
{
"device": {
"devices": [
"e13276f1-d39f-4f69-96c9-8e1626903147"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity"
}
}
]
}
]
}
}
]
}
}
[ ]. then error is reply
. then error is reply
{ “math”: { “expression”: “abs(humidity1 - humidity2)” }
In my opinion, such calculations are not possible when using the Rules API.
True. I’m on mobile and unformatted yaml is hard to read.
The first issue is the paste location.
In the Advanced Web App rule editor, you are usually editing the actions part of the rule. So you must not paste a complete Rule object like this:
{
"name": "...",
"actions": [
...
],
"enabled": true,
"time": "any",
"events": [
...
]
}
That is why the error says:
name: Unrecognized field "name" (class v20190122.internal.st.behaviors.Action)
SmartThings is trying to parse name as an Action, not as the rule name.
The second issue is that the rest of the JSON is not valid Rules API syntax either. Rules API does not use:
"events": [
{
"action": "subscribe"
}
]
To react to a device attribute update, use a changes condition with a device operand.
The third issue is the calculation itself. This is not valid Rules API syntax:
{
"math": {
"expression": "abs(humidity1 - humidity2)"
}
}
Rules API does not know variables called humidity1 and humidity2 there, and this math object is not a valid command argument. For this kind of calculation, use a helper virtual device/Edge driver, for example Mariano’s Number Fields device: copy humidity sensor 1 into number field 1, copy humidity sensor 2 into number field 2, and let the helper device calculate the result.
Also check the target virtual humidity device. The standard relativeHumidityMeasurement capability has no setHumidity command. If you want to write the calculated value into a virtual humidity device, that device must expose its own custom settable humidity capability/command.
If the AWA editor already shows the surrounding square brackets:
[
]
paste only the following object between those brackets.
Replace NUMBER_FIELD_DEVICE_ID with the ID of the Number Fields helper device.
{
"if": {
"or": [
{
"changes": {
"operand": {
"device": {
"devices": [
"2ed1e0b3-24c8-410b-8da3-7586704d2515"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity",
"trigger": "Always"
}
}
}
},
{
"changes": {
"operand": {
"device": {
"devices": [
"e13276f1-d39f-4f69-96c9-8e1626903147"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity",
"trigger": "Always"
}
}
}
}
],
"then": [
{
"command": {
"devices": [
"NUMBER_FIELD_DEVICE_ID"
],
"commands": [
{
"component": "main",
"capability": "legendabsolute60149.numberFieldOne",
"command": "setNumberFieldOne",
"arguments": [
{
"device": {
"devices": [
"2ed1e0b3-24c8-410b-8da3-7586704d2515"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity"
}
}
]
},
{
"component": "main",
"capability": "legendabsolute60149.numberFieldTwo",
"command": "setNumberFieldTwo",
"arguments": [
{
"device": {
"devices": [
"e13276f1-d39f-4f69-96c9-8e1626903147"
],
"component": "main",
"capability": "relativeHumidityMeasurement",
"attribute": "humidity"
}
}
]
}
]
}
}
]
}
}
After the Number Fields helper device has calculated the difference, you can copy calculationResult into another virtual device.
This part depends on the virtual humidity device you use. The capability and command below are placeholders and must be replaced by the actual custom capability/command exposed by that virtual device.
{
"command": {
"devices": [
"VIRTUAL_HUMIDITY_DEVICE_ID"
],
"commands": [
{
"component": "main",
"capability": "YOUR_SETTABLE_HUMIDITY_CAPABILITY",
"command": "YOUR_SET_HUMIDITY_COMMAND",
"arguments": [
{
"device": {
"devices": [
"NUMBER_FIELD_DEVICE_ID"
],
"component": "main",
"capability": "legendabsolute60149.calculationResult",
"attribute": "calculationResult"
}
}
]
}
]
}
}
Do not use relativeHumidityMeasurement / setHumidity unless your virtual device really exposes such a custom command. The stock SmartThings relativeHumidityMeasurement capability is measurement-only.
Start with only the Number Fields helper rule. Once that rule saves and the two fields update correctly, configure the calculation in the Number Fields device. Only after that add a second rule/action to copy the calculated result into a virtual humidity device.
That avoids mixing three different problems at once: rule syntax, calculation, and the target virtual device command.
Such calculation is script based template. Samsung clood service. I am tapo h200 hub. And not server or resources to central Samsung or Google home power brain personal computer.
For this kind of calculation, use a helper virtual device/Edge driver, for example Mariano’s Number Fields device: c
Edge driver or Mariano’s number field device is installing on sky or pc or smartphone? I am sky cloud without pc server or samsung smarthab . How to install driver?
Edge driver or Mariano’s number field device is installing on sky or pc or smartphone? I am sky cloud without pc server or samsung smarthab . How to install driver?
Yes, you need a SmartThings hub if you want to install Edge drivers.
Smart things hub is required. Byt cloud use may be without hub works?
Tapo p115 4items tapo t310 3 items tapo hub h200 1 items
Byt cloud use may be without hub works?
You said you have a Tapo P115 and a Tapo T310. What are you actually trying to accomplish?


