Replies: 2 comments 1 reply
-
You can have several triggers. Maybe it won't be very efficient. Anyway, there is limitations to actions. Under is an example on how i use "EVENT_STATE_CHANGED" in my energycost app: @event_trigger(EVENT_STATE_CHANGED, "entity_id.startswith('pyscript.consumption_highest_thismonth')") #Henter inn energimålerverdier
|
Beta Was this translation helpful? Give feedback.
-
You can have MANY functions with the same I think, in this case, the reason you're not seeing the logging is because the value of the @state_trigger(
'True',
watch = ['sensor.rf433']
)
def rf433_log_message(**data):
# ..... As a side note, I have found odd behavior (see #281) regarding modules that return trigger functions. I don't think that's interfering in this case, but, there may be other side effects I've not discovered yet. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I created the following helper function (in
modules
), it does an operation once the state of a sensor changes:it is actually set-up in a script:
Upon pressing a RF433 button, a Sonoff RF Bridge sends a MQTT message and the following sensor is set:
I also have a catch-all logging function for any RF433 message:
The mystery:
switch.salon_lampe_haute
is toggled but the logs are not displayed I just see the message fromOf course my first thought was that this action is defined elsewhere, so I changed
switch.salon_lampe_haute
to another lamp, restarted HA and pressing the button now toggles that other lamp.My question: can I have several
@state_trigger()
on the same entity? I guess I can because I see a log from one of the functions, and the action form another. Is it possible that there is some conflict in th elogging functions? (the first one wins, and the second one is discarded?)Beta Was this translation helpful? Give feedback.
All reactions