great widget, very usefull. I will try it asap
The widget runs smoothly on one of my Ubuntu machines. Thank you very much.
On the other “identical” Ubuntu machine I receive the following error:
–> No results returned from InfluxDB History:
2017-10-29 15:25:00.483 [INFO ] [lipse.smarthome.model.script.Shaddow] - Updating Shaddow SVG 2017-10-29 15:25:00.483 [INFO ] [lipse.smarthome.model.script.Shaddow] - Successfully got state from OpenHab: Sun_Azimuth Successfully got state from OpenHab: Sun_Elevation Successfully got state from OpenHab: Sunrise_Azimuth Successfully got state from OpenHab: Sunset_Azimuth Error getting data from InfluxDB: SELECT FIRST(*) FROM "Sun_Azimuth" where time>'2017-10-27T23:00:00Z' (HTTP Response 401) No results returned from InfluxDB History:
This behaviour is strange beacuse data is definitely in the database. If I query influx directly I’ll receive data for this select statement:
Connected to http://localhost:8086 version 1.3.7 InfluxDB shell version: 1.3.7 > USE openhab_db Using database openhab_db > SELECT FIRST(*) FROM "Sun_Azimuth" where time>'2017-10-28T22:00:00Z' name: Sun_Azimuth time first_value ---- ----------- 1509228000015000000 327.73
Do you have any clue why I receive this error message?
This http code stands for “Unauthorized”, thats why you didnt receive any results.
Hmm, in this case the Python script is not authorized to access Influx DB? How can this be solved?
I am not using this stuff here, but a first look into the script: looks like it is not using authentication.
Therefore it seems like your influxdb is configured to not allow an unsecure communication. At least that is my conception.
Thanks for all the help!
I initially setup Influx based on the below manual:
There it’s recommended to set auth-enabled = true. The script started to work immediately after setting the parameter to false.
This is really cool, I like it a lot. I want to change it to also add the position of the moon and the direction where the wind is coming from, the moon also indicating the current phase and the wind indicating the strength in beaufour. I was able to “include” svg files for sun, moon and wind residing in the same html directory which already gives the following:
(this is a testing version thus some persisted data is missing)
However I’d prefer to “include” icons from the icons directory instead, what path do i need to use for these ? Furthermore I’d like to use a different iconset (https://github.com/erikflowers/weather-icons) which is not colored. When I use these the icons show up as “black on black underground”, thus invisible. How can I change the color of these “included svg files” ?
the corresponding lines of the created shaddow.svg look like this:
<image x="0.852620357054" y="68.4735781393" width="10" height="10" xlink:href="wind.svg" /> <image x="59.9686933371" y="92.7067942727" width="10" height="10" xlink:href="moon.svg" /> <image x="67.2083062338" y="89.7972223941" width="10" height="10" xlink:href="sun.svg" />
I will upload the modified script (using the REST interface, not InfluxDB) once I have this working.
awesome. Looks great. Can you share the widget for the other views as well. Looks like you created some for the energy costs, energy consumption views as well.
Hmmmm, i think thats not the expecting result
Problem seems to be solved, patience was the key
But the sun position is not correct, i think its because of a wrong shape of the house. How do you create it? The basic form is correct, but it seems to be inverted. How do i align the shape correctly?
Edit: Problem solved…
@pmpkk I have to give you a really big “Thank You” for your great theme and this script
Would you be so kind to tell my how and where in the shaddow.py you inserted the icons?
Needs to be
I do not use hab panel yet but I want to add exactly this once I have my habpanel set up.
But in additon to that…what I currently try to do is to automate my rollershutters and I think it could be possible to realize with parts of your script.
What I wan to do is the following:
I want to automatically close the rollershutters if the sun is shining through the window.
So my question is how can I use this script to achive this? Could you lead me the right way ? I am quite new to python code and do not understand much of it.
All you need for that task is the azimuth angle from the astro binding:
Eventuell hilft das:
var Number diffToFasade = 30 // Quasi Abweichung von Nord deiner Hausausrichtung rule "Update Fassade" when Item Sun_Height_ext changed or Item Sun_Azimut_ext changed then logDebug("Sun","Update Fassade") var height = Sun_Height_ext.state var azimut = Sun_Azimut_ext.state var eastFasadeIn = ( 90 - 90 + diffToFasade ) //For example: -26.09 or 333,91 - because 0 and 360 is north var eastFasadeOut = ( 90 + 90 + diffToFasade ) //153,91 var southFasadeIn = ( 180 - 90 + diffToFasade ) //63,91 var southFasadeOut = ( 180 + 90 + diffToFasade ) //243,91 var westFasadeIn = ( 270 - 90 + diffToFasade ) //153,91 var westFasadeOut = ( 270 + 90 + diffToFasade ) //333,9 var northFasadeIn = ( 360 - 90 + diffToFasade ) //243,91 var northFasadeOut = ( 360 + 90 + diffToFasade ) //386,09 or 63,91 - because 360 and 0 is north postUpdate(Sun_Fasade_Illum_East, if (azimut > (eastFasadeIn.remainder(360)) && azimut < (eastFasadeOut.remainder(360)) && height > 18) ON else OFF) postUpdate(Sun_Fasade_Illum_South, if (azimut > (southFasadeIn.remainder(360)) && azimut < (southFasadeOut.remainder(360)) && height > 18) ON else OFF) postUpdate(Sun_Fasade_Illum_West, if (azimut > (westFasadeIn.remainder(360)) && azimut < (westFasadeOut.remainder(360)) && height > 18) ON else OFF) postUpdate(Sun_Fasade_Illum_North, if (azimut > (northFasadeIn.remainder(360)) && azimut < (northFasadeOut.remainder(360)) && height > 18) ON else OFF) end
Auf die Änderungen der Sun_Fassade_Illum_* wird dann jeweils in einer Regel der/die Rolläden gefahren.
Same here …
How did you solve it?
I “inverted” my y-coordinate
100 - your “y” and then insert this into the shaddow.py
As others have said in order to manage your shutters you really just need to check the sun azimuth and elevation. I do this for my shutters and it works perfectly all year round!
Thx, that’s it!