Rules is not working with TP-Link Plug and less then 5 W

Hallo all,

I have oncemore issue with my OH2.5.3-1 and NG Rules.
I only want to swich of my Poer TP-Link HS110 pluf, whenthe power on the plug is less than 5W
It has work a couple of while, and other same feature like this work, e.g. for switch off my power supply from me mobile. Now the same pricip is not working anymore.
The trick with the “” for having not in the rule for e.g. 5.0 and “5.0” I already checked. butit is not working as it should be.
Has someone any idea?

Here is a snapshot from rule:

“ecec9ea8-ed0c-4334-92ea-fc464ca9718a”: {
“class”: “org.openhab.core.automation.dto.RuleDTO”,
“value”: {
“triggers”: [
{
“id”: “4”,
“label”: “an item state is updated”,
“description”: “This triggers the rule if an item state is updated (even if it does not change).”,
“configuration”: {
“itemName”: “BRoKellerFahrradladegerT_Power”
},
“type”: “core.ItemStateUpdateTrigger”
}
],
“conditions”: [
{
“inputs”: {},
“id”: “5”,
“label”: “an item has a given state”,
“description”: “Compares the item state with the given value”,
“configuration”: {
“itemName”: “BRoKellerFahrradladegerT_Power”,
“state”: 5.0,
“operator”: “\u003c”
},
“type”: “core.ItemStateCondition”
},
{
“inputs”: {},
“id”: “6”,
“label”: “an item has a given state”,
“description”: “Compares the item state with the given value”,
“configuration”: {
“itemName”: “tplinksmarthome_hs110_911088_power”,
“state”: 0.0,
“operator”: “!\u003d”
},
“type”: “core.ItemStateCondition”
}
],
“actions”: [
{
“inputs”: {},
“id”: “2”,
“label”: “send a command”,
“description”: “Sends a command to a specified item.”,
“configuration”: {
“itemName”: “BRoKellerFahrradladegerT_Betrieb”,
“command”: “OFF”
},
“type”: “core.ItemCommandAction”
}
],
“configuration”: {},
“configDescriptions”: [],
“uid”: “ecec9ea8-ed0c-4334-92ea-fc464ca9718a”,
“name”: “Fahrradnetzteil zum Aufladen automatisch abschalten”,
“tags”: [],
“visibility”: “VISIBLE”,
“description”: “Fahrradnetzteil zum Aufladen automatisch abschalten”
}
},

Also some log file:

2020-04-07 15:55:42.955 [nt.ItemStatePredictedEvent] - BRoKellerFahrradladegerT_Betrieb predicted to become OFF

2020-04-07 15:55:42.974 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Betrieb changed from ON to OFF

2020-04-07 15:55:43.128 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Signal changed from -52 dBm to -51 dBm

2020-04-07 15:55:43.132 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Power changed from 0.538444 W to 0.526244 W

2020-04-07 15:55:43.141 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Current changed from 0.075406 A to 0.075005 A

2020-04-07 15:55:43.144 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Voltage changed from 235.239735 V to 235.022788 V

2020-04-07 15:55:44.078 [ome.event.ItemCommandEvent] - Item ‘BRoKellerFahrradladegerT_Betrieb’ received command ON

2020-04-07 15:55:44.094 [nt.ItemStatePredictedEvent] - BRoKellerFahrradladegerT_Betrieb predicted to become ON

2020-04-07 15:55:44.121 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Betrieb changed from OFF to ON

2020-04-07 15:55:44.426 [ome.event.ItemCommandEvent] - Item ‘BRoKellerFahrradladegerT_Betrieb’ received command OFF

2020-04-07 15:55:44.437 [nt.ItemStatePredictedEvent] - BRoKellerFahrradladegerT_Betrieb predicted to become OFF

2020-04-07 15:55:44.451 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Betrieb changed from ON to OFF

2020-04-07 15:56:12.177 [ome.event.ItemCommandEvent] - Item ‘BRoKellerFahrradladegerT_Betrieb’ received command ON

