Frage zu list - mehrere Variable in einem listitem-text

Begonnen von reticon, 09 Februar 2023, 16:19:43

Vorheriges Thema - Nächstes Thema

reticon

Hallo zusammen,

sorry .. ich schon wieder - ich versuche mir gerade "meine" Wettervorhersage in fhemapp zu bauen und komme aktuell nicht weiter.

Ich würde gerne in einer Textzeile zwei Variablen ausgeben (um den Temperatur-Range des Tages "von bis" auszugeben.
An anderer Stelle klappt es mit der Syntax ... ehe ich weiter die Tischkante bearbeite ... evtl. geht das gar nicht?

"text11": ["fc1_tempLow::%n.0 bis","fc1_tempHigh::%n.0"],

Viele Grüße,
Martin

PS: Ich habe parallel gerade meine Wetterdinge auf OpenWeatherMap und die API3 umgestellt ... falls das jemand schon in fhemapp drinhat .. würde ich auch nehmen .. ansonsten wühle ich mich weiter durch die Icon-ersetzungen ...

jemu75

Unten mal ein Beispiel, wie ich das bei proplanta gelöst habe.  :)

Damit die min. bzw. max. Werte untereinander auftauchen, verwende ich z.B. in der Spalte 5 (also ganz rechts) die beiden Felder "text5" und "text51".


{
"template": "list",
"setup": {
"iconSet": [
{ "val": "t1.gif", "icon": "mdi-weather-sunny" },
{ "val": "t2.gif", "icon": "mdi-weather-sunny" },
{ "val": "t3.gif", "icon": "mdi-weather-partly-cloudy" },
{ "val": "t4.gif", "icon": "mdi-weather-partly-cloudy" },
{ "val": "t5.gif", "icon": "mdi-weather-cloudy" },
{ "val": "t6.gif", "icon": "mdi-weather-partly-rainy" },
{ "val": "t7.gif", "icon": "mdi-weather-rainy" },
{ "val": "t8.gif", "icon": "mdi-weather-lightning" },
{ "val": "t9.gif", "icon": "mdi-weather-partly-snowy" },
{ "val": "t10.gif", "icon": "mdi-weather-snowy" },
{ "val": "t11.gif", "icon": "mdi-weather-snowy-rainy" },
{ "val": "t12.gif", "icon": "mdi-weather-hazy" },
{ "val": "t13.gif", "icon": "mdi-weather-fog" },
{ "val": "t14.gif", "icon": "mdi-weather-rainy" },
{ "val": "n1.gif", "icon": "mdi-weather-night" },
{ "val": "n2.gif", "icon": "mdi-weather-night" },
{ "val": "n3.gif", "icon": "mdi-weather-night-partly-cloudy" },
{ "val": "n4.gif", "icon": "mdi-weather-night-partly-cloudy" },
{ "val": "n5.gif", "icon": "mdi-weather-cloudy" },
{ "val": "n6.gif", "icon": "mdi-weather-partly-rainy" },
{ "val": "n7.gif", "icon": "mdi-weather-rainy" },
{ "val": "n8.gif", "icon": "mdi-weather-lightning" },
{ "val": "n9.gif", "icon": "mdi-weather-partly-snowy" },
{ "val": "n10.gif", "icon": "mdi-weather-snowy" },
{ "val": "n11.gif", "icon": "mdi-weather-snowy-rainy" },
{ "val": "n12.gif", "icon": "mdi-weather-hazy" },
{ "val": "n13.gif", "icon": "mdi-weather-fog" },
{ "val": "n14.gif", "icon": "mdi-weather-rainy" }
],
"listItems": [
{
"text1": ["weather::%s"]
},
{
"text1": ["pressure::Luftdruck:text"],
"text11": ["pressure::%n.0hPa"],
"text2": ["wind::Wind:text"],
"text21": ["wind::%n.0km/h"],
"divider": true
},
{
"text1": ["fc0_date::Morgens:text"],
"icon1": ["fc0_weatherMorningIcon::%s"],
"text2": ["fc0_date::Mittags:text"],
"icon2": ["fc0_weatherDayIcon::%s"],
"text3": ["fc0_date::Abends:text"],
"icon3": ["fc0_weatherEveningIcon::%s"],
"divider": true
},
{
"class1": "col-2 text-center",
"icon1": ["fc0_weatherDayIcon::%s"],
"class2": "text-left",
"text2": ["fc0_date::%wd:font-weight-bold"],
"text21": ["fc0_weatherDay::%s:text"],
"class5": "col-2 text-center",
"text5": ["fc0_tempMax::%n.0°C:text"],
"text51": ["fc0_tempMin::%n.0°C:text"]
},
{
"class1": "col-2 text-center",
"icon1": ["fc1_weatherDayIcon::%s"],
"class2": "text-left",
"text2": ["fc1_date::%wd:font-weight-bold"],
"text21": ["fc1_weatherDay::%s:text"],
"class5": "col-2 text-center",
"text5": ["fc1_tempMax::%n.0°C:text"],
"text51": ["fc1_tempMin::%n.0°C:text"]
},
{
"class1": "col-2 text-center",
"icon1": ["fc2_weatherDayIcon::%s"],
"class2": "text-left",
"text2": ["fc2_date::%wd:font-weight-bold"],
"text21": ["fc2_weatherDay::%s:text"],
"class5": "col-2 text-center",
"text5": ["fc2_tempMax::%n.0°C:text"],
"text51": ["fc2_tempMin::%n.0°C:text"]
},
{
"class1": "col-2 text-center",
"icon1": ["fc3_weatherDayIcon::%s"],
"class2": "text-left",
"text2": ["fc3_date::%wd:font-weight-bold"],
"text21": ["fc3_weatherDay::%s:text"],
"class5": "col-2 text-center",
"text5": ["fc3_tempMax::%n.0°C:text"],
"text51": ["fc3_tempMin::%n.0°C:text"]
},
{
"class1": "col-2 text-center",
"icon1": ["fc4_weatherDayIcon::%s"],
"class2": "text-left",
"text2": ["fc4_date::%wd:font-weight-bold"],
"text21": ["fc4_weatherDay::%s:text"],
"class5": "col-2 text-center",
"text5": ["fc4_tempMax::%n.0°C:text"],
"text51": ["fc4_tempMin::%n.0°C:text"]
}
],
"info": {
"left1": ["weatherIcon:::%s"],
"mid1": ["Readings.state.Time::%t"],
"right2": ["state:Tmin::mdi-sync", "state:::mdi-sync-off"]
}
}
}