Can I add specific data from a website in a markdown card?
In my dashboard, I want to show something like a ‘Quote of the Day’ from a website.
One example would be using the RSS link http://feeds.feedburner.com/brainyquote/QUOTEBR
Can I add specific data from a website in a markdown card?
In my dashboard, I want to show something like a ‘Quote of the Day’ from a website.
One example would be using the RSS link http://feeds.feedburner.com/brainyquote/QUOTEBR
I would use a rest sensor and use the result in the card
example for the second (i.e. 1) title in the items list
- platform: rest
name: testing_xml
scan_interval: 36000
resource: http://feeds.feedburner.com/brainyquote/QUOTEBR
value_template: '{{ value_json.rss.channel.item.1.title }}'
Forgot the whole thing…now with description in the attrib
- platform: rest
name: testing_xml
scan_interval: 36000
resource: http://feeds.feedburner.com/brainyquote/QUOTEBR
value_template: '{{ value_json.rss.channel.item.1.title }}'
json_attributes_path: $.rss.channel.item.1
json_attributes:
- description
Thanks. I’ve added that as a sensor in config.yaml
but how do I add the result to the markdown card? I’ve never used rest sensors before and not sure what to enter in the markdown.
Well… I assumed you know how to use markdown cards…this is just another sensor with data which you can easily access in MDcards as a state or state_attr
Do show what you have or what you aim for
I have a totally blank markdown card at the moment, as a placeholder in my dashboard because the only element of that card will be the data from the rest sensor.
So maybe explain what you want to achieve …do you really need markdown?
I am out soon, back tomorrow so any details might help spending time on
With a bit of messing about I’ve finally got it working.
I made a couple of changes to your code and ended up with the below:
- platform: rest
name: quote
scan_interval: 36000
resource: https://www.brainyquote.com/link/quotefu.rss
value_template: '{{ value_json.rss.channel.item.0.description }}'
json_attributes_path: $.rss.channel.item.0
json_attributes:
- description
Then added this to my markdown card:
{{ states('sensor.quote') }}
And this is the result on my dashboard:
I think I need to now look for a better resource for better quotes but at least I now know how to include it in my dashboard.
Thanks so much for your help to get me here.