New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automations doesn't trigger sometimes #28108
Comments
Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration ( |
Can you use a numeric state trigger instead? Does it make any difference if you do? |
Good question. I've now changed the automation to the numeric state trigger like so: - alias: Full tank sensor
hide_entity: True
trigger:
platform: numeric_state
entity_id: sensor.tankslevel
value_template: '{{ states.sensor.tankslevel.state }}'
above: 99
action:
# Closes the valve and turns the motor off
- service: switch.turn_off
entity_id: switch.tankmotor
- service: switch.turn_off
entity_id: switch.tankvalve Let's see... This may take some days to test. But even if it works, something's off with the template trigger... |
If the device is offline during the action, the automation will fail (i think it would create a log entry in the error log though). That may be an jssue I'd suggest you add something like persisten_notification.create to check if the automation really does fire or if it's the action that fails. |
It's always online. Maybe it didn't respond or something like that? I don't know for sure.
I can do that, too. |
Yesterday it happened again. No difference. The trigger doesn't ... trigger.
On further inspection this isn't possible, because the percentage sensor and the relays are attached on the same ESP, so... This problem is not directly related to this sensor: Other things sometimes also don't trigger. I've set the lights in the garden to shut off at a certain hour and it happens that I look in the morning and they're still on. Another automation is there to shut off a valve to another motor after 3 hours and it happened to me more than once that the motor just stays on the whole day. |
I have exactly the samen problem with temperature (sonoff / mqtt) and humidty (zigbee / mqtt) sensors. An ugly workaround is to implement a 1 minute time_pattern trigger. https://community.home-assistant.io/t/automations-doesnt-trigger-sometimes/184026/ |
@Fusseldieb the template condition in the automation in your original comment is invalid. You can't put a comment inside a template, since it becomes part of the result. That template condition would effectively always evaluate to false (because after being evaluated, converted to lower case and stripped, it will never exactly equal the string Also, when you removed that condition and changed the trigger to a If you are still having trouble, I suggest you add the following to your configuration: logger:
default: info
logs:
homeassistant.core: debug Then you'll be able to see (in home-assistant.log) all the state changes of that sensor (and all other entities in the system), as well as when the automation triggers. That will give you all the details you need to understand why the automation triggers or doesn't trigger when you expect it to. |
Sorry, but that comment inside the template I inserted here on GitHub, it isn't part of my automation, it was just to explain better. The autionation also triggers fine - but only sometimes.
Oh, okay... Makes sense, I'll remove it later. Note that the autiomation works 100% with the time_trigger, but it's an awkward workaround.
I will! Thanks for answering! |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This still happens, unfortunately
Em sex, 10 de jul de 2020 22:32, stale[bot] <notifications@github.com>
escreveu:
… There hasn't been any activity on this issue recently. Due to the high
number of incoming GitHub notifications, we have to clean some of the old
issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check
if that solves the issue. Let us know if that works for you by adding a
comment 👍
This issue now has been marked as stale and will be closed if no further
activity occurs. Thank you for your contributions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD7E6MQI57WWNCCMM6CO5LR266I7ANCNFSM4JDP4VUA>
.
|
sounds similar to an issue I am having. I have a template sensor I am trying to use as a trigger within an automation. variable_sensors:
sensor:
- platform: template
sensors:
# SOLAR TEMP DIFF
solar_temp_diff:
value_template: "{{ states('sensor.pentair_airtemp') | float - states('sensor.pentair_soltemp') | float }}" this sensor updates and reports the expected values, but it will not activate the trigger in the automation. If I manually trigger the actions within the automation, it works as expected the automation is as follows (currently using state as a trigger, but I have also tried numeric state). My other automations trigger on time, sun, state (but from sensors created by other integrations - not a template sensor I created in my yaml alias: pool - solar circ (on/off) @ 20
description: ''
trigger:
- platform: state
entity_id: sensor.solar_temp_diff
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ states(''sensor.solar_temp_diff'') | float < 20 }}'
sequence:
- service: switch.turn_off
target:
entity_id: switch.pentair_pooll
- conditions:
- condition: template
value_template: '{{ states(''sensor.solar_temp_diff'') | float >= 20 }}'
sequence:
- service: switch.turn_on
target:
entity_id: switch.pentair_pooll
default: []
mode: single I too am starting to wonder if it is something bigger. |
@bsp9493 see my comments above about enabling debug output and checking home-assistant.log for details to see what's really happening in your system. |
turned on debug, and watched it for probably an hour (searched as well) and CANNOT see solar_temp_diff showing an update in the logs I even added an automation to force update of this entity... in that case I see the following
but again, NO update in the state of solar_temp_diff. if I change the value manually with developer tools... I see the expected outcome as follows...
so for some reason, that I am unable to track down changes to the state of this entity are NOT being logged even though my sensor is displaying the correct values and showing update as it should. |
Not sure what to tell you. If the sensor is updating, then there should be |
Home Assistant release with the issue:
0.100.2
Last working Home Assistant release (if known):
N/A
Operating environment (Hass.io/Docker/Windows/etc.):
Ubuntu Server 18.04 using Hassio within Docker
Integration:
Template Automation
Description of problem:
Sometimes automations don't trigger. It's very rare, but it occurs. In my case, we have a water tank which fills when it's below 80% and only stops when it reaches 100%, but sometimes (rare), it just doesn't trigger and do overfill the tank. Right now as I'm writing this it's happening again. There's nothing wrong with the automation itself, as it works 99% of the time.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
At this time, it still didn't trigger
To remedy this issue temporarily, I've added a automation inside ESPHome that turns the valve off if it reports over 108% to avoid any major problems. At 118% it would overflow (which happened a couple of times before).
The text was updated successfully, but these errors were encountered: