I need to set a delay based on the amount of characters within the list, I’m currently using ESPhome to send the value to HA via MQTT and then delay by that value but it’s incredibly messy as the project grows.
Using “| length” I get the amount of entries in the list. The sensor data is extracted using the following syntax
{{state_attr('sensor.feed','entries')|map(attribute='title')|list}}
and I’m using the following to extract the length in ESPHome and send it via MQTT back to HA :
- mqtt.publish:
topic: feedlength
payload: !lambda |-
return esphome::to_string(id(feed).state.length());
The source of the data is the Feedparsers HACS component : GitHub - custom-components/feedparser: 📰 RSS Feed Integration