Are in influxdb saved items faster avaiable as without influxdb?

Has this data ever changed? (“the data” here is the text “/static/rating3.png”)
If not, I don’t think that will retrieve anything.
Try the simpler
Item_recent_movie_home0_rating.previousState(“influxdb”).state

1 Like

no in the actually example not.
okay, you are right, that works well :grinning:

I have one more question for you, you seem to be very familiar with openhab.

is it possible to download images using a url and save them on the opehab sd card?

I hope that this will make my widget load faster.

It’s usually best to explain what you are trying to do, before getting bogged down in details.

It seems to be “I want to cache some images for display”?

Have a look at threads about weather icon caching.

2 Likes

you mean this ?

then
    val icon = "/etc/openhab2/icons/classic/g24weather.png" 
    val path = "https://darksky.net/images/weather-icons/"
    executeCommandLine(String.format("wget -O %s %s%s.png", icon, path, Local_Weather_Current_Icon_Id.state.toString), 5000)
end

No answer to your question, but a suggestion.
You are trying to speed up the display of weather icons. The number of those icons is limited, why don’t you download (manually) them all to a useful location (conf/html?) and load the a tually is one from there?

not weather images but poster from movies.they change on every movie.

i tried

val String results = executeCommandLine("wget -P /etc/openhab/html/download/", + test1, 5000)

but i think its the wrong command

If you’re using OH3, that’s the wrong syntax for executeCommandLine(), it has changed.

yes, i usw openhab3, have you a example?

Really?

1 Like

Many Thanks Sry I have a weakness in reading and concentration, which is why I have problems understanding things. But I try to understand everything. So thank you very much for the help

i had a question, is it not possible to request in the widget a influx db value?

i tried it :

 text: =items[props.prefix_homemovies + loop.homewidgetmovies.toString() + '_year'].previousState().state.toString

and i get in the widget a error

TypeError: Cannot read property ‘state’ of undefined

the command (.previousState().state.toString) is fine, when i test it in a rule, i get the value

No, previousState() and the like are only available in rules run on the server, in widget expressions you only have access to the current state of items and a few other things listed here: Building Pages - Components & Widgets | openHAB

1 Like

But that’s more of a shame, then you can’t even access values ​​stored in the DB …

It would be nice if there was some improvement. I think it’s very important to reach DB from anywhere.

Unfortunately I can’t do anything with it like that. I wanted to cache the values.

I don’t want my database exposed to everywhere.

You’ll notice that you can use charts in the UI. These are made from database data, but created on the server side,and just images sent to UI.

I think it depends on what you use the DB for. You can always create different databases and then use those without sensitive data.

I just wanted to get all the values ​​of my json calls that I need from the DB in order to accelerate the widget.
And not having to make a json call every time.

Filing things away in a database doesn’t make anything render faster on UI screen.

So far as I can make out, you are displaying some image (cover art), and change the image once an hour. What problem are you having with this?

Yes that’s right.
But that’s only my first Page on my widget.

I make 2-3 json calls over the complete widget.

When I download for example the pictures (Cover Art) lokal on the sd card and request ist with a Image and “url: path to the Covers”, is this faster as request they every time New? Or is there no Differenz?

Speed depends on where you fetch stuff from.
Fetching images from local server is probably quicker than from some remote website.
But to get a copy in your local server, you will need to know in advance what to fetch.

1 Like

I tested it, i downloaded the images and checked whats faster.

The local Version is Not faster than the Directly parse Methode.