Hi everyone, for my weather view, I scrape the forecast for the next hours on the Belgian Royal Meteorology Institute (Météo à Bruxelles - IRM). So far everything works well and it gives me a sensor which state is something like :
“La nébulosité restera abondante avec toujours un peu de pluie dans la moitié sud-est du pays. Ailleurs, le temps restera généralement sec avec quelques éclaircies.”
Now I want to display that text it in a card beneath other weather info I get from yahoo, the meteo.be website, a radar map for rain, etc.
Is there a (simple?) way to display ONLY THE TEXT quoted hereabove instead of having the typical two columns display (ie. ‘sensor NAME // ALL info in a very long and narrow column’) ? I’m currently at work, so I can not post a picture to be more clear, but I hope you understand what I mean.
Thank you for your reply. However, I have already checked custom UI and from my understanding it does not allow such thing (I may be wrong though).
Could you please explain a bit more how you would do it ?
I had the same need. I did a custom state card like @tmatheussen mention.
Here is a working card. Will show only the value (expanded) not the caption.
:
OK, I feel really stupid now, how did you get it to show?
I’m probably missing something very obvious here (possibly something with the naming), did you need to install the andrey-git repo?
I didn’t metion before, but the code above is in www/custom_ui/state-card-value_only.html
And I added the customize: of the sensor, with custom_ui_state_card: value_only
i was inspired by this and came up with the following. as long as your computeStateState() function returns a JSON formatted array… [{“somekey”:“data1”},{“somekey”:“data2”}], you can use the polymer template “dom-repeat” to iterate over the keys in the html section and insert line breaks as elements:
I probably should have added in my previous post to apply JSON.parse() to the computeStateDisplay return value. Here’s my config and code snippets. Post your config and sensor JSON value, if you’re still having trouble.
@roflcoopter here is my working config
In my github info I have the links to the files…
To keep it simple yet powerful I concat info in a python script and in the state card I split the string (to use in dom-repeat, like suggested by @bnhhass) and check for special formatting characters.
On Hass 0.58.1 this no longer works for me on the iOS app, but works fine on the PC. The text is not shown so its just a blank card. I have the text stored in an attribute named text since the state is limited to 255 characters.
Maybe @andrey has an idea? It works if i use the extra data from his Custom UI but that doesnt satisfy my need of splitting the text into several rows