Astro Items+Sitemap+Map+♈ Binding Example

Tags: #<Tag:0x00007f5ca0c21290> #<Tag:0x00007f5ca0c210b0>

You can use Astro Actions for calculating sunrise/sunset on given date

1 Like

That is cool!

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.

Here is my polish translation (PL)-pl.
Tłumaczenie na język polski.

astro.map

//
ARIES=♈ Baran (21 marca - 20 kwietnia)
TAURUS=♉ Byk (21 kwietnia - 21 maja)
GEMINI=♊ Bliźnięta (22 maja - 21 czerwca)
CANCER=♋ Rak (22 czerwca - 22 lipca)
LEO=♌ Lew (23 lipca - 22 sierpnia)
VIRGO=♍ Panna (23 sierpnia - 22 września)
LIBRA=♎ Waga (23 września - 22 października)
SCORPIO=♏ Skorpion (23 października - 22 listopada)
SAGITTARIUS=♐ Strzelec (23 listopada - 20 grudnia)
CAPRICORN=♑ Koziorożec (21 grudnia - 19 stycznia)
AQUARIUS=♒ Wodnik (20 stycznia - 18 lutego)
PISCES=♓ Ryby (19 lutego - 20 marca)

//
SPRING=Wiosna
SUMMER=Lato
AUTUMN=Jesień
WINTER=Zima

//
SUN_RISE=Wschód słońca
ASTRO_DAWN=Astronomiczny wschód słońca
NAUTIC_DAWN=Morski wschód słońca
CIVIL_DAWN=Cywilny wschód słońca
CIVIL_DUSK=cywilny zachód słońca
NAUTIC_DUSK=Morski zachód słońca
ASTRO_DUSK=Astronomiczny zachód słońca
SUN_SET=Zachód słońca
DAYLIGHT=Dzień
NOON=Południe
NIGHT=Noc

//
MORNING=Poranek
DAY=Dzień
AFTERNOON=Popołudnie
EVENING=Wieczór
NIGHT=Noc
BED=Czas na sen

//
NEW=🌑 Nów
WAXING_CRESCENT=🌑→🌓 Sierp przybywający
FIRST_QUARTER=🌓 Pierwsza kwadra
WAXING_GIBBOUS=🌓→🌕 Księżyc przed pełnią
FULL=🌕 Pełnia
WANING_GIBBOUS=🌕→🌗 Ubywający księżyc
THIRD_QUARTER=🌗 Ostatnie kwadra
WANING_CRESCENT=🌗→🌑 Sierp ubywający

//
NULL=Błąd ⁉
-=Błąd ⁉
2 Likes

@Casa75
What UI are you looking in. when I do something like

WANING_CRESCENT=\ud83c\udf17→\ud83c\udf11 afnemende halve maan

it works on the mobile app but not in any browser (safari, chrome or Firefox).

Is this what you are doing ? or do you have other escape or special characters?

Can someone explain again how to display the symbols in the map file in a normal browser ?

Hello Justus,

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?

Thank you in advance. =)

Posting here as well as translated for me

astro.map in Latvian

//
ARIES=♈ Auns
TAURUS=♉ Vērsis
GEMINI=♊ Dvīņi
CANCER=♋ Vēzis
LEO=♌ Lauva
VIRGO=♍ Jaunava
LIBRA=♎ Svari
SCORPIO=♏ Skorpions
SAGITTARIUS=♐ Strēlnieks
CAPRICORN=♑ Mežāzis
AQUARIUS=♒ Ūdensvīrs
PISCES=♓ Zivs

//
SPRING=Pavasaris
SUMMER=Vasara
AUTUMN=Rudens
WINTER=Ziema

//
SUN_RISE=Saullēkts
ASTRO_DAWN=Astronomiskā rītausma
NAUTIC_DAWN=Jūras navigācijas rītausma
CIVIL_DAWN=Civilā rītausma
CIVIL_DUSK=Civilā krēsla
NAUTIC_DUSK=Jūras navigācijas krēsla
ASTRO_DUSK=Astronomiskā krēsla
SUN_SET=Saulriets
DAYLIGHT=Diena
NOON=Pēcpusdiena
NIGHT=Nakts

