Problem with collecting data with persistence into database

Hey , I’m wondering if anyone can point me in the right direction and tell me what I miss or do something wrong . I search every tutorial about persistence and I test a couple of binding rrd4j, dynamodb, mapdb ext… to collect data and manage but when I search it I don’t see anything , only files created on the persistence folder. I using openhabian on rasp’s and openhab , I’m looking for manual installation instructions.

Thanks a lot

It’s not clear what and how you are searching to find the data. The fact that you see files in the persistence folder shows that OH is saving data, at least for mapdb and/or rrd4j. Where are you expecting to see data that you are not?

Hi, Thank you for reply me . I’m sorry for my unclear question. I want viewing data on one database . I had also tried dynamodb and connected to my amazon aws account I followed all the steps, but the data is not loaded. So I don’t understand where I’m wrong. I would just like to find a way to send the data of the “things” into a database to be able to view and manage them

First, Things don’t get saved to the database. Only Items get saved.

Secondly, “view and manage” where? In MainUI? BasicUI? Some external app?

What do you mean by “view”? Put into a chart? A table?

What do you mean by “manage”?

OH comes with rrd4j installed by default (unless you’ve upgraded from 2.5). rrd4j, by default will save all supported Items on every change and every minute.

How exactly have you installed and configured dynamodb? Which add-on? What’s your .persist configuration?

  • OK
  • Well if this is possible , I want to manage into database "obviously external software "
  • View I mean put in a table
  • Manage is control and verify that info
  • OK , I have specifically the OH 3.2.0
  • I create AWS account and follow every steps from the OH Configuration Guide . I installed with add-on and create the config file and added into persistence folder .
  • My Persist Config is this :

############################ Amazon DynamoDB Persistence Service ##################################

The following parameters are used to configure Amazon DynamoDB Persistence.

Further details at Amazon DynamoDB - Persistence Services | openHAB

PID SETTING

When configuring the persistence using file (instead of a UI),

make sure the first line in the configuration file is the

pid definition (remove the comment prefix #)

pid:pid:org.openhab.dynamodb

CONNECTION SETTINGS (follow OPTION 1 or OPTION 2)

OPTION 1 (using accessKey and secretKey)

accessKey=**************************
secretKey=***************************
region=eu-west-1

OPTION 2 (using profilesConfigFile and profile)

where profilesConfigFile points to AWS credentials file

Please note that the user that runs openHAB must have approriate read rights to the credential file.

See below for an example how the credentials file should look like

profilesConfigFile=/etc/openhab2/aws_creds
profile=openhab
region=eu-west-1

UNCOMMENT THE BELOW ALWAYS (otherwise legacy table schema with ‘tablePrefix’ is used)

table=openhab3

Credentials file example:

[openhab3]
aws_access_key_id=**************************
aws_secret_access_key=***********************

ADVANCED CONFIGURATION (OPTIONAL)

Expire time for data in days (relative to stored timestamp).

Data older than this is removed automatically using DynamoDB Time to Live (TTL)

feature.

#expireDays=

read capacity for the created tables

#readCapacityUnits=1

write capacity for the created tables

#writeCapacityUnits=1

LEGACY SCHEMA: table prefix used in the name of created tables

#tablePrefix=openhab-

Please use code fences.

```
code goes here
```

I don’t know anything about DynamoDB so the config you’ve posted (I assume that’s what it is, without code fences it’s all but impossible to interpret) is meaningless. But that config has nothing to do with controlling which Items get saved under what circumstances. See Persistence | openHAB for how to define which Items are saved under what circumstances.

In MainUI go to Settings → Persistence and select DynamoDB as the default. Your

Sorry , it’s my fault

I post here again the configuration for dynamodb.persistence

############################ Amazon DynamoDB Persistence Service ##################################
#
# The following parameters are used to configure Amazon DynamoDB Persistence.
# 
# Further details at https://www.openhab.org/addons/persistence/dynamodb/
#

# PID SETTING
#
# When configuring the persistence using file (instead of a UI),
# make sure the first line in the configuration file is the 
# pid definition (remove the comment prefix #)

pid:pid:org.openhab.dynamodb


#
# CONNECTION SETTINGS (follow OPTION 1 or OPTION 2)
#

# OPTION 1 (using accessKey and secretKey)
accessKey=****
secretKey=****
region=eu-west-1

# OPTION 2 (using profilesConfigFile and profile)
# where profilesConfigFile points to AWS credentials file 
# Please note that the user that runs openHAB must have approriate read rights to the credential file.
# See below for an example how the credentials file should look like
profilesConfigFile=/etc/openhab2/aws_creds
profile=openhab
region=eu-west-1


# UNCOMMENT THE BELOW ALWAYS (otherwise legacy table schema with 'tablePrefix' is used)
table=openhab3



# Credentials file example:
#
 [openhab3]
 aws_access_key_id=****
aws_secret_access_key=****


#
# ADVANCED CONFIGURATION (OPTIONAL)
#

# Expire time for data in days (relative to stored timestamp).
# Data older than this is removed automatically using DynamoDB Time to Live (TTL)
# feature.
#expireDays=

# read capacity for the created tables
#readCapacityUnits=1

# write capacity for the created tables
#writeCapacityUnits=1

# LEGACY SCHEMA: table prefix used in the name of created tables
#tablePrefix=openhab-

Already been done. This is the problem, whatever persistence I have set in the past.

I would like to know if there is a method to send the data of things into a database?
Or I have to use the mqtt protocol ?

Persistence only deals with Items by design. What information from a Thing would you want to store in the database that cannot be linked to an Item?

I’m not sure what MQTT would buy you unless this database somehow speaks it. You’d have to write rules in that case but then the only information you’d have to publish about the things are their status (e.g. ONLINE status).

Ok, in my project the first thing I want to do is measure electric voltage from the “PowerOutlet” and keep this info “Power Consumption (kWh)” into db with his status (On/Off)

So you have a Thing that represents the power outlet. That Thing would have a Channel with the voltage. That Channel is linked to an Item.

I can’t provide details because those depend on the binding.

Everything in openHAB runs off the Items. That’s the power of OH. It doesn’t matter if its MQTT, Zwave, KNX or data pulled from some website. A Switch is a Switch no matter what.

Yes, and in this case I using two power outlet MEROSS with no bindings available so is impossible for me have all functionality fully accessible, so I using Amazon Account to add this things and control their power status on or off .Obviously din’t work the power consumption graph , so Is possible to create a channel to have voltage info ?

Exactly

If there’s no binding there’s no Channel. You can control devices through Alexa but you can’t have sensors report through Alexa. If this deviuce/technology/api isn’t supported by a binding in OH then no, it’s not possible.

Yes there’s no binding.
Yes I control only the power but the other function no.
So I really need only device are fully compatible with bindings.
I need to find something else .

I want use one rasp with openhabian configured as Mqtt broker to get from another rasp with openhabian to, with things configured and send info into database. If i try to do this is possible?

With enough work and writing of rules, sure it could be done. It’s going to be a whole lot of work though.

I want to thank you for the time you spent solving my problems. I really appreciated it