Any idea about my algorithm issue mentioned previously about multiple triggers ?
I think, I will create a new thread because I didn’t find anything about this
Thanks
Any idea about my algorithm issue mentioned previously about multiple triggers ?
I think, I will create a new thread because I didn’t find anything about this
Thanks
Is that supposed to be pseudo-code or a real example? Because trigger.motion_sofa_livingroom.payload_json
is invalid.
Regardless of which one of the two MQTT Triggers occurs, you reference the trigger variable like this:
trigger.payload_json
For more information, refer to the documentation.
Either this:
condition: "{{ trigger.payload_json.occupancy == true }}"
or this because the received value is a boolean:
condition: "{{ trigger.payload_json.occupancy }}"
Yes it was supposed to be a valid answer. In fact, I Don t know how to do a difference between two different triggers. Try to Give them a name was my solution in my mind.
I already read the doc, but can I say, I need that two different value are valuable to true?
On my example, I need one value of each differents devices. Both of them need to be at true to realise an action.
Thank you
Regards
There’s no need to distinguish between the two triggers because you want the result of either of them to be true
and that’s what the example I posted above is designed to do.
Oh yes I see what you mean, sorry.
Indeed, your answer is correct in this case
Thank you.
But for my personal knowledge, how could I do to try to do a distinguish between the two triggers ?
(Even if I know in the current usecase it’s useless)
Edit: @123 , just about the condition expression here
condition:
- condition: "{{ trigger.payload_json.occupancy }}"
should be
condition:
- condition: template
value_template: "{{ trigger.payload_json.occupancy }}"
If I did what you suggest, I got an issue template
Because you did not do what I had suggested.
I never suggested this (which is invalid):
condition:
- condition: "{{ trigger.payload_json.occupancy }}"
I suggested to use a Template Condition in shorthand notation like this:
condition: "{{ trigger.payload_json.occupancy == true }}"
or this:
condition: "{{ trigger.payload_json.occupancy }}"
In addition, what you posted has an indentation error:
condition:
- condition: template
value_template: "{{ trigger.payload_json.occupancy }}"
^
|
Remove this additional space.
Alright about the condition example. Thank you.
Do you have an idea about multiple conditions (different so not only the condition at true for each) from multiple triggers ?
After that I stop to ask you questions like that but it’s interesting.