2020-04-07 15:56:12.194 [nt.ItemStatePredictedEvent] - BRoKellerFahrradladegerT_Betrieb predicted to become ON

2020-04-07 15:56:12.222 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Betrieb changed from OFF to ON

2020-04-07 15:56:13.154 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Power changed from 0.526244 W to 0.0 W

2020-04-07 15:56:13.163 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Current changed from 0.075005 A to 0.013613 A

2020-04-07 15:56:13.175 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Voltage changed from 235.022788 V to 234.482431 V

2020-04-07 15:56:18.203 [ome.event.ItemCommandEvent] - Item ‘BRoKellerFahrradladegerT_Betrieb’ received command OFF

2020-04-07 15:56:18.216 [nt.ItemStatePredictedEvent] - BRoKellerFahrradladegerT_Betrieb predicted to become OFF

2020-04-07 15:56:18.234 [vent.ItemStateChangedEvent] - BRoKellerFahrradladegerT_Betrieb changed from ON to OFF

Please use How to use code fences. It’s hard enough to read JSON Rules without the formatting getting all messed up.

That’s a QuantityType, not just a number.
You cannot compare 5W with 5.0 … 5.0 what, mW, kW ?
Compare with another QuantityType

Thanks for the Tipp.

But whatever I type here als values:

5.00000 W
5,00000 W

It will be all the time:

" 5.00000 W "
" 5,00000 W "

in the /var/lib/openhab2/jasondb/automation_rules.json

“itemName”: “BRoKellerFahrradladegerT_Power”,
“state”: “5,00000 W”,
“operator”: “\u003c”

and it seems to me that I cannot save any valus with W in the automation_rules.json file the NG editor.
When using values without “W” it save me like this:

“itemName”: “BRoKellerFahrradladegerT_Power”,
“state”: 5.00000 ,
“operator”: “\u003c”

How can I edit the /var/lib/openhab2/jasondb/automation_rules.json
manuell?
What are the steps to edit the /var/lib/openhab2/jasondb/automation_rules.json file?
Stop OH ?
Restart OH?

Question over question.

The funy thing is that other older rules are working like that:

“e5fe75cf-bf9f-49a5-924f-2487f015ac1d”: {
“class”: “org.openhab.core.automation.dto.RuleDTO”,
“value”: {
“triggers”: [
{
“id”: “1”,
“label”: “an item state is updated”,
“description”: “This triggers the rule if an item state is updated (even if it does not change).”,
“configuration”: {
“itemName”: “tplinksmarthome_hs110_7005DE_switch”,
“state”: “ON”
},
“type”: “core.ItemStateUpdateTrigger”
}
],
“conditions”: [
{
“inputs”: {},
“id”: “3”,
“label”: “an item has a given state”,
“description”: “Compares the item state with the given value”,
“configuration”: {
“itemName”: “tplinksmarthome_hs110_7005DE_power”,
“state”: 3.0,
“operator”: “\u003c”
},
“type”: “core.ItemStateCondition”
},
{
“inputs”: {},
“id”: “4”,
“label”: “an item has a given state”,
“description”: “Compares the item state with the given value”,
“configuration”: {
“itemName”: “tplinksmarthome_hs110_7005DE_power”,
“state”: 0.0,
“operator”: “!\u003d”
},
“type”: “core.ItemStateCondition”
}
],
“actions”: [
{
“inputs”: {},
“id”: “2”,
“label”: “send a command”,
“description”: “Sends a command to a specified item.”,
“configuration”: {
“itemName”: “tplinksmarthome_hs110_7005DE_switch”,
“command”: “OFF”
},
“type”: “core.ItemCommandAction”
}
],
“configuration”: {},
“configDescriptions”: [],
“uid”: “e5fe75cf-bf9f-49a5-924f-2487f015ac1d”,
“name”: “Wireless Charger ausschalten bei kleiner 3 Watt”,
“tags”: [],
“visibility”: “VISIBLE”
}
},