Help, I'm ready to give up

So i gave up with the hue emulation and google home. Thought I’d try with the weather. Installed the Yahoo Weather binding. followed the docs on setting it up and it never would pull any weather. So I tried to set up the weather binding. I copied the demo items and set up from the docs page, read several forums and tried several different things but Wunderground weather will not get the weather. It’s extremely frustrating when you can’t get something to work even after following the instructions.

I have the Astro binding set up and it gets the sunset and all that.

Here’s my weather.cfg

weather:apikey.Wunderground=XXXXXXXXX

# location configuration, you can specify multiple locations
weather:location.home.name=Home
weather:location.home.latitude=35.0906884
weather:location.home.longitude=-89.9451742
#weather:location.home.woeid=
weather:location.home.provider=Wunderground
weather:location.home.language=en
weather:location.home.updateInterval=10

weather.items

Number   Temperature_F    "Temperature [%.2f °F]"  			<temperature>			(Weather, gTemperature)			{weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}
Number   Wind_Speed_Mph       "Windspeed [%.2f mph]"		<wind>		(Weather)		{weather="locationId=home, type=wind, property=speed, unit=mph"}

home.sitemap

sitemap home label="Main Menu" { 
	
	Frame label="Who's Home"{
		Text item=PresenceTommy valuecolor=[online=="NULL"="gray", "ON"="green", "OFF"="red"] icon="boy_3" label="Tommy is [MAP(presence.map):%s]"
	}
	Frame label="Weather" {
		Text item=Temperature_F
		Text item=Wind_Speed_Mph
		Text label="Astronomical Data" icon="sun" {
            Text item=Sun_Elevation
            Text item=Sun_Azimuth
            Text item=Sunrise_Time
            Text item=Sunset_Time
            Text item=Moon_Elevation
            Text item=Moon_Azimuth
            Text item=Moon_Phase
        }
	}
	Frame label="House" {
		Text item=gLights {
			Frame label="Hall" { 
				Slider item=hall_light switchSupport
			}
			Frame label="Bedroom" { 
				Slider item=bedroom_lamp switchSupport 
			} 
			Frame label="Dining Room" { 
				Slider item=diningroom_light switchSupport 
			}
			Frame label="Bathroom" { 
				Slider item=bathroom_light switchSupport 
			}
		}
	}

And this is the basic ui screen grab

For the record: my stated issue with mqttitude not working, causing lots of work for others, came down to a mistake I made: a typo.
My learning: go with a comb through the changes before posting!

@tdsheppard77, for the weather binding it is a 1.x binding, and hence the weather docs reference the config for 1.x where everything was stored in a single config file. For openHab2, there are separate config files, so you don’t have to prefix the settings with the binding names.

So in your weather.cfg file use the following (note the weather. prefix is removed):

apikey.Wunderground=XXXXXXXXX

# location configuration, you can specify multiple locations
location.home.name=Home
location.home.latitude=35.0906884
location.home.longitude=-89.9451742
#location.home.woeid=
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=10

I also updated the existing ticket about documenting the 1.x bindings with these details. hopefully as this ticket gets worked on this detail will be addressed.

Feel free to add your input too.

2 Likes

Hi Max,
I’m in a pretty similar boat to you. Seasoned programmer in ASP, PHP and other scripting language. Started programming in 1979 (basic if anybody remembers that). Spent the last 20 years in IT.
I installed OH2 from apt-get on raspberry pi (offline) in about 35 minutes and got everything to show up. I have a working web interface. My Mosquito broker is running on my windows machine (just because it was easy to get it done quickly)

I have however, spent the last 3 days trying to figure out how to add the MQTT binding and my sonoff unit to the interface, but alas, I’m totally lost.

Do you mind sharing how you setup mqtt with openhab2?
I currently have the demo enabled and making the changes to the demo in order to understand how the structure works.

I have my own “floor” in the main layout, clicking on my floor i get to my room and I see the light switch.
inside the demo.items file i have:
Switch Sonoff1 “My_Study” (gTFloor) {mqtt="<[mymosquitto:/test/sonoff:state:default"}

I am not sure that the mqtt broker is setup correctly (where does it get defined?) and i am not sure if the text inside the curly brackets is correct.

Thanks in advance.
Amir

There is an /etc/openhab2/services/mqtt.cfg which is where you define your broker connection including URL and user names.

At a minimum I would expect to see:

mymosquitto.url=tcp://<host>:1883
mymosquitto.user=<user>
mymosquitto.pwd=<password>

where the stuff in < > gets replaced with your information.

See the mosquitto docs for how to set up the broker on Windows.

Additionally please check this and following comments: ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

I believe everything is nicely discussed there. If you go a bit up, you’ll see, that I promissed to write a tutorial soon. I’ve ordered a dozen new Sonoffs.

Good luck!

That did not fix it. Do I have to do some sort of rule to make it fetch the weather or is it supposed to do it automatically?

It will fetch the weather data automatically. What does your log show for the weather binding (weather data is updated each time you save the weather.cfg file). Also, I assume your binding is installed correctly and not showing any errors?

One other thing with Wunderground - I don’t what its like where you are, but Wunderground has recently been flaky for both myself and another user here in London, frequently giving missing api key errors etc. It may be worth trying another provider such as forcastio.

Looks like it’s giving an error. Incomplete location config for location ID.

My understanding after reading the docs…to install the weather binding you just add weather1 to the bindings list in the addons.cfg file. It doesnt’ show up in the paperui under bindings. The docs don’t say anything about adding anything to the .things file like you do with other bindings.

2017-01-18 15:37:42.553 [WARN ] [eather.internal.common.WeatherConfig] - Incomplete location config for locationId 'Home'. Check openhab.cfg.
2017-01-18 15:37:42.560 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=300, bundle=185/mvn:org.openhab.bin$
org.osgi.service.cm.ConfigurationException: weather : Incomplete location config for locationId 'Home'. Check openhab.cfg.
        at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:97)[185:org.openhab.binding.weather:1.9.0.201701160210]
        at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:82)[185:org.openhab.binding.weather:1.9.0.201701160210]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]

