Normally I tend to figure stuff out for myself but I have had this rule working for months and now either somethings changed or I have changed something inadvertently.
The following is showing an error in VSCode - post Update - Ambiguous feature call
rule "Update power Consumption"
Time cron "0 0 0 1/1 * ? *"
MainSupplykWh.postUpdate(MainSupplykWh.state as Number)
This is also not working with the same error…
rule "Update power consumption"
Item MainSupplykWh changed
MainSupplykWh_Today.postUpdate( MainSupplykWh.deltaSince( now.withTimeAtStartOfDay() ) )
Any ideas would be extremely appreciated.
Log out the result of the deltaSince calls. What is it returning? Is it
How do the Rules perform when loaded into OH? Do they run? Do the files fail to load? Generate errors when they run?
There are errors on lines 6 to 9 under
postUpdate as well as under postUpdate on the 2nd rule.
The rules are not running and yes the calls are returning NULL.
Subsequent rules that require data from these rules are obviously not working. However other rules files are fine and running. Its only a file called energy.rules that is affected. I have created a new energy.rules and just put in these specific two rules (thinking a corrupt file) and still the same error.
NULL is different from null. NULL is a special state that indicates that an Item has not be initialized since OH started. null means “no result”. If the deltaSince methods are returning “null” that means that there is something wrong with your persistence. That needs to be the focus of your investigations.
Ok I found an error in the Influxdb.persist file. It was persisting the wrong item names. Part of a longer story but that is now correct and I have re-started openhab.
Still the same errors though. Will keep looking.