Diagram Door - mySQL 0 and 1

Oh wait…the DB entries in your initial post are for item **str_**sw03 and in the chart item later on you reference item=**door_**sw03
Could it be that you just don’t have any datasets for item=**door_**sw03 ?

oh sorry, i shortened the name …

other chart with new data every minute:

4h

12h

24h

here is everything working as expected …

weird…but really, the only thing that imho sounds plausible is that you are directing the chart item to the wrong data set. Maybe double check the mapping in your db, which “ItemXX” is “door_sw03” mapped to in the “Items”-Table, then check the data in the table “Itemxx”

i checked it again and again and again … i think it’s correct …
i rechecked the database(s) and it is correct to …

Hmm…you wrote:

i defined it as string … as number it works like a charme.

so i suppose you changed your entry in the .items file?
I think this could provoke a second entry in the Items table with an identical name “door_sw03”
maybe you could check for this?

no, i renamed it for this thread … BUT … i changed it from string to number, and so i have to change from varchar to double … i am checking it right now.

now, nothing would be saved …

if i add some data manually, it will displayed correctly …

i hate it, nothing is working but no error messages … :triumph:

I would suggest:

  • delete DB entry (check for duplicates) for “door_sw03” in “Items” Table
  • Delete corresponding “ItemsXX” table (depending if any dups found, could be more than one)
  • trigger sensor to see if new entries created new entry in “Items” Table for “door_sw03” and if new “ItemsXX” table gets created and -hopefully - filled with data

by now i found out, that, if the last value is like the new value, it won’t be saved …
… strange but logical … but gives not good looking diagrams

is there a config parameter out there which says the persistence to save every collected value in my db?
the diagramm now looks like this, it would look nicer if i.e. zero-values are stored every time they came.

i got this values every minute, if the value changed, it would be saved.

I think the persistence only stores changes in a value automatically. if there is just a status update, this gets not saved. To achive saving of status updates, you will need to implement a rule; something like:

rule "Save update"
when Item door_sw03 received update
then
        postUpdate (door_sw03,door_sw03.state) 
end

You might need to fiddle with the parameters for postupdate, but this example should get you started.

i thought with this strategies could it be work, but , nope

// Persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies 
{
    everyMinute : "0 * * * * ?"
    everyHour     : "0 0 * * * ?"
    everyDay     : "0 0 0 * * ?"

    default = everyChange 
}

/*
 * Each line in this section defines for which item(s) which strategy(ies) should be applied.
 * You can list single items, use "*" for all items or "groupitem*" for all members of a group
 * item (excl. the group item itself).
 */

Items 
{
    grp_homebb01_persistence_mysql* : strategy = everyChange, everyHour, restoreOnStartup
    door_sw*  : strategy = everyChange, everyHour, restoreOnStartup, everyMinute
}

i will try your rule idea … i’ll report then …
by now i have other mysterious things to get work with other diagrams and periods …

i did a quick check here:

looks like my rule approach is unnecessary:

everyUpdate: persist the state whenever its state has been updated, even if it did not change

You will only need to add everyUpdate to your strategy for door_sw*

i think i have, if you look at my last post, but every minute do not seemed to work.

while i was writing this post, i refreshed the database to see last values

the persistence file was updated at

you can see, everyMinute is not working, and i do not have erros in openhab.log.

Additional Info

every item, that i want to persist, is member of this group, i added the item(s) door_sw* additional - there comes an idea to my mind: could it be, that door_sw* only works for groups and not for single items?

That is correct. * Is not a wild card meaning b any item that starts with door_sw. It only means “every member of this group”. You can only use * with a group and you must use a full group name.

in my case

grp_homebb01_persistence_mysql

means, the group’s value/state itself and

grp_homebb01_persistence_mysql*

the value/state of ALL members of this group?

items with a “special” strategy have to write down one by one with full name.

right?

From the Wiki:

< groupName >* - all members of this group will be persisted, but not the group itself.

So your assumption is correct.
However, your strategy only has everyChange in it. I’m pretty sure you’ll need to add everyUpdate so updates are written to DB.

i dont saw erveryUpdate before … i’ll try it.

Correct, or create a group fit that survival strategy and use * . This is what I recommend. It lets you control which Items are persisted with which strategy through group membership which lets you see in one place (items file) which Items are outdated and how.

yes, i am with you. i changed it to the groups right as you told me to do so.

everyUpdate is IMHO not a good option, it seemed that every item of this group (the most of my sitemap) triggers an update-event. so i got db-entries with 1,2,3 seconds delay, instead of one minute.

i believe, my best way is to seperate items with high freq. update(=change) events from low freq. updated items.