New ALERT feature

Hi All,
Having an issue with the new ALERT component. What I notice with the below config, is that as soon as my garage door opens, I receive an alert via telegram every second.

alert:
  garage_door:
    name: Garage Door Is Open
    entity_id: binary_sensor.garage_door
    state: 'on'
    repeat: 30
    can_acknowledge: True
    skip_first: True
    notifiers:
      - telegram

Anyone else having this issue?

What version of HA are you running? Are you sure that the sensor isn’t flipping between on and off?

I’ve got pretty much the same, and it behaves as expected - no alert upon opening and repeats at the specified interval.

I’m with @Tinkerer here - the following code is working fine for me:

# Alert that Garage Door has been open for x minutes
alert:
  garage_door_open_long:
    name: Garage Door is still open!
    entity_id: binary_sensor.garage_door_sensor
    state: 'off'   # binary switch uses invert_logic: true
    repeat: 5
    can_acknowledge: true  # Optional, default is true
    skip_first: true  # Optional, false is the default
    notifiers:
      - mypushbullet

What does the config for your binary sensor itself look like?

Before the alert component, I had my own automation to deal with open garages - and there was no issues with this.

alias: 'Garage Door Alert'  
trigger:
  platform: state
  entity_id: binary_sensor.garage_door
  from: 'off'
  to: 'on'
  for:
    minutes: 10
action:
  service: notify.telegram
  data:
    title: 'RollerDoor Open for over 10 minutes'
    message: ''

This is my binary sensor config:

binary_sensor:
  - platform: template
    sensors:
      garage_door:
        value_template: "{{ states.sensor.garage_sensor.state == '0' }}"  
        sensor_class: opening

One thing I have noticed, is that often when i set triggers to a particular time, ie at 07:30 it triggeres every second and I had to put in the seconds value also so it only triggered once.

I am going to restart HASS and see if the issue still follows…
I am unsure why its triggering every second, especially when the config shows it needs 30 mins to trigger as the “skip” option is true.

Issue still there after a restart… Version is 38.3 (current latest version).

See below for log:

17-02-19 04:04:37 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 04:04:39 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 04:04:40 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 04:04:41 INFO (Thread-10) [homeassistant.components.device_tracker.nmap_tracker] nmap scan successful 17-02-19 04:04:41 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 04:04:42 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open 17-02-19 04:04:43 INFO (MainThread) [homeassistant.components.alert] Alerting: Garage Door Is Open

I’d raise an issue with a summary of the problem, the version of HA you’ve installed (and how), your alert configuration and the relevant lines from the log.

Somebody else has reported the alert repeating as if the interval was hours instead of minutes, so it sounds like there’s an issue somewhere.

I’ve now set up a new HA install on my Mac. I’m on .38.4 and only set up the alert component with an input boolean as the trigger. Now like @switched i’m also getting notifications every second. Can’t be that we are the only people experiencing this issue?

If this was a common fault this forum would be littered with posts about it.

I’d highly advise raising an issue, so that the devs can track down why for some people this is happening. It could turn out to be something as simple as it only impacting those running OS X.

@Tinkerer if it was only one system I would agree with you. On the Mac system I get notifications every second, while on the Pi i only get the first notification and then all the following appear randomly hours apart.

Never raised an issue before so i’m not sure I know all the logs which will be required to track this issue down.

See, that’s useful information you didn’t include with your first post :wink:

For both systems, I’d provide your alert configurations and the console logs from HA that relate to the alert component. If they need more I’m sure they’ll ask for what they need.

Sorry to revive an old topic, but did someone open an issue on this yet? I’ve just setup a few new alerts with, repeat: 60, and I’m getting notifications every minute, not every hour like I’d expect.

Check that the timezone set in HA is the same as the timezone you’re setting before you start HA (either at the system level, or in the startup file for the service). I’ve found that when the Pi runs in UTC but I’m using local time, alerts can go a “little” nuts.

Yep, both system TZ and HA TZ are identical.

Not sure what’s going on then. I suspect the issue isn’t actually with the alert feature though, but is linked to this bug I found.