I don’t mind sharing. See: https://drive.google.com/folderview?id=0B2wRI0BstQFtU2t4VzEyWkhHT2M&usp=sharing
One thing though, and I can’t make this clear enough, I’m not very good at this, and almost all of this is a hack job, so, there are a issues that can/will happen. It may look nice, but it can get ugly too. But this is alot more than the weather widget, as i made a good amount of additions to the lib/jobs files as well. Also, I’ve made so many tweaks/changes along the way that it may be hard to follow (it is for me sometimes).
The clear throughout the day is from forecast.io, but I also use Yahoo for current weather. On my to do list, is actually to go through and debug the best weather data from all the available ones.
String Weather_Condition_Long “Condition [%s]” (Weather) {weather=“locationId=home, forecast=1, type=condition, property=text”}
For the Lights Low / Lights High, I was getting tired of trying to debug the coffee scripts that I created a new widget in my called Ohsendcommand. It doesn’t query state, or anything else, it just sends one command and I used the data-icon to state the command I wanted to send. This way, I could do more complex scripting in openHab via the rules. Now that I think about this, you could actually use this to achieve your task vis-a-vis previous light setting. And store the previous value in a dummy item that’s only updated by your rule, when the lights turn off.
<li data-row="11" data-col="7" data-sizex="1" data-sizey="1">
<div data-id="Light_office_Scenes" data-view="Ohsendcommand" data-title="Lights Low" data-device="Light_office_Scenes" data-icon="1"></div>
</li>
And I have a rule in setup in Openhab for that item, like so:
var String lightsRelax=“71.91208,84.35754189944134,70.19607843137254”
var String lightsFullBright=“76.92307692307692,15.294117647058822,100”
rule “office_Scenes”
when
Item Light_office_Scenes received command
then
var String office_floorLamp
switch receivedCommand {
case 0: {office_floorLamp=“OFF”}
case 1: {office_floorLamp=lightsRelax }
case 2: {office_floorLamp=lightsFullBright }
}
Light_office_hueLamp_DimmerColor.sendCommand(office_floorLamp)
end
Light_office_hueLamp_DimmerColor is a Color item
I may have missed, one or two or ten things in here, so just feel free to ask. I might not have nor remember the answer tho.