Multiple Persistence add-ons configured, ignore errors?

OH runs on a Raspberry Pi and the configuration includes mapdb (default) and jdbc as I hope to collect the data and eventually do something interesting with it. I have it pointed at a postgres server that run somewhere else and may have occasional downtime but I’ve noticed that when postgres is down, OH seems to stall and no longer run normally.

Is there a way to configure my non-default persistence to ignore errors and just drop the data that couldn’t get saved when the server is down?

My understanding is it’s already supposed to work that way. I recommend filing an issue.

i dont see documentation saying it should or shouldn’t work that way but i’ll try to setup a simple config to verify it.

on a side note, i think i’m going to use the mqtt persistence instead as it actually seems more appropriate. i got that working last night and it works well except that it seems to do a poor job of serializing some data types – GregorianCalendar from astro binding appears as:

java.util.GregorianCalendar[time=1590513357762,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT-07:00",offset=-25200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2020,MONTH=4,WEEK_OF_YEAR=22,WEEK_OF_MONTH=4,DAY_OF_MONTH=26,DAY_OF_YEAR=147,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=10,HOUR_OF_DAY=10,MINUTE=15,SECOND=57,MILLISECOND=762,ZONE_OFFSET=-25200000,DST_OFFSET=0]

i’ll need to investigate if things there can be formatted or else i’ll have to do it on the consumer side.

Please don’t.

  • it requires and only works with the MQTT 1.x binding which is end of life and will not be supported by OH 3
  • it’s write only and not queryable
  • it is full of bugs and essentially was abandonded when the MQTT Event Bus was developed for MQTT 1.x something like seven years ago.

If you want to use MQTT to publish Item updates over MQTT, a better approach is to use the 2.x binding: MQTT 2.5 Event Bus.

thanks. i’ll try that. i misread it first and i thought it required jython setup and i went that route and it seemed to break all my rules so i reread it and it seems to only require me to put things in groups. not too much of a task except that i can’t seem to find a way to create a group from paperui and habmin almost lets me do it but from i read in old (2 years old) posts, it seems i have to use an items file to create groups so i’ll explore that tonight.

Make sure you have Simple Mode turned off (you should anyway). Then go to the Items menu, click on “Add Items” and select Group for the type.

I’ve tried using groups before and failed, and today I swear I spent at least 3 hours with no luck. All my things were added while in “simple mode” but I’ve switched that off for now. In a simple case I wanted to add a group for contact sensors for the windows (since it’ll serve dual purpose to turn off a/c when open)… in the group screen I created a group with base type as contact but the edit item screen (for the contact sensor) shows no groups I can use. I get the same empty screen when using habmin.

Most documentation and discussions I see about groups and things are always using the .items files but I’m not sure if that means I’d have to redo all my things and items away from paperui and switch to files. I was under the impression OH was moving away from those files slowly.

I didn’t want to create a new post but I couldn’t find one that dealt with the paperui issue – well there was one but somehow they didn’t get the blank list.

Why not, it’s free.

As I don’t use PaperUI for this myself, I had a play and made a blunder causing just the effect you describe.
PaperUI > Configuration > Items > + > New Item
Thinking about “Group”, I selected Contact.
What it created of course was an ordinary Contact Item, which obviously doesn’t show up in lists of Groups.
What I missed was scrolling further down the list of Item types to select Group. (Once selected, you then get another box for base-type where you can choose Contact type Group. It then insists on an aggregate Function as well.)

Sound right?
Once edited to Group type with Contact base type, my new group was offered in the ‘Parent groups’ drop down of a newly created Item for membership. OH 2.5.0

EDIT - afterthought -

I do not think you can edit Items created by simple mode. Is it as simple as that?

Yeah initially I created a contact but then I found group too but it wasn’t enough. I think you hit the nail on the head about only non-simple items can be edited. Now I gotta figure out how to add said item so it actually works. I’ll move that to a new post though. Thanks!