Bob_NL
(Bob Visser)
May 7, 2017, 2:06pm
1
I just setup the new RSS Feed Template component succesfully. However, I can’t manage to setup 2 different feeds for some reason.
Configuration:
rss_feed_template:
residentie:
requires_api_password: true
title: "Home Assistant {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Livingroom temperature:"
description: "{% if is_state('sensor.family_room_thermostat_de_residentie_temperature','unknown') %}---{% else %}{{states.sensor.family_room_thermostat_de_residentie_temperature.state}} °C{% endif %}"
- title: "Driving time to Work:"
description: "{{ states.sensor.google_travel_time__driving.state }} mins."
- title: "Driving time to Home:"
description: "{{ states.sensor.phone_to_home.state }} mins."
- title: "Shell Express:"
description: " € {{ states.sensor.shell_express.state }} per liter"
pi:
requires_api_password: true
title: "Raspberri Pi 3 {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Uptime:"
description: "{{ states.sensor.since_last_boot_templated.state}}"
- title: "SSL certificate expiry:"
description: "{{ states.sensor.sensor.ssl_cert_expiry.state }} days."
- title: "CPU Load:"
description: "{{ states.sensor.cpu_use.state }} %."
- title: "Disk Use:"
description: "{{ states.sensor.sensor.disk_use_home.state }} %"
- title: "Free RAM:"
description: "{{ states.sensor.sensor.ram_free.state }} MB"
The first feed (residentie) shows up fine, the seconds one does not:
Working feed link:
https://deresidentie.duckdns.org/api/rss_template/residentie?api_password=REDACTED
Non-working link:
https://deresidentie.duckdns.org/api/rss_template/pi?api_password=REDACTED
Any idea what’s wrong?
rpitera
(Robert Pitera)
May 7, 2017, 2:12pm
2
Not sure, but usually when you are calling a list of things in YAML like a list of sensors or actions, you use the dash. Perhaps you need to preface the different feeds with a dash and space?
(Just a guess; haven’t upgraded yet and tried out the RSS feeds… You’d think you would get a formatting error message if this were the case though…)
Bob_NL
(Bob Visser)
May 7, 2017, 2:23pm
3
When I add dashes:
rss_feed_template:
- residentie:
requires_api_password: true
title: "Home Assistant {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Livingroom temperature:"
description: "{% if is_state('sensor.family_room_thermostat_de_residentie_temperature','unknown') %}---{% else %}{{states.sensor.family_room_thermostat_de_residentie_temperature.state}} °C{% endif %}"
- title: "Driving time to Work:"
description: "{{ states.sensor.google_travel_time__driving.state }} mins."
- title: "Driving time to Home:"
description: "{{ states.sensor.phone_to_home.state }} mins."
- title: "Shell Express:"
description: " € {{ states.sensor.shell_express.state }} per liter"
- pi:
requires_api_password: true
title: "Raspberri Pi 3 {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Uptime:"
description: "{{ states.sensor.since_last_boot_templated.state}}"
- title: "SSL certificate expiry:"
description: "{{ states.sensor.sensor.ssl_cert_expiry.state }} days."
- title: "CPU Load:"
description: "{{ states.sensor.cpu_use.state }} %."
- title: "Disk Use:"
description: "{{ states.sensor.sensor.disk_use_home.state }} %"
- title: "Free RAM:"
description: "{{ states.sensor.sensor.ram_free.state }} MB"
It errors:
2017-05-07 16:21:26 ERROR (MainThread) [homeassistant.config] Invalid config for [rss_feed_template]: expected a dictionary for dictionary value @ data['rss_feed_template']. Got [OrderedDict([('residentie', None), ('requires_api_password', True), ('title', "Home Assistant {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"), ('items', [OrderedDict([('title', 'Livingroom temperature:'), ('description', "{% if is_state('sensor.family_room_thermostat_de_residentie_temperature','unknown') %}---{% else %}{{states.sensor.family_room_thermostat_de_residentie_temperature.state}} °C{% endif %}")]), OrderedDict([('title', 'Driving time to Work:'), ('description', '{{ st.... (See /home/homeassistant/.homeassistant/configuration.yaml, line 426). Please check the docs at https://home-assistant.io/components/rss_feed_template/
Bob_NL
(Bob Visser)
May 7, 2017, 2:29pm
4
I also tried with commenting out the following lines (because it looks like there is an quote issue there iin my startpost):
- title: "Disk Use:"
description: "{{ states.sensor.sensor.disk_use_home.state }} %"
- title: "Free RAM:"
description: "{{ states.sensor.sensor.ram_free.state }} MB"
Same output.
Bob_NL
(Bob Visser)
May 7, 2017, 2:58pm
5
Hmmm it looks like the system sensors are the culprit, if I copy the contents to the 2nd feed it shows up fine:
rss_feed_template:
residentie:
requires_api_password: true
title: "Home Assistant {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Livingroom temperature:"
description: "{% if is_state('sensor.family_room_thermostat_de_residentie_temperature','unknown') %}---{% else %}{{states.sensor.family_room_thermostat_de_residentie_temperature.state}} °C{% endif %}"
- title: "Driving time to Work:"
description: "{{ states.sensor.google_travel_time__driving.state }} mins."
- title: "Driving time to Home:"
description: "{{ states.sensor.phone_to_home.state }} mins."
- title: "Shell Express:"
description: " € {{ states.sensor.shell_express.state }} per liter"
pi:
requires_api_password: true
title: "Home Assistant {{ as_timestamp(now())|timestamp_custom('%H:%m', True) }}"
items:
- title: "Livingroom temperature:"
description: "{% if is_state('sensor.family_room_thermostat_de_residentie_temperature','unknown') %}---{% else %}{{states.sensor.family_room_thermostat_de_residentie_temperature.state}} °C{% endif %}"
- title: "Driving time to Work:"
description: "{{ states.sensor.google_travel_time__driving.state }} mins."
- title: "Driving time to Home:"
description: "{{ states.sensor.phone_to_home.state }} mins."
- title: "Shell Express:"
description: " € {{ states.sensor.shell_express.state }} per liter"
1 Like
Bob_NL
(Bob Visser)
May 7, 2017, 3:47pm
6
Pfffff I see what I did wrong: on some sensors I put the word “sensor” twice…
description: "{{ states.sensor.sensor.ssl_cert_expiry.state }} days."
description: "{{ states.sensor.sensor.disk_use_home.state }} %"
description: "{{ states.sensor.sensor.ram_free.state }} MB"
Working like a charm now:
2 Likes
rpitera
(Robert Pitera)
May 7, 2017, 11:57pm
7
Nice detective work! Sorry I was out most of the day but looks like you nailed it!
1 Like