openHAB 3.0 Milestone 2 discussion

Can you delete the Item with API Explorer?

No because the item is never added successfully added

It is likely stores in the JsonDb. It should be editable with OH shut down, I believe

The JSON DB is empty

It appears it gets persisted somewhere by the framework itself as an event.

Any suggestion on how to import isNumeric() back into the rules DSL for use? I’ve tried just importing org.apache.commons.lang.StringUtils at the top but I can’t seem to get the syntax for StringUtils working correctly.

That would have worked had you used “32” instead of “32.7”. It very literally only looks for 0-9 as the only characters, the decimal point caused it to fail.

Just do something like:

var str = "32"
try {
   var number = Integer.parseInt(str)
   // Do stuff
} catch (NumberFormatException e) {
   // Do other stuff
}
1 Like

That worked. Not the most elegant thing but it gets me back up and going. Thanks!

I really like where Openhab is going with these releases! Some quirks that I have observed so far:

  • time to boot openhab up is significantly longer than it was with openhab 2 (now ~5 minutes, before ~30 seconds)
  • overall a tad less snappy than OH2, especially latency between physical interaction and reaction of the system
  • sometimes most of my rules just stop working. Right now I can’t make them work anymore, but since its in the middle of the night now I give up :slight_smile:
    All rules have been imported from OH2 rules files.

Relevant Log entries (interesting: Caused by: java.lang.IllegalStateException: Cannot create a duplicate value ‘newState’.):

[ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule ‘licht-2’: Fail to execute action: script
[DEBUG] [e.automation.internal.RuleEngineImpl] -
java.lang.RuntimeException: Fail to execute action: script
at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1187) ~[bundleFile:?]
at org.openhab.core.automation.internal.RuleEngineImpl.runRule(RuleEngineImpl.java:987) [bundleFile:?]
at org.openhab.core.automation.internal.TriggerHandlerCallbackImpl$TriggerData.run(TriggerHandlerCallbackImpl.java:91) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.IllegalStateException: Cannot create a duplicate value ‘newState’.
at org.eclipse.xtext.xbase.interpreter.impl.DefaultEvaluationContext.newValue(DefaultEvaluationContext.java:46) ~[?:?]
at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.createEvaluationContext(DSLScriptEngine.java:143) ~[?:?]
at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.eval(DSLScriptEngine.java:118) ~[?:?]
at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:62) ~[?:?]
at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:59) ~[?:?]
at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1179) ~[bundleFile:?]
… 7 more

Running on build #2009

Edit: #2009 seems to be broken acc. to Rule causes high load and queue issues

1 Like

@mpuff Yes, fmiweather will not work on m2, there is something broken in core that makes it fail.

More info

1 Like

thx for this information :slight_smile:

Running on build #2009

Snapshot 2009 has broken rules, don’t use it and wait for the next snapshot.

1 Like

Unbenannt

Look at the chatIds parameter (a List<String> or multiple text).Why are two values enclosed in double-quotes and one value is without quotes?

In respect to time to start, im having the opposite issue. When I go to shutdown it can take 5 minutes for everything to stop. From what I can tell, the bindings stop pretty quickly as my things all go offline. My rules however continue to kick for several minutes (most are cron based execution so not triggered by items). This was not an issue on OH2.

The YAML stringifier will add double-quotes automatically for strings where there might be an ambiguity on their type, the < character is probably key here, the other values could maybe be considered to be numbers so it added the quotes.

Is it possible to change that? I think that is not very clear.

1 Like

Don’t think so: https://eemeli.org/yaml/#yaml-stringify - there’s no option related to that as far as I can tell.
(edit: maybe str.defaultType here https://eemeli.org/yaml/#scalar-options)

More info on using quotes in YAML: https://www.yaml.info/learn/quote.html

The formatting of some floating point numbers in channels raises exceptions. I have attached two examples for Eltako devices from the EnOcean binding.

The first is the total feed of a smart power meter (Eltako FSS12), the second one is the humidity measure provided by a sensor (Eltako FIFT63AP). The data from other channels of the two devices are formatted correctly.

15:59:11.845 [WARN ] [se.internal.SseItemStatesEventBuilder] - Exception while formatting value '66047.4 kWh' of item PVEinspeisezahler_TotalUsage with format '%d %unit%': d != java.math.BigDecimal

15:55:34.907 [WARN ] [se.internal.SseItemStatesEventBuilder] - Exception while formatting value '48.8' of item SensorBadOG_Humidity with format '%d %%': d != java.math.BigDecimal

%d formats an integer. Obviously both numbers are floating point. Is this format set in your Sitemap?

Hi @rlkoshak - I upgraded my openhab instance to OH3 M2 using the Openhabian beta menu item. Unfortunately, frontail is configured to point to /var/log/openhab2/openhab.log and /var/log/openhab2/events.log. Do you happen to know where these directories are configured for frontail?
I looked in /lib/system.d/system and could not find the service file there.

Thanks,
Randy

Thank you for the quick response. I have just started with openHAB and little experience with Java (although much experience with other languages). As far as I have understood the formats for the channel data are determined by the Eltako binding. In channels.xml I found these:

    <channel-type id="humidity">
		<item-type>Number</item-type>
		<label>Humidity</label>
		<description>Relative humidity level in percentages</description>
		<category>Humidity</category>
		<state min="0" max="100" step="1" pattern="%d %%" readOnly="true"/>
	</channel-type>

    <channel-type id="totalusage">
		<item-type>Number:Energy</item-type>
		<label>Total Usage</label>
		<description>Used energy in Kilowatt hours</description>
		<state pattern="%d %unit%" readOnly="true"/>
		<config-description>
			<parameter name="validateValue" type="boolean">
				<label>Validate Value</label>
				<description>Filter out increases more than 10.0 kWh and decreases less than 1.0 kWh</description>
				<default>false</default>
			</parameter>
		</config-description>
	</channel-type>

Can I reformat these values myself? Or should I contact the maintainer(s) of the binding to change these settings?

I do not use frontail. But if you run sudo systemctl status frontail it will show you the path to the .service file that starts frontail.

1 Like

Seems like expire binding still has some outstanding issues but it’s already 2 weeks since M2. Can I make a little request that M3 waits for expire binding? I’m sure I’m not the only one that relies on it for migrating in from 2.5.

2 Likes