core: imap_email_content set to unknown after 30 seconds

The problem

I know there was a breaking change in 0.110.0, that imap_email_content should be set to unknown, when there is no email found. But the way it works (at least with Gmail) is, that the sensor sets its value correctly after receiving the email, but after 30 seconds it sets its status to an unknown, even then the email still sits in the inbox. So the sensor is basically useless, it has unknown value all the time except for 30 seconds after receiving the email.

Environment

  • Home Assistant Core release with the issue: 0.110.0
  • Last working Home Assistant Core release (if known): 0.109.0
  • Operating environment (Home Assistant/Supervised/Docker/venv): Ubuntu 19.10/Docker
  • Integration causing this issue: imap_email_content
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/imap_email_content/

Problem-relevant configuration.yaml

sensor:
  - platform: imap_email_content
    name: Alarm
    server: imap.gmail.com
    port: 993
    username: !secret gmail_username
    password: !secret gmail_password
    senders:
      - !secret alarm_email
    value_template: "{{ subject.split('Alarm - ')[1] }}"

Traceback/Error logs

No errors

Additional information

I am not deleting the emails. They sit in the inbox all the time. image

This was changed by https://github.com/home-assistant/core/pull/35123 by @MartinHjelmare

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I prepared something. How can we proceed to testing it with your setup?