I have used openhab2 configs (sitemap + items) from demo house and have customised it for my needs.
Got it to work already with couple of switches and temperature probes so all good.
On demo house there is Weather section showing Outside temperature such as Todays Maximum , Minimum , Humidity, Humidex and chart period.
Im just wonder how to get it to work. Im assuming this is getting data from external source.
Start by looking at the Items that are being displayed. What channels are they linked to or what bindings are they bound to? This will tell you where the information is coming from. From there look to see what that binding is configured with and make modifications as necessary.
Not the Yahoo Weather binding but the HTTP binding. Those Items are configured to pull the data straight from Yahoo! using HTTP.
However, the Yahoo! Weather binding might be easier to use. Follow the instructions on the Yahoo! Weather binding readme to set up the binding and link the Items to the channels. You might also want to go through the Beginner’s Tutorial.
That is not how those particular Items are configured to work with the HTTP binding. As the README explains, there is a caching configuration and a direct inbound configuration. Those Items you pasted in above use the direct method meaning that what you have done will not accomplish anything.
What happens when you put that URL into the browser?
Do you see any errors in the log?
Finally, I recommend once again “However, the Yahoo! Weather binding might be easier to use. Follow the instructions on the Yahoo! Weather binding readme to set up the binding and link the Items to the channels.”
I was only able to link temperature (to outside temperature) and humidity (to outside humidity). I don’t have pressure item at the moment.
In terms of Todays Maximum and Todays Minimum currently both items are reading the same value - is this correct ? For the test purpose I have changed location so that’s why you see temperature increasing from 9 to 18C.
If all three are the same then the last one graphed, in this case the Minimum, will be the only one that appears. The other two were overwritten by the Minimum.
I have one question. Currently outside temperature is showing 10 C - you can see it on the graph below (RED line). However Todays Maximum is showing 9C - should I expect this to be at 10 C ?
I would expect it to be so, but like I said, this is handled by a Rule. You will have to make sure the Rule is running correctly and how it is running. It might be that it runs periodically rather than based on changes to the outside temp or there is a bug or something. Look at openhab.log for errors.
I used the following rules straight from demo setup.
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
var Number counter = 1
var Timer timer = null
rule "Initialize Location"
when
System started
then
DemoLocation.postUpdate(new PointType ("52.5200066,13.4049540"))
end
rule "Update max and min temperatures"
when
Item Weather_Temperature changed or
Time cron "0 0 0 * * ?" or
System started
then
postUpdate(Weather_Temp_Max, Weather_Temperature.maximumSince(now.toDateMidnight).state)
postUpdate(Weather_Temp_Min, Weather_Temperature.minimumSince(now.toDateMidnight).state)
logInfo("Weather", "Temperature evolved of " + Weather_Temperature.deltaSince(now.minusMinutes(2)) + " degrees.")
end
/** shows how to use sensor values from the past */
rule "Persistence Demo"
when
Time cron "0 * * * * ?"
then
if(Weather_Temperature.changedSince(now.minusMinutes(1))) {
logInfo("PersistenceDemo", "2 minutes ago, the temperature was " + Weather_Temperature.historicState(now.minusMinutes(2)) + " degrees.")
}
end
// Creates an item that stores the last update time of this item
rule "Records last weather update time"
when
Item Weather_Temperature received update
then
postUpdate(Weather_LastUpdate, new DateTimeType())
end
// This rule will be used to test Scale transformation service
rule "Compute humidex"
when
Item Weather_Temperature changed or
Item Weather_Humidity changed
then
var Number T = Weather_Temperature.state as DecimalType
var Number H = Weather_Humidity.state as DecimalType
var Number x = 7.5 * T/(237.7 + T)
var Number e = 6.112 * Math::pow(10, x.doubleValue) * H/100
var Number humidex = T + (new Double(5) / new Double(9)) * (e - 10)
postUpdate(Weather_Humidex, humidex)
end
At the moment is only showing me outside temperature which is 10 C . Today Maximum and Minimum has the same value so something isn`t correct here.
The spike on the graph is when I changed location so ignore it please.
You are correct I`m running OH 2 and have copied rules for weather from OH 1.8.3 Demo. Is there demo house available for OH 2 ?
Today the temperature is sitting at the same level (10 C) that’s for outside , todays minimum and maximum. Are the rules above correct?
I’m not sure how to install the OH 2 demo but I think the easiest at this point will be to edit services/addons.cfg and change the package to “demo”. This will install the needed add-ons and download the necessary config files.
Just wonder if anyone is in the possession of rules for OH2 demo ? I got most part of my system ready to go so dont want to loose anything. l still having issue with Todays Min and Max temperatures - still only showing Outside Temperature.
Somewhere of the forum I have seen demo rules which perhaps were OH2, and there are seems to be identical what I`m using right now.