Max min temp issues after updating to 3.0

does it work?

Unfortunately not

Have you still got all those imports at top? They’re not appropriate for OH3 - except maybe the simple date format.

I have now tried to remove them but without success, it still does not work, I may have forgotten to install something to make it work

Maybe it is a totally different problem but I also have a problem with a temperature rule.

rule "Heater Tuinschuur"
when
    Item ZWaveNode010FGBS001UniversalBinarySensor_Temperature2 changed
then 
if (ZWaveNode010FGBS001UniversalBinarySensor_Temperature2.state < 9 ) 
{ ZWaveNode007ZMNHYDSmartPlug_Switch.sendCommand(ON)
}
if (ZWaveNode010FGBS001UniversalBinarySensor_Temperature2.state > 11 ) 
{ ZWaveNode007ZMNHYDSmartPlug_Switch.sendCommand(OFF)
}
end 

I feel a bit stupid asking the question here but within OH 2.5 it worked.
When I delete ‘then’ and ‘if’ parts the plug switch turn on.

@Koensk You probably need this advice

1 Like

Thank you so much, that did the trick

I still can not make this work, does anyone have an idea of what is missing or what I may have forgotten when I updated from 2.0 to 3.0, because it worked fine in 2.0

Give us some help here. What happens or doesn’t happen? Have you looked in your openhab.log for clues?

The big change in OH3 that’s relevant for time handling rules is that the Java time functions have all changed. For example, “now” still exists, but it’s a different kind of object with different functions.

This looks relevant

For self help, add some logInfo() lines to your rule so that you can see how far it gets and important values along the way e.g.

