Hey, i think this might be simple but I cant get my head around it.
I have a device that when it reloads the integration, it renders a sensor’s state ‘unavailable’ then reports it back to its current state.
I am able to set my automation trigger to be only if the sensor changes from ‘0’ to ‘200’ but I want to put a condition, not to run if the sensor changes from ‘unavailable’ to ‘200’
I have also create a status helper so that the status only changes if the numbers change eg 0 > 200 = Refilled, 200 > 0 = Empty…maybe i should be using the status helper instead of the state?
Reason why I feel like I need to use the state instead of status, is so when I manually trigger the outlet on my external device, that it still can act as a trigger, just trying to prevent the false positives on the reload
The State trigger is very literal. If you set it with to: 200 and from: 0 it will only trigger when the value changes directly from “0” to “200” without any intermediary steps… a change from “unavailable” to “200” will not trigger it.
thanks for getting back to me so quickly. That park works for me, however is there a way I can make it so the first trigger is only from a state change? maybe ive asnwered my question while asking it, however when trying to use the attributes available I couldnt seem to get it to cooperate, see below:
First a little warning about using device ids instead of entity ids.
Next you can see in the trigger section that you have from and to keys.
If you look at the state trigger in the automation trigger documentation for HA you will see that there is an option to use not_from and not_to also. There is also an example of using it with the unknown/unavailable states.
ah sorry you’re right I used the state change for the time being because I want to test if the logic works on at least the next time it goes from unavailable to 200.
alias: STATUS - ATO Refilled
description: ""
triggers:
- trigger: state
entity_id:
- sensor.apex_ato_hi
from: "0"
to: "200"
attribute: value
conditions:
- condition: state
entity_id: sensor.apex_ato_lo
attribute: value
state: "200"
actions:
- action: input_select.select_option
metadata: {}
data:
option: Refilled
target:
entity_id: input_select.ato_level_state
- action: notify.mobile_app_iphone
metadata: {}
data:
message: ATO Is Refilled
mode: single
thanks, I have to admit I dont currently control my automations in YAML, would there be a good video someone could link to or a thread to learn more about harnessing YAML automations over the GUI? I currently use the GUI to avoid mis-typing anything