Hey friends. i have now Update from OH3.4.4 to OH4.3.2
After this Upgrade my Blockly Rules doesnt work anymore, because i have a lot of If Else Rules in MATH he Calculate the Addition False.
For Example.
OH3= 8+1 = 9
OH4=8+1= 81
But they are Number Items without Unit in Number Blocks (Not String Item). Minus going Right, but Plus going False…
I have Zulu17.0.13 and OH4.3.2 Any Ideas?!
Wenn i make 8-1 in OH4 they made 7. but wenn i will 7+1, he made 71…
EDIT:
I HAVE NOW FIND A NEW BLOCK IN MATH (NUMBER) the 2nd from Up.
He Convert the VariableNumber to a NumberNumber…
Must i all convert all Rules with variables the new 2nd NUMBER Block?!.. Okey…
Next Problem is on OH4 i can test if Icon works when i edit the name of a icon.
He made on sitemap after the new blockly math 2nd rule a Point.0 at the end of the state.
OH3=state was 600 and i see the post-600.png icon
OH4=state was after the new Blockly Math 2nd Rule 600.0 and he cant find a post-600.0.png icon, but when i go to Developer Tools and Test the Icon name post-600.0 i see it?! but not on sitemap…
I think OH4 Bug and Blockly Bug…
i have 2 years OH3 and i am hold to ignore the OH4 upgrade on raspbian. I think it was a good time to change to OH4, but 2 years ago i am was beginner and i dont want directly upgrade it from a few days first work with OH3. i would learn, but this is very fail… i tell (Only Update) and Nothing Works. Thats normally i think…
In OH 4 Blockly “compiles” to JS Scripting and the openhab-js helper library. One of the key differences is there is now several different ways to get the state of a Number Item. The default .state is always a String. However, the “get [name] of item” block also offers “numeric state” and “quantity state”.
If you need to do math, you want to use one of these blocks.
To be honest, you were previously depending on a unique feature of Nashorn that is not generic JS. There has always been that Number block. It’s just now that JS treats a String as a String instead of trying to auto covert it to a Number (and sometimes getting it wrong). But you should have used that number block from the beginning.
What’s your label? If it’s not %d it will treat the value as a floating point number.
I think the first change was discussed in the blog that covered all that’s new in Blockly in OH 4. I didn’t know about the second change but it’s not related to Blockly.
i edit all my Variable Math-Rules with an additional Math Block (Number Blockly, 2nd from Up) and works now.
But i have sometimes the feeling that the Openhab 4.3.2 stop works for a few seconds any times when i was edit a Rule/Thing or Install/Remove a Binding. In Log i see:
Can’t get a WebContainer service from {org.osgi.service.http.HttpService, org.ops4j.pax.web.service.WebContainer}={org.ops4j.pax.web.log.ncsa.extended=true, org.ops4j.pax.web.ssl.keystore.password=********, service.scope=bundle,
but i dont know what i can do i dont find a solution. I used Zulu17 on Raspbian ARM32HF. And openhab-cli console say (karaf):
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See SLF4J Error Codes for further details.
SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J(W): Ignoring binding found at [jar:file:/usr/share/openhab/runtime/system/org/apache/karaf/org.apache.karaf.client/4.4.6/org.apache.karaf.client-4.4.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J(W): See SLF4J Error Codes for an explanation.
Can i Downgrade to 4.3.1 or is that so on this Version?
Can you tell me if the SLF4J Error means the same like Can’t get a WebContainer service from {org.osgi.service.http.HttpService, org.ops4j.pax.web.service.WebContainer}= in openhab.log?
Is It Possible to Disable Bindings or Things that no compatibile to OH4? I am see in log that when OH4 is stocks, any Things going Offline, and Online Back.
If you are running OH 4, all of your bindings must be compatible it else you’ll have problems.
But assuming you do not have any jar or kar comes in the add-ons folder, all the l if your bindings are compatible with the version of OH you are running. If you do have fines in that folder, remove them.