if (Temperatur_Udebygninger_Carportnord.state instanceof DecimalType) {
   logInfo("test", "TempUC " + Temperatur_Udebygninger_Carportnord.state.toString)
   Min = (Temperatur_Udebygninger_Carportnord.minimumSince(now.with(LocalTime.MIN), “rrd4j”).state as DecimalType)
   logInfo("test", "Min " + Min.toString)

I dont have any logs from aften i swicht to OH 3.0

That will make it hard for you to sort out this and any other issues later. I’d make fixing that your priority for now.

Now i got the log fil running and i get this in the log file

2021-01-25 06:25:36.690 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Temperatur_Udebygninger_Carportnord (Type=NumberItem, State=0, Label=Temeratur udenfor, Category=temperature, Groups=[gHistory])’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 06:26:03.546 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 06:26:03.548 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!

1 Like

That looks fairly fundamental.
You may have to look back in your log to see what the persistence service has to say at start up time.

Hi
I have made a restart and this is the log from startup

So could indicate I am missing some setup however I am in doubt about where and what

2021-01-25 12:16:36.526 [ERROR] [ence.jdbc.internal.JdbcConfiguration] - Mandatory url parameter is missing in configuration!
2021-01-25 12:16:49.127 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:16:49.128 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:16:49.129 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Humidity_Vaerksted (Type=NumberItem, State=73.60, Label=Humidity, Category=climate)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:14.314 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:14.316 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:14.318 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Temperatur_Udebygninger_Carport (Type=NumberItem, State=1.37, Label=Temeratur Carport, Category=temperature, Groups=[gHistory])’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:14.431 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:14.432 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:14.432 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Temperatur_Udebygninger_Carportnord (Type=NumberItem, State=0.87, Label=Temeratur udenfor, Category=temperature, Groups=[gHistory])’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:29.043 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:29.052 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:29.054 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Date (Type=DateTimeItem, State=2021-01-25T12:17:29.037+0100, Label=Date, Category=null)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:30.094 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:30.094 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:30.095 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Temperature_Vaerksted (Type=NumberItem, State=7.00, Label=Temperatur værksted, Category=null)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:30.213 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:30.213 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:30.213 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Humidity_Vaerksted (Type=NumberItem, State=73.50, Label=Humidity, Category=climate)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:51.081 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:51.081 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:51.082 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Temperature_Vaerksted (Type=NumberItem, State=7.10, Label=Temperatur værksted, Category=null)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0
2021-01-25 12:17:51.199 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:51.199 [WARN ] [persistence.jdbc.internal.JdbcMapper] - JDBC::openConnection: no driver available!
2021-01-25 12:17:51.200 [WARN ] [jdbc.internal.JdbcPersistenceService] - JDBC::store: No connection to database. Cannot persist item ‘Humidity_Vaerksted (Type=NumberItem, State=73.60, Label=Humidity, Category=climate)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0

Again, this looks pretty fundamental.
It’s talking about jdbc.cfg
Have you got that file? Is it in the right folder? What are the contents?

I don’t know any more about this than it says in JDBC docs.

is i got the file

############################ JDBC Persistence Service >##################################

I N S T A L L J D B C P E R S I S T E N C E S E R V I C E

JDBC Persistence · openhab/openhab1-addons Wiki · GitHub

Tested databases/url-prefix: jdbc:derby, jdbc:h2, jdbc:hsqldb, jdbc:mariadb, jdbc:mysql, >jdbc:postgresql, jdbc:sqlite

derby, h2, hsqldb, sqlite can be embedded,

If no database is available it will be created, for example the url ‘jdbc:h2:./testH2’ creates a new DB >in OpenHab Folder.

Create new database, for example on a MySQL-Server use:

CREATE DATABASE ‘yourDB’ CHARACTER SET utf8 COLLATE utf8_general_ci;

D A T A B A S E C O N F I G

Some URL-Examples, ‘service’ identifies and activates internally the correct jdbc driver.

required database url like ‘jdbc::[:;]’

url=jdbc:derby:./testDerby;create=true

url=jdbc:h2:./testH2

url=jdbc:hsqldb:./testHsqlDb

url=jdbc:mariadb://192.168.0.1:3306/testMariadb

url=jdbc:mysql://192.168.0.1:3306/testMysql

url=jdbc:postgresql://192.168.0.1:5432/testPostgresql

url=jdbc:sqlite:./testSqlite.db

url=

required database user

#user=

required database password

#password=

E R R O R H A N D L I N G

optional when Service is deactivated (optional, default: 0 → ignore)

#errReconnectThreshold=

I T E M O P E R A T I O N S

optional tweaking SQL datatypes

see: https://mybatis.github.io/mybatis-3/apidocs/reference/org/apache/ibatis/type/JdbcType.html

see: Data Types

see: PostgreSQL: Documentation: 9.3: Data Types

defaults:

#sqltype.CALL = VARCHAR(200)
#sqltype.COLOR = VARCHAR(70)
#sqltype.CONTACT = VARCHAR(6)
#sqltype.DATETIME = DATETIME
#sqltype.DIMMER = TINYINT
#sqltype.LOCATION = VARCHAR(30)
#sqltype.NUMBER = DOUBLE
#sqltype.ROLLERSHUTTER = TINYINT
#sqltype.STRING = VARCHAR(65500)
#sqltype.SWITCH = VARCHAR(6)

For Itemtype “Number” default decimal digit count (optional, default: 3)

#numberDecimalcount=

T A B L E O P E R A T I O N S

Tablename Prefix String (optional, default: “item”)

for Migration from MYSQL-Bundle set to ‘Item’.

#tableNamePrefix=Item

Tablename Prefix generation, using Item real names or “item” (optional, default: false → “item”)

If true, ‘tableNamePrefix’ is ignored.

#tableUseRealItemNames=

Tablename Suffix length (optional, default: 4 → 0001-9999)

for Migration from MYSQL-Bundle set to 0.

#tableIdDigitCount=

Rename existing Tables using tableUseRealItemNames and tableIdDigitCount (optional, default: >false)

USE WITH CARE! Deactivate after Renaming is done!

#rebuildTableNames=true

D A T A B A S E C O N N E C T I O N S

Some embeded Databases can handle only one Connection (optional, default: configured per >database in packet org.openhab.persistence.jdbc.db.* )

see: Hikari connection pool grows to maximum size at start · Issue #256 · brettwooldridge/HikariCP · GitHub

jdbc.maximumPoolSize = 1

jdbc.minimumIdle = 1

T I M E K E E P I N G

(optional, default: false)

#enableLogTime=true

I get this eurro also

2021-01-25 13:24:18.661 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘tempcarp-1’ failed: ‘toDateMidnight’ is not a member of ‘java.time.ZonedDateTime’; line 22, column 65, length 18 in tempcarp

do you know how do set this up as when it worked in OH2 with rrd4j, there was no jbdc.cgf file to set up in OH2

The jdbc.cfg file seems to missing the mandatorry url= parameter, just as it said.

If you do not want to use jdbc persistence, uninstall it.

If you want to use rrd4j persistence install that. It should be installed by default in OH3, but clearly something has been messed about with here.

These are different services that you choose.

You have not used the suggestion already given