The weather binding is a 1.9 version binding. Things only exist for 2.0 version bindings.

The binding is indeed installed if you are seeing that error so that wouldn’t be a problem.

It sure would be nice if it said what piece of information it things is missing…

Are there spaces in the config parameters? Typo in one of the parameters?

Not that I can see. SiteDesigner doesn’t give any errors. I’ve gone through each line and don’t see any extra spaces or misspellings.

I don’t know how carefully Designer checks cfg files. For example, if you have location.home.latitude=12.345678 and location.Home.longitude=-123.456789 Designer would be fine with that but it would be an error (case matters).

# location configuration, you can specify multiple locations
location.home.name=Home
location.home.latitude=35.0906884
location.home.longitude=-89.9451742
#location.home.woeid=
location.home.provider=Wunderground
location.home.language=en
location.home.updateInterval=10
Number   Temperature_F    "Temperature [%.2f °F]"  			<temperature>			(Weather, gTemperature)			{weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}

There is nothing I can see wrong with that config.

Given the myriad of problems you have had (I praise you for your perseverance) I’m wondering if there isn’t something more fundamental going on. Are you running this on a Raspberry Pi? Perhaps the SD card is failing…

I switched to ForecastIo and same thing. Where is the openhab.cfg file stored? maybe there’s some residual info in there that’s causing some issue…

In openHAB 2.0 there is no openhab.cfg. That massive monolithic catch all file used to configure OH 1.x and all its bindings has been split up into separate cfg files for each binding. Assuming you didn’t create one (it would be located either in your root config folder or in the services folder) there isn’t one.

That error message comes from a 1.9 version binding so it assumes it is running on 1.x and therefore assumes there is an openhab.cfg.

1 Like

Ok. nope didn’t create one. so another thing that just doesn’t work. GRRRRRRRRRRR

If you are on a Pi I really do strongly recommend trying another SD card. These inexplicable errors almost always point to a failing card. Symptoms others have seen:

  • saved files reverting to the previous version
  • correct files being parsed incorrectly
  • changed files not being updated
  • unexplained errors in the logs
  • bindings not installing
  • bindings installing then disappearing

When the SD card starts to go your machine enters bizzaro land.

And the card does not have to be old to fail like this.

I pasted your weather.cfg into mine, and it immediately worked.

I would lean towards SD card failing like Rich said…

I found the issue. another forum user had a similar issue and said that he found a file weather.config file in the cache folder. He deleted it and the weather worked. I didn’t find that file in the location he did but I did find it in <user_data>/config/org/openhab/weather.config I deleted the file and now the weather works.

2 Likes