Multiple RSS Feeds

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?

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

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/

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.

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

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

Nice detective work! Sorry I was out most of the day but looks like you nailed it!

1 Like