Following this thread I´m trying to use some of these values in a rule to write to a tile (using @Mariano_Colmenarejo ‘s Number Field from his Virtual Devices) to compare with my home AirQ sensor values. Triggering from changes
in location UltraFineDust value I can write without problem from my PM2.5 dust sensor but can’t find the syntax to write the location value. Unable to see how to use `LocationAttribute’ string you mention here - don´t know if there are any examples or documentation anywhere.
Trying as an alternative on a text field the rule is accepted but, logically being numeric fails - on the API browser Execute button it shows failure but I do see the values, so they are being retrieved. Any ideas on this one? Thanks
The code I’m trying, but the API browser returns “operand not valid for operation” is
{
"if": {
"changes": {
"operand": {
"location": {
"locationId": "MY LOCATION ID",
"attribute": "UltraFineDust",
"trigger": "Always"
}
}
},
"then": [
{
"command": {
"devices": [
"221eb0e5-a898-4f7e-b8cd-e0329371d7e8"
],
"commands": [
{
"component": "main",
"capability": "legendabsolute60149.numberFieldOne",
"command": "setNumberFieldOne",
"arguments": [
{
"device": {
"devices": [
"MY PM2.5 SENSOR ID"
],
"component": "main",
"capability": "fineDustSensor",
"attribute": "fineDustLevel"
}
}
]
}
]
}
},
{
"command": {
"devices": [
"221eb0e5-a898-4f7e-b8cd-e0329371d7e8"
],
"commands": [
{
"component": "main",
"capability": "legendabsolute60149.numberFieldTwo",
"command": "setNumberFieldTwo",
"arguments": [
{
"location": {
"locationId": "MY LOCATION ID",
"attribute": "UltraFineDustIndex"
}
}
]
}
],
"sequence": {
"commands": "Serial",
"devices": "Serial"
}
}
}
],
"sequence": {
"then": "Parallel",
"else": "Serial"
}
}
}