Hi everyone!
I’m on openhab 2.5 using the next gen rules in paper ui, so my config is in JSON.
I’m not using old style item / rules files.
I’d like to create a rule to trigger a command if CO2 (from my netatmo) exceeds a vaIue:
{
"link": "http://192.168.178.25:8080/rest/items/Netatmo_LivingRoom_CO2",
"state": "1230 ppm",
"stateDescription": {
"pattern": "%d %unit%",
"readOnly": true,
"options": []
},
"editable": true,
"type": "Number:Dimensionless",
"name": "Netatmo_LivingRoom_CO2",
"label": "CO2",
"tags": [],
"groupNames": []
}
As you can see the state has the ppm included:
"state": "1230 ppm"
This is the rule I created:
{ "status": { "status": "IDLE", "statusDetail": "NONE" }, "triggers": [ { "id": "4", "label": "an item state changes", "description": "This triggers the rule if an item state has changed.", "configuration": { "itemName": "Netatmo_LivingRoom_CO2" }, "type": "core.ItemStateChangeTrigger" } ], "conditions": [ { "inputs": {}, "id": "5", "label": "an item has a given state", "description": "Compares the item state with the given value", "configuration": { "itemName": "Netatmo_LivingRoom_CO2", "state": "500", "operator": ">" }, "type": "core.ItemStateCondition" } ], "actions": [ { "inputs": {}, "id": "3", "label": "send a command", "description": "Sends a command to a specified item.", "configuration": { "itemName": "LaMetric_Netatmo_red_Running", "command": "ON" }, "type": "core.ItemCommandAction" } ], "configuration": {}, "configDescriptions": [], "uid": "d7eaaa2c-0bec-492d-a8e2-ed56ecc07216", "name": "LaMetricRed", "tags": [], "visibility": "VISIBLE" }
How can I use the operators <,>,= etc in this case? This is not working:
"state": "500",
"operator": ">"
Thanks
Chris