You can use all kinds of “transformation” for parsing the payload. Easiest would be, if you can configure the homematic for a JSON payload. But Regex works also:
Number Temperature "Temperature [%.1f °C]" { http="<[http://YOURHOMEMATICIPURL):<refreshintervalinmilliseconds>:<transformationrule>]" }
http="<[http://YOURHOMEMATICIPURL:60000:REGEX(.*\"actualTemperature\((.*)\).*)]"
(thatone is untested and I’m not the REGEX-expert. but I remember, my CCU2 having JSON already, so homematic IP should also have JSON - which would be easier to parse)
Number Temperature "Temperature [%.1f °C]" { http="<[http://YOURHOMEMATICIPURL):<refreshintervalinmilliseconds>:<transformationrule>]" }
http="<[http://YOURHOMEMATICIPURL:60000:JSONPATH($.actualTemperature)]"
Installed the mysql peristent but connection dont work, did exact things from the tutorial:
22:31:00.282 [WARN ] [ysql.internal.MysqlPersistenceService] - mySQL: No connection to database. Can not persist item ‘Test_HumidityMYSQL (Type=NumberItem, State=92)’! Will retry connecting to database when error count:0 equals errReconnectThreshold:0 22:31:00.300 [ERROR] [ysql.internal.MysqlPersistenceService] - mySQL: Failed connecting to the SQL database using: driverClass=com.mysql.jdbc.Driver, url=jdbc:mysql://192.168.1.108:3306/openhab, user=openhab, password=********************* com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
mysql.cfg
the database url like ‘jdbc:mysql://:/’ (without quotes)
url=jdbc:mysql://192.168.1.108:3306/openhab
most likely you don’t have permission to connect to the MySQL database. This can have various reason, please have a look (my guess is 5 or internal restrictions) - Do you run your MySQL-Server on your openHAB2-server or externally?
If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException:
Communications link failure, then it means that the DB isn’t reachable at all. This can have one or more of the following causes:
IP address or hostname in JDBC URL is wrong.
Hostname in JDBC URL is not recognized by local DNS server.
Port number is missing or wrong in JDBC URL.
DB server is down.
DB server doesn’t accept TCP/IP connections.
DB server has run out of connections.
Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
To solve the one or the other, follow the following advices:
Verify and test them with ping.
Refresh DNS or use IP address in JDBC URL instead.
Verify it based on my.cnf of MySQL DB.
Start the DB.
Verify if mysqld is started without the --skip-networking option.
Restart the DB and fix your code accordingly that it closes connections in finally.
Disable firewall and/or configure firewall/proxy to allow/forward the port.
Installed the mysql db on my nas with the ip 192.168.1.108 , there is already running a kodi db which is rechable from every kodi client in the network.
adress is pingable from pi.
So, did you create a database with name openhab?
Did you create a user with full access to the database?
Did you set permissions for the user to access the db from network?
Looks it worked now, but the chart is empty. (No Errors more in Openhab Log)
If i select Default Setting in the charts widget, it should use the mariadb ?
To get any item i want is chart shown it needs to be entered in the jdbc.persist file ?
As your default persistence is jdbc, it should work out of the box.
Take a look at the database itself. There should be a table for each item persisted in jdbc.
mariadb is a fork of mysql - and works (at least for our low-level purposes) exactly like MySQL. I also have MariaDB on my Synology running and I am using the mysql-persistence. You have to tell openHAB to use it just like mysql. Meaning, if using HABPanel, it should look like this:
if your using the “Default”-Chart, it will then show only one graph - and only if there are items persisted. So, as Udo said, please have a look, whether there are any items in your DB at all. It seems as there aren’t - Then you have to check your .persist file, if you told your item (or Group for that item) to persist “onChange”, as I guess this is what you want. Otherwise you only have items states at e.g. midnight
For testing i entered my energy usage items (TPLINKSMARTHOME PLUGS HS110) in the persistfile, but it don’t creates anything in the DB. Do i only need to add the existing Items in the *.persists file , thats all ?
Sorry that I wanted to show you a working way … Then use the HmIP access point, which is not integrated in Openhab. What is this for a home automation, please? Openhab should be the central unit … and not a Work A Round …