[SOLVED] What is the status on the Weather binding?

I haven’t started yet; done too much migrating the last few days :slight_smile:

But, I have done the ot-recorder today, and used the /etc/openhab2/html directory to place my location web file into it and it worked by calling it with http://192.168.1.5:8080/static/geolocMap.html in the sitemap, and this works.
Hence, I will place the weather html file there too.

Happy to report back when I finished it off (most likely Friday).

Wonderful, thank you, looking forward to your findings.

@trhessel

Yes, but I’m on Windows.

But at following link you can read all I wrote above:

In this migration documentation you can read the following:

 Copy any custom webviews from webapps to $OPENHAB_CONF/html
Static webview files are now located in  `$OPENHAB_CONF/html`  instead of  `/usr/share/openhab/webapps`

The dynamic data is located under Windows in the following folder “C:\Openhab2\userdata\webapps”

I don’t know where this now is located under linux. I thought it must be:

 /var/lib/openhab2/webapps/

Maybe under linux you have to copy the dynamic data also to $OPENHAB_CONF/html ??

Thank you, let me read over that and give it a try.

Hello community.

Where is the dynamic html data located under linux?

In Windows it is "C:\Openhab2\userdata\webapps\

In linux it must be /var/lib/openhab2/webapps/ ,isn’t it??

@Max_G @trhessel

Here is the solution:

First edit the example.html (change to the correct paths inside, see above) and then copy it into both folders:

/etc/openhab2/html/weather-data/layouts/

and

/var/lib/openhab2/webapps/weather-data/layouts/ 

Or make a symbolic link (symlink) to example.html (to /etc/openhab2/html/weather-data/layouts/example.html)

IMPORTANT: the paths inside example.html always have to begin with: static/weather-data/…

The string ‘static’ at the beginning of each path causes openhab2 to search in the folder /etc/openhab2/html/

1 Like

While I realise that the thread sort of went off the rails :slight_smile:

I can now say, after getting my head around this for 5 minutes, it was straight forward. … sort of.

On a pristine OHv2 install via apt-get, there will be two folders present:

/etc/openhab2/html/
/var/lib/openhab2/

The ‘old’ Yahoo folder called weather-data needs to be copied into
/etc/openhab2/html/ resulting in

/etc/openhab2/html/weather-data/

I created the required webapps in /var/lib/openhab2/, like so:

sudo mkdir /var/lib/openhab2/webapps

resulting in:

/var/lib/openhab2/webapps/

Instead of copying files to the second location, I created a symbolic link, like so:

sudo ln -s /etc/openhab2/html/weather-data /var/lib/openhab2/webapps/weather-data

Then changed the ownership to OH, like so:

sudo chown openhab:openhab /var/lib/openhab2/webapps

In the widget file, in various posts here referred to as example.html, add the string static/ before all references to weather-data/ as described here.

In case you had a webview in your sitemap, it will just work.

Good luck @trhessel :slight_smile:

1 Like

Guys for some reason I am unable to update my weather widget after Yahoo stopped working.

apikey.ForecastIo=xxxxxxxxx (I’ve got it from the the Dark Sky)
location.home.name=home
location.home.latitude=41.874851
location.home.longitude=-88.019341
location.home.language=en
location.home.updateInterval=30
location.home.provider=ForecastIo

When I am trying to use any widget, sitemap etc. I am not able to get anything from the provider.
I am using binding-weather1 - 1.13.0

What the heck am I am doing wrong? Any help would be appreciated.

Your items were updated normally, but widget not?

@Celaeno1
Items is also not displaying the value that is the problem

Here is my Items file config. For now, I have just put two items to test.
Number Temperature “Temperature [%.2f °C]” {weather=“locationId=home, type=temperature, property=current”}
Number Humidity “Humidity [%d %%]” {weather=“locationId=home, type=atmosphere, property=humidity”}

And here is how the Sitemap looks. It is blank and I see the same in the widget. So something silly is what I am missing and I need some help.

@alijaf

What happens when you just put your data directly into this link and open it with your browser?

https://api.darksky.net/forecast/[key]/[latitude],[longitude]

Do you get correct data?

If not, then maybe your coordinates or your key is wrong.

Try to shorten latitude to 41.8749 and longitude to -88.0193 in above link.

See also this:
https://darksky.net/dev/docs

@Celaeno1 I have tried with the shorter latitude and longitude and with the one that I was using previously and both URL’s are returning the weather details but still for some reason the item and widget isn’t showing anything.

Is something in error log?

I’ve never used logs and I am a noob so don’t know how to check logs. If you can guide me then I can check the logs.

Additionally, I have restarted, uninstall and then installed the binding etc. Done my level best. One thing which I am not certain is that if I have to do any updates on the things file. When I removed the Yahoo weather binding I think I removed some entry from it. Anyways, is there anything required in the Things file.

Ok. Linux or Windows? Openhab1 or Openhab2?

Openhab2 on PI

You had a entry in your .things file for Yahoo?
This only could be done for the “yahooweather” binding. For “weather1” you don’t need a entry in .things file.
Did you ever use the karaf console?

I haven’t used the Karaf console.

see here: https://www.openhab.org/docs/administration/console.html

Depending on how you started OH, “interactive mode” (using start.sh) or “as a service”, then you have one of the following options:

interactive mode: openHAB naturally transitions directly to the console prompt.
as a service: running $OPENHAB_RUNTIME/bin/client
Linux package based installations can also use the command: openhab-cli console

The default username/password is openhab:habopen , so enter habopen at the password prompt.

After you’ve started above console, type in: log:tail

Watch all errors regarding “weather” binding. If there is none you also can use DEBUG mode.

To quit above log:tail you have to hit CTRL+c [ENTER]

Switching to DEBUG mode: log:set DEBUG org.openhab.binding.weather

Switching back to DEFAULT: log:set DEFAULT org.openhab.binding.weather

Note that the log levels set using the log:set commands are persistent and will be applied upon restart.

@Celaeno1 I ran all logs and I couldn’t find anything by the keyword “weather” then I ran log:set DEBUG org.openhab.binding.weather and nothing and then I ran log:set DEFAULT org.openhab.binding.weather and still nothing. I have no idea what is going on.