//  
NEW=🌑 Jauns mēness
WAXING_CRESCENT=🌑→🌓 Augošs mēness
FIRST_QUARTER=🌓 Pirmais ceturksnis
WAXING_GIBBOUS=🌓→🌕 Augošs mēness
FULL=🌕 Pilnmēness
WANING_GIBBOUS=🌕→🌗 Dilstošs mēness
THIRD_QUARTER=🌗 Pēdējais ceturksnis
WANING_CRESCENT=🌗→🌑 Dilstošs mēness

//
NULL=nezināms ⁉
-=nezināms ⁉

@ThomDietrich
Thank you very much, well explained and it works fine to me! MERCI
vinc

I use the astro startup rules but it triggers a deprecated warning on “.calendar.timeInMillis”

Its in the startup rule Astro INIT. The rule works but the deprecated annoys me. Does anyone know how to fix this?

Here are my Astro Rules. Does this help?

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

Hi,

For French, here is the astro.map:

//
ARIES = ♈ Bélier
TAURUS = ♉ Taureau
GEMINI = ♊ Gemeau
CANCER = ♋ Cancer
LEO = ♌ Lion
VIRGO = ♍ Vierge
LIBRA = ♎ Balance
SCORPIO = ♏ Scorpion
SAGITTARIUS = ♐ Sagittaire
CAPRICORN = ♑ Capricorne
AQUARIUS = ♒ Verseau
PISCES = ♓ poisson

//
NEW=Nouvelle Lune
WAXING_CRESCENT=Croissant de Lune croissante
FIRST_QUARTER=Premier quart
WAXING_GIBBOUS=Lune gibbeuse croissante
FULL=Pleine Lune
WANING_GIBBOUS=Lune gibbeuse décroissante
THIRD_QUARTER=Dernier quart
WANING_CRESCENT=Croissant de Lune décroissante

//
SPRING = Printemps
SUMMER = Ete
AUTUMN = Automne
WINTER = Hiver

And moonphase icons

Regards,


Vincent Ferreux
Alter&Coop

Hi
Thanks for tutorial.
Here is Russian astro.map translation1

//
ARIES=♈ Овен
TAURUS=♉ Телец
GEMINI=♊ Близнесы
CANCER=♋ Рак
LEO=♌ Лев
VIRGO=♍ Дева
LIBRA=♎ Весы
SCORPIO=♏ Скорпион
SAGITTARIUS=♐ Стрелец
CAPRICORN=♑ Козерог
AQUARIUS=♒ Водолей
PISCES=♓ Рыбы

//
SPRING=Весна
SUMMER=Лето
AUTUMN=Осень
WINTER=Зима

//
SUN_RISE=Рассвет
ASTRO_DAWN=Закат
NAUTIC_DAWN=Морской закат
CIVIL_DAWN=Гражданский закат
CIVIL_DUSK=Гражданский рассвет
NAUTIC_DUSK=Морской рассвет
ASTRO_DUSK=Рассвет
SUN_SET=Зенит
DAYLIGHT=День
NOON=Полдень
NIGHT=Ночь

//
NEW=Новолуние
WAXING_CRESCENT=Растущий полумесяц
FIRST_QUARTER=Первая четверть
WAXING_GIBBOUS=Растущая выпуклая луна
FULL=Полнолуние
WANING_GIBBOUS=Убывающая выпуклая луна
THIRD_QUARTER=Последняя четверть
WANING_CRESCENT=Убывающий полумесяц

Thank you for this - really nice!

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…)

Hello,

can you send me these moonphase-icons in svg format too :slight_smile:

Thanks in advance

where is the english version of astro.map file with emoticons ?

@ers here you go, English version with icons

//
ARIES=♈ Aries
TAURUS=♉ Taurus
GEMINI=♊ Gemini
CANCER=♋ Cancer
LEO=♌ Leo
VIRGO=♍ Virgo
LIBRA=♎ Libra
SCORPIO=♏ Scorpio
SAGITTARIUS=♐ Sagittarius
CAPRICORN=♑ Capricorn
AQUARIUS=♒ Aquarius
PISCES=♓ Pisces

//
SPRING=Spring
SUMMER=Summer
AUTUMN=Autumn
WINTER=Winter

//
SUN_RISE=Sunrise
ASTRO_DAWN=Astronomical Dawn
NAUTIC_DAWN=Nautical Dawn
CIVIL_DAWN=Civil Dawn
CIVIL_DUSK=Civil Dusk
NAUTIC_DUSK=Nautical Dusk
ASTRO_DUSK=Astronomical Dusk
SUN_SET=Sunset
DAYLIGHT=Day Time
NOON=Noon
NIGHT=Night Time

