I have created SVG icons for all the moon phases which must be stored under the following directory structure openhab/conf/icons/classic … you might need to create the classic directory. Then just simply add the parameter icon="moonphases" to the line in your sitemap for the Moon_Phase item
Text item=Moon_Phase icon="moonphases"
Find below all phases as PNGs (as SVGs are not shown through the upload mechanism). Either convert them yourself or send me a private message and I can provide the SVG collection in a zip file by email:
The files must be named for the appropriate order like:
moonphase-new.svg
moonphase-waxing_crescent.svg
moonphase-first_quarter.svg
moonphase-waxing_gibbous.svg
moonphase-full.svg
moonphase-waning_gibbous.svg
moonphase-third_quarter.svg
moonphase-waning_crescent.svg
!!! The uploaded pictures below are not in order !!! !!! You have to sort out the right naming yourself when downloading these pngs and converting yourself!!!
!!! I recently uploaded all the PNGs again as there was one JPG accidentally hidden !!! !!! Now all the pics are PNGs - I can provide the SVGs if you send me a message !!!
!!! I recently uploaded all the PNGs again as there was one JPG accidentally hidden !!! !!! Now all the pics are PNGs - I can provide the SVGs if you send me a message !!!
I found that the SVG files are only working in the web view with the Basic UI and not in the mobile app
Most likely to the size as the are 256x256 pixel and not as required 32x32 pixels. The pictures look horrible in the lower resolution …
If anyone has an idea how to make these pictures (PNG and/or SVG) work in the mobile app then feel free to advise
Did you test your svg pictures with the beta version of the android app?
There is a fix for the svg handling, which is already in beta but not yet in the stable app on google play.
I looked closer to the app and I found the documentation of the bug and that it is fixed in the beta. Hence I installed the beta (v2.3.7) from the Google Play Store. The scaling issue was fixed in the 2.2.5 … But my problem seems not to be related to this bug.
I solved it with an app setting because my finding works with both app versions!
Here is my solution for displaying SVG icons in the mobile app:
This works in both avaialable app verions from the Google play store:
Stable version 2.2.0 from May 2018
Beta version 2.3.7 from September 2018
In the settings there is a option to set the Symbol-Format which is either
Pixelgrafik (in English probably: Pixel Graphics)
or
Vektorgrafik (in English probably: Vector Graphics)
The Default is Pixelgrafik
With this setting the SVG icons are not shown. But setting the format to Vektorgrafik the app will display the icons.
I believe that this might probably be the most likely reason why customized/indvidual SVG icons are not shown in the app because I did not find this explanation in any of the topics which are dealing with that issue. As this works with the 2.2.0 I guess a lot of problems come from this easy settings change and probably not from the bug.
Anyway, I think it is worth a try for everyone who experiences the same issue
Question: Is it possible to get the sunrise and sunset information for the next day?
At least the sunrise information would be helpful because it probably makes sense to have the information about sunrise before the sun rises
Is there a way to get this information additionally to the values for the current day?
That is cool!
I helped myself with a python script leveraging the Astral library of Python and it inserts the data via REST-API to the appropriate items … still need to create the tutorial for this.
But this is also a charming way which needs no external python scripts. Thanks, I will test that out when I find the time!
I did not get the moon symbols from the MAP file displayed in Basic UI as well even though the zodiac symbol works ??? I thought that the moon symbol wouldn’t work in the Basic UI at all???!!! I would be wondering if anybody got it working in the Basic UI. I only got them working in the Android mobile app!
That is why I created a set of dynamic icons to have the moon icon changing in the beginning of the line. But these icons are not in the documentation or default in openhab icon sets. I can send them to you if you are interested. You would need to copy them to "icons/classic and check that the item name is the same as the icon name.
i would like to use your very cool moonphase-icons.
Unfortunately one icon (waxing_gibbous) is an jpeg and no png, therefore its not transparent.
Could you send me the svg or png?
rule “Astro Startup Handler”
when
System started
then
createTimer(now.plusSeconds(60)) [ |
if (now.isAfter((Sunset_Time.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli) || now.isBefore((Sunrise_Time.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)) {
postUpdate(Night_State, ON)
} else {
postUpdate(Night_State, OFF)
}
]
end
rule “Update Astro Night State”
when
Item Sun_Elevation changed
then
if(Sun_Elevation.state > 0){
if(Night_State.state != OFF) {
postUpdate(Night_State, OFF)
}
} else {
if(Night_State.state != ON) {
postUpdate(Night_State, ON)
}
}
end
I have one problem though that I can’t get my head around. I understand that the icons might not show up in all user interfaces. When I’m using Basic UI on an iOS-device and a Mac/Safari-browser, all unicode icons are shown as diamonds with question marks. What I don’t understand though is that Swedish characters are presented as they should when they are part of labels defined in *.items or *.sitemap, but not when defined in the .map-file. For example, “Månfas” (Moon phase) is correct while “Fullmåne” (Full moon) will replace the “å” with two diamond/question marks. Any thoughts?
(And yes, all my configuration files are saved in UTF-8 edited in VS Code on Mac-OS…)