Automation False Notifications

I have created an automation for my dryer utilizing an InkBird temp sensor. I keep getting false notifications. Looking at the logs, I’m not seeing this notification justified. Is there another conditions I should add to stop this?

Basically if inkbird drops below 100 degrees for 5min, notify my phone.

alias: Dryer Complete
description: “”
trigger:

  • type: temperature
    platform: device
    device_id: 064762ecd740059e9c883fcfd6152e3c
    entity_id: fa399fdfc53c991c8d7a177ee9f7b78d
    domain: sensor
    below: 100
    for:
    hours: 0
    minutes: 5
    seconds: 0
    condition:
    action:
  • action: notify.mobile_app_bryans_iphone
    metadata: {}
    data:
    message: Dryer is Complete
    mode: single

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Also:

Without this trace information we are just guessing. But my guess is that your sensor is going unavailable. The when it returns to a number under 100 for 5 minutes the automation triggers.

If this is the case you can prevent the triggers by using a state condition (not from unavailable).

Perfect. That would make sense. I will check that log when I get home today. Thank you.

It’s entirely possible your symptoms may be caused by the dryer going offline. Mine does that once the cycle finishes. But there is another possibility:
Consider that your automation is based on a sensor, and triggers are evaluated as sensor values change. So if it drops below 100 it will trigger. This is expected. But… after five minutes the temperature is STILL DROPPING. So the next time the sensor is evaluated in the automation the result is true again and another notification is fired off.
The easy solution is to add a condition that prevents repetitive notifications. If you search for automation last triggered conditions I think you’ll find lots of examples. If not, let me know and I can send you something tonight .
Hope this helps.

1 Like

This happens randomly not necessarily a double trigger. But I thought something like that could be happening.

So the temp fluctuates when the dryer is off because the sensor is in the dryer vent. Hot air from outside comes in and it increases. I’m guessing when the temp decreases it’s triggering it. Wondering if the trigger should be something like “when temp decreases below 100 degrees but only when it was above 100 degrees”. Not sure how I would do that though?

I can’t seem to figure out where the log is that would show it losing connectivity. I’m pretty new to this. 2 weeks in!

Nope, think I’m losing connection randomly. Just got a notification and I see that gap in the chart.

You can add the PING integration https://www.home-assistant.io/integrations/ping/. With that, you can check the online status of wifi devices and set you automations to respond or not respond. Here is the automation I use to ping devices and a second automation to notify me.

- id: ping_non_critical_devices
  alias: Ping Non Critical Devices
  initial_state: TRUE
  mode: restart
  trigger:
    platform: time_pattern
    minutes: '/15'
    seconds: 00
  action:
  - action: homeassistant.update_entity
    target:
      entity_id:
      - binary_sensor.ping_ambient_pws
      - binary_sensor.ping_bt_proxy_3
      - binary_sensor.ping_ds_218
      - binary_sensor.ping_ds_923
      - binary_sensor.ping_gar_led_center
      - binary_sensor.ping_gar_led_east
      - binary_sensor.ping_gar_led_west
      - add as many devices as needed

and

- id: a_device_goes_offline
  alias: A Device goes Offline
  initial_state: TRUE
  mode: restart
  trigger:
    - platform: state
      entity_id: binary_sensor.ping_sunroom_led
      to: "off"
      for:
        minutes: 10
    - platform: state
      entity_id: binary_sensor.ping_led_porch
      to: "off"
      for:
        minutes: 10
    - platform: state
      entity_id: binary_sensor.ping_tv_left
      to: "off"
      for:
        minutes: 10
  condition:
    condition: and
    conditions:
      - condition: template
        value_template: >
          {% if states.automation.a_device_goes_offline.last_triggered is not none %}
            {% if as_timestamp(now(),0) | int - as_timestamp(states.automation.a_device_goes_offline.attributes.last_triggered,0) | int > 3600 %} true {% else %} false
            {% endif %}
          {% else %}
          false
          {% endif %}
  action:
    - action: script.turn_on
      entity_id: script.notify_hass_a_device_goes_offline
      data:
        variables:
          var_device_name: "{{ trigger.to_state.attributes.friendly_name }}"
    - action: script.turn_on
      entity_id: script.notify_push_a_device_goes_offline
      data:
        variables:
          var_device_name: "{{ trigger.to_state.attributes.friendly_name }}"
#

NOTE: I deleted numerous sensors from both lists to minimize code length. Sensors seen in first code may not have remained in second code. This is just to demonstrate how the code works!!!

NOTE 2: This code is pretty old now and there are cleaner, better ways to improve upon it, I just don’t have the time to fix something that isn’t broken (yet).

NOTE 3: Take note of the condition in the second code. This is one way to prevent duplicate triggers of an automation. This is what I was referring to earlier, although not your primary problem in this case. Still it’s a good concept to employ.

You’ll have to install the ping integration and set it up before the code will work. It’s a pretty straightforward process. You just need the IP address of each device you want to add.

Art

Add this condition to your automation:

condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.dryer_temperature_here
        from:
          - unknown
          - unavailable

Alternative method:

condition:
  - condition: template
    value_template: "{{ trigger.from_state.state|is_number }}"

Thank you, to all of you! I’m going to play around with these tonight and see what happens.

This appeared to fix the problem. Haven’t had a false notification all weekend.