//
NEW=🌑 New Moon
WAXING_CRESCENT=🌑→🌓 Waxing Crescent
FIRST_QUARTER=🌓 First Quarter
WAXING_GIBBOUS=🌓→🌕 Waxing Gibbous
FULL=🌕 Full Moon
WANING_GIBBOUS=🌕→🌗 Waning Gibbous
THIRD_QUARTER=🌗 Third Quarter
WANING_CRESCENT=🌗→🌑 Waning Crescent

Also translation to Slovenian

//
ARIES=♈ Oven
TAURUS=♉ Bik
GEMINI=♊ Dvojčka
CANCER=♋ Rak
LEO=♌ Lev
VIRGO=♍ Devica
LIBRA=♎ Tehtnica
SCORPIO=♏ Škorpijon
SAGITTARIUS=♐ Strelec
CAPRICORN=♑ Kozorog
AQUARIUS=♒ Vodnar
PISCES=♓ Riba

//
SPRING=Pomlad
SUMMER=Poletje
AUTUMN=Jesen
WINTER=Zima

//
SUN_RISE=Sončni Vzhod
ASTRO_DAWN=Astronomska Zora
NAUTIC_DAWN=Navtična Zora
CIVIL_DAWN=Civilna Zora
CIVIL_DUSK=Civilni Mrak
NAUTIC_DUSK=Navtični Mrak
ASTRO_DUSK=Astronomski Mrak
SUN_SET=Sončni Zahod
DAYLIGHT=Dan
NOON=Opoldan
NIGHT=Noč

//
NEW=🌑 Mlaj
WAXING_CRESCENT=🌑→🌓 Prehod iz Mlaja
FIRST_QUARTER=🌓 Prvi Krajec
WAXING_GIBBOUS=🌓→🌕 Prehod v Ščip
FULL=🌕 Ščip
WANING_GIBBOUS=🌕→🌗 Prehod iz Ščipa
THIRD_QUARTER=🌗 Drugi Krajec
WANING_CRESCENT=🌗→🌑 Prehod v Mlaj

1 Like

Hello,

i have the same, but on the android app, i see the icons

dont forget to cope one image and call it moonphase.svg, without this, it will not work
i had this problem, after this, it works with multible pictures

@ThomDietrich:
Thank you for your great work and the detailed description to use the astro binding!!!
I use your example to schow the astro datas on my dashboard. It works.

I noted that I have for example in the sunrise and sunset a difference from some minutes (approximately 5-6min) compared for example with this or this site and the datas in a newspaper. The datas from the newspapper and the link are equal.
I assume there are different calculation approaches.
Did I do something wrong?

Did someone notice a difference, too?

Danish Translation:

//
ARIES=♈ Vædderen
TAURUS=♉ Tyren
GEMINI=♊ Tvillingerne
CANCER=♋ Krebsen
LEO=♌ Løven
VIRGO=♍ Jomfruen
LIBRA=♎ Vægten
SCORPIO=♏ Skorpionen
SAGITTARIUS=♐ Skytten
CAPRICORN=♑ Stenbukken
AQUARIUS=♒ Vandmanden
PISCES=♓ Fisken

//
SPRING=Forår
SUMMER=Sommer
AUTUMN=Efterår
WINTER=Vinter

//
SUN_RISE=Solopgang
ASTRO_DAWN=Astronomisk daggry
NAUTIC_DAWN=Nautisk daggry
CIVIL_DAWN=Civil daggry
CIVIL_DUSK=Civil skumring
NAUTIC_DUSK=Nautisk skumring
ASTRO_DUSK=Astronomisk skumring
SUN_SET=Solnedgang
DAYLIGHT=Dagslys
NOON=Middagstid
NIGHT=Nat

//
NEW=🌑 Nymåne
WAXING_CRESCENT=🌑→🌓 Tiltagende halvmåne
FIRST_QUARTER=🌓 Første kvarter
WAXING_GIBBOUS=🌓→🌕 Tiltagende fuldmåne
FULL=🌕 Fuldmåne
WANING_GIBBOUS=🌕→🌗 Aftagende fuldmåne
THIRD_QUARTER=🌗 Tredje kvarter
WANING_CRESCENT=🌗→🌑 Aftagende halvmåne
//
NULL=ukendt :interrobang:
-=ukendt :interrobang:

1 Like