Weather binding again

weather
binding
openweathermap
Tags: #<Tag:0x00007fd31360a6d8> #<Tag:0x00007fd31360a520> #<Tag:0x00007fd31360a340>

(Oleg) #3

Thanks Rich, yes, I have done, deleted and restarted, as my weather.cfg file above

apikey.OpenWeatherMap=22e6c........................
location.home.name=Wellington
location.home.latitude=-XX.XXXXXXXXX
location.home.longitude=YYY.YYYYYYYYYY
location.home.provider=OpenWeatherMap
location.home.language=en
location.home.updateInterval=10
location.home.units=SI

same as weather.config file.

I just don’t have any more ideas what to check.

Is it possible to get OpenHAB2 source code and debug it?

Cheers


(Jürgen Baginski) #4

The error shown corresponds to the second to last line in your "weather.config"file.
I believe however that only the weather.cfg is used.


(Oleg) #5

Thanks Jurgen, what is your suggestion? remove last 2 lines in weather.config file? Cheers


(Jürgen Baginski) #6

As far as I can say (being far away from my system) the config file as opposed to the cfg isn’t needed at all. But that would not explain the error.
Confirm that last two lines are not in your .cfg file as well.


(Oleg) #7

Thanks Jurgen, yes I can confirm that 2 lines are not in my weather.cfg file. The problem(?) with weather.config file that you can’t delete it, what I have done is deleted the weather.config file and rebooted openhab and openhab re-created the file again with the same settings. Cheers PS I will try again but guess it will not help.


(Ray) #8

Would agree with @opus that the last two lines are odd. Just turned on weather a couple of days ago and neither of those two entries exist in my config.

Just to say I started with OpenWeatherMap but couldn’t get it to give me future forecasts. Not sure whether it was something I did or that it’s a free account only gave ‘now’, wouldn’t do ‘forecasts’. I dropped in Wunderground instead and at least now have 3 day forecasts.

Haven’t had any issues with saving the main config file(s) and having to go off and delete buried cached versions. If you ‘tail’ the main log does it show a ‘refresh’ event when you change a file? For ref. I’m running a stable release on Ubuntu.


(Oleg) #9

Ok, thanks Ray, will try to delete that 2 lines and reboot openhab, I’m faraway from my system right now, will do it later and check the log file. I’m running win10.


(Ray) #10

Well in the realms of Windows you’re kind of on your own as outside of my comfort zone. I’d happily put Windows aside forever but that would be unfair as I do use it occasionally when pushed or I want to do some gaming :wink:

No to be fair I’ve used Windows for decades and it has a lot going for it and it’s generally getting better but server side I still find it a little unconvincing. Hands up I’ve no fresh experience but if I only had a Windows PC running as a server at home and wanted to run ‘any’ server related stuff like websites or OpenHAB I’d still VM an instance of Debian or Ubuntu and spare myself the pain of MS hosting :slight_smile:

Can’t prove whether it’s related to your experience of ‘editing config files doesn’t work’ but it’s the world of MS that sounds familiar to me along side the issues of ‘spaces’ in install paths etc. Must admit I’ve not looked at the roots of OpenHAB developers to see if they advise Linux but having worked on enough Java server based systems the primary OS was always *nix based and Windows would work 99% (the Java write once run anywhere principle) of the time but there was always some little thing to be careful about.

In our world of rapidly changing tech it’s also getting more realistic to run a light weight server like RPi on raspbian (or openHABian, not checked it out) etc that can cope with hosting stuff at low power, can’t comment on it’s real world performance. My guess RPi 3 would be bare minimum to get enough processing power to make it responsive but then RPi 2 was slow to me as a power user but once it was set up to do what it needed to do it just does it!


(Rich Koshak) #11

The most common deployment is Linux but Windows is fully supported and many users happily run OH on Windows.

I do not think the problems on this thread are related in any way with the fact that oleg is running Windows.

openHABian is just raspbian with a really nice UI based config script to get you up and running with OH and all related services (e.g. Mosquitto, InfluxDB, samba share of /etc/openhab2 for editing configs on a headless RPi, etc). It isn’t a separate OS or Linux distro.

RPi 2 is plenty powerful enough to run OH for most users. Some users run OH and Kodi on a RPi2 with no complaints. An RPi 1 or RPi 0 will be underpowered. The biggest problem people have is dealing with SD cards wearing out. There are many good approaches but first and foremost is a good backup/restore procedure (openHABian sets up Amanda) and then some people go to great lengths to reduce writes (e.g. move logging to a tmpfs) and/or move the writes off of the SD card. Once you do that the RPi is rock solid as low powered server for something like this. I’d be running my system on one if I hadn’t gone the ESXi VM route.


(Oleg) #12

Hey guys, thanks for helping. Not sure if its windows issue or not, my other binding like “Air Quality”, “Astro”, “Denon/Maratnz”, “WeMo” works fine, no issues, plus I’m running software which existed for Windows only and one of them is BlueIris.
BUT
there are issues I was going to asked when resolve this:
one of them is

[g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.1.115
[.dashboard.internal.DashboardService] - Started dashboard at http://164.XX.XX.XX:8080

I was a bit shock when I saw “Started dashboard at http://164.XX.XX.XX:8080” thought I was hacked cause the ip address definitely outside of my local network. So again question is why and how to fix?

Another issue I was going to asked is Network binding, this is a first binding I was installed and what I saw a bit shock too :smiley: the binding added 255 devices, basically it started from 192.168.1.1 and finished 192.168.1.255 :smiley: but its kind of OK except there no UI to remove them all in one shot, you have to delete them one by one, which is really weird, so this UI suggestion. If I count my devices there are no more 30 devices in total.


(Ray) #13

Good to hear and happy if not Windows specific. It was just the mention of changing files and not seeing those changes reflected that in my experience can be a Windows specific sort of issue but maybe not in this instance.

openHABian will remain on my list to play with time permitting.

I’m with you as my existing RPi 2 is rock solid just running headless Raspbian for my RF GPIO device integration. The reference to ‘responsive’ enough is more in terms of development aka a power user, I’d not want to spend time developing on it but it is more than adequate to run its jobs live, although to note I don’t currently run OpenHAB on mine.

My server is an i3 on SSD and takes 15-20 seconds to (re)start OpenHAB and my RPi 2 couldn’t compete with that as a dev environment. I have an RPi 3 on the bench to play with and seeing as it is supposed to support USB boot the idea of mSATA and such becomes more interesting to avoid the SD card wearing woes and also boost performance (depends on SD type) maybe at the expense of a little power…

Back on topic though @oleg you should only have one weather.cfg file to worry about as @opus said not sure what ‘weather.config’ is. If you’ve taken out the last two lines and restarted does that fix it?


(Ray) #14

You should look at your local network interfaces, run ipconfig from a Windows command line. It’ll detail what you have bound and hence what the likes of OpenHAB thinks it can choose to bind to.

164.xx must be coming somewhere from your Windows setup. Are you running a router direct on your Windows PC or some mobile dongle for internet access, VPN?

Sort out what your Windows machine has interface wise and then I’ve no doubt somewhere in the configuration of the network settings of OpenHAB and it’s services you can restrict what interfaces and ranges you’ll allow it to bind to.


(Oleg) #15

Hey Ray, not sure what you are saying, my network interfaces is really simple for Win10, its pro and its client, I use static ip address 192.168.1.115, static subnet mask/gateway/dns entries, all working fine, no problem at all. There is only one software which use webserver, its BlueIris, its use build-in webserver and use different port, so no conflicts, another soft I use is IIS as reverse proxy server(http://docs.openhab.org/installation/security.html#nginx-reverse-proxy), I managed to do it, but without HTTPS support, HTTP is enough for my case and FTP server(default port), so no conflicts either.

There are no IP addresses conflicts on my local network as I prefer to use static ip addresses for all my devices where possible, if not possible I use my router to “force/reserve” IP address for this particular device.

I might need to check my host file to see for any changes and double check with ipconfig to see if I missed anything since I had setup my win pc.


(Ray) #16

Simple enough for some but ‘really simple’ : static DHCP, BlueIris webserver, IIS reverse proxy with a documentation link to nginx as well :smiley:

Personally I run dynamic IP at the client and use a reasonable DHCP server so I can ‘simulate’ static and allocate a fixed IP for recognised devices. That way I can centrally control all the devices on the network without having to change client configs which can be tricky to impossible with many different OS devices. Also if I decide to change the structure or someone changes a phone I’ve only got to edit one DHCP server.

Yes do look at the ipconfig results. Server software like OH is only going to ask the local system for a list of ‘interfaces’ it can bind to:

[g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.1.115

that message indicates it found more than one and it didn’t pick 192.x. like you might have preferred.

If you need the other interfaces then selective IP binding is your only choice. Maybe read this binding thread. Would recommend reading top to bottom and then picking from the bottom to ensure most recent and relevant answers re OH2.


(Oleg) #17

:smiley:

Very good idea, I might to adopt it for my network :+1:

Yep, will do when back to home. Cheers


(Oleg) #18

Hey Ray, my report:

  1. IP address binding is fixed, the problem was in Oracle VM Virtualbox, which installed virtual local ethernet adapter with 164.xxx address, after uninstalling OH pickup the pc ip address
  2. the weather.config file is locating under /userdata/config/org/openhab with the other config files, you can’t remove it, OH re-creates it every time when you restart OH
  3. To make weather works, you have to delete conf/services/weather.cfg file and make all the settings under weather.config file
  4. the weather works now, but I’m getting the error:
[ERROR] [nal.provider.AbstractWeatherProvider] - OPENWEATHERMAP[home]: Can't retreive weather data: HTTP/1.1 401 Unauthorized
  1. I tested the authorization with http://api.openweathermap.org/data/2.5/forecast?id=2179538&appid=68964xxxxxxxxxxxx works perfect, the only thing I noticed is my latitude and longitude were different from OWM api respond. And OMW api requires city id which can be found under their city.list.json file but not OH, which very strange

(Ray) #19
  1. Makes sense as Virtualbox creates local interfaces to support the different network modes it offers to VMs. You can still install and run Virtual box you’ll just need to change the config of OH so it binds to only the IP you want it to use.

  2. You’ve mentioned you’re running Windows but give paths like they are Linux relative. Is that just you converting it from say C:\OpenHAB2\userdata\config\org…?
    What is your OpenHAB Windows install path?

  3. Don’t know much about the Windows installation but thought I’d give it a quick spin so fired up my Windows 8 VM downloaded the OH.zip chucked it in C:\OpenHAB2 set JAVA_HOME and fired it up. Straight to PaperUI, enabled weather binding, copy and paste my weather.cfg and weather.items across, visit Habpanel to show item ‘Condition’ and it’s says ‘Chance of rain’ - definitely wet outside!
    The reason for doing it was to see where files are on Windows:
    C:\OpenHAB2\conf - looks like the /etc/openhab2 folder I see on Linux : full of sub folders like services, items, rules and transform. As I understand it that is the ‘primary’ place to change and deploy files with settings, so in there I put my:
    C:\OpenHAB2\conf\services\weather.cfg
    C:\OpenHAB2\conf\items\weather.items
    When scanning a few google documents I saw reference to other folders like ‘configuration’ but think that is all OH1 not OH2 so I ignored.
    So other folders where you might find copies of weather.cfg should be of interest only if as Rich suggested you need to check them for a specific bug, after that leave them be.
    Without examining the source code I can’t comment if ‘/conf/services/weather.config’ would happen to be picked up but it should be ‘/conf/services/weather.cfg’ and that works as above. If you’ve been renaming the file I could guess that might also cause confusion with the caches and items etc so I’d be tempted to set the file names correctly shutdown OH clear caches and then restart OH and check the log files for comments during startup and bindings.

  4. When I used OpenWeatherMap I also saw the 401 Error report but couldn’t figure out what was triggering it, didn’t look long. Whilst reviewing event logs though I noticed it still pulled some weather data and I had weather information in OH.

  5. Maybe OWM have tweaked their API since the weather binding release re city? I had no loyalty to OWM it was just the first service provider I chose to try so must admit rather than battle it, as I said I wasn’t sure it supported forward forecasts, I switched to Wunderground. I was just after some weather data so I could populate some pretty Habpanel widgets, will likely revisit which provider provides the better data for me some other time.


(Rich Koshak) #20

This isn’t right. While I’m sure it fixed the problem, you should be editing the .cfg file in your conf folder, not the config file in userdata directly. That file is intended to be created and managed by OH itself.

That is correct.

It wouldn’t be. Only files that end in .cfg get picked up from conf/services.

I’ll close with, unless you are tied to OWM for some reason, there is a 2.x Wunderground binding and I show how to pull Wunderground data directly using the HTTP binding here:


(Oleg) #21

Can’t remember now, but I think I provided my ip address during installation, but nah, all sorted out. :slight_smile:

yeh, :wink: just converting, in my experience some people are saying me straight away change your “slashes” your pathway is wrong :smiley: . its same “C:\OpenHAB2”

Thats my case, it works now.


(Oleg) #22

I’m not saying its wrong, this is how works for me. I did try many times and the only this scenario works for me :slight_smile:

me too, it will be great to have the source code.

Looks like its possible to adopt to OWM, just change api address and some properties. Thanks for that, will have a look.
:+1: