Is it possible to use a single reaction for multiple entities as variables?
-
@tamorgen said in Is it possible to use a single reaction for multiple entities as variables?:
@toggledbits said in Is it possible to use a single reaction for multiple entities as variables?:
Seems OK
It's still not tripping in MSR when I open a window.
This is what is being shown when all the windows are closed. I'm not really paying atention to the comparssion value, jsut the current value it's displaying. That value isn't changing.
I tried it with sys_group.members as well.
None of the comparisons seem to make any difference. Current value: array:0) "" remains the same in any state of the windows.
I went back to all the windows in the reactor.yaml file and copied the values directly from the Entities tab. They are all now working.
The only thing not working is the notification. Any ideas what the cause could be?
@tamorgen said in Is it possible to use a single reaction for multiple entities as variables?:
The only thing not working is the notification. Any ideas what the cause could be?
You have:
message: ${{ window_names }} Opened!
That stands out because it's not valid YAML. Missing quotes.
-
@tamorgen said in Is it possible to use a single reaction for multiple entities as variables?:
The only thing not working is the notification. Any ideas what the cause could be?
You have:
message: ${{ window_names }} Opened!
That stands out because it's not valid YAML. Missing quotes.
@toggledbits, how should the quotes work for a MSR variable in yaml? I copied your example in the second post, but you aren’t calling a HA function. I’ve been playing around with it, but I’m not getting the variable in the system call.
I’m looking at this documentation for HA.
They show an example
data: message: "{{ blind_state_message }}"
So, in theory,
message: "{{ window_names }}" opened.
should be valid. The difference here is that window_names is coming from the local expression.
However, MSR throws an error, telling me that I have invalid service data.
-
@tamorgen You need MSR to evaluate the whole data being sent
${{ { “message”: window_names + “ opened!” } }}
@Crille said in Is it possible to use a single reaction for multiple entities as variables?:
@tamorgen You need MSR to evaluate the whole data being sent
${{ { “message”: window_names + “ opened!” } }}
That's not working either. It actually disables the Play button at he end of Entity Action.
This is a system call on home assistant (call_service) to send a notification via the HA companion app. The message: text isn't part of the message to be sent, it's yaml code that is part of the data field.
For example, I have another reaction that sends a message to my phone when my washing machine has completed a cycle.
The word message doesn't appear on my phone, just the data after it.
Here is my current rule:
In the Local Expressions, you can see Last value: (string) "Office Windows", so that value should be returned for window_names in the system call.
-
Try without the spaces so it looks like this
message: ${{window_names}} Open
. MSR supports both JSON and Yaml, but you just gotta make sure theres no errors. Usually online validators help with this@Pabla said in Is it possible to use a single reaction for multiple entities as variables?:
Try without the spaces so it looks like this
message: ${{window_names}} Open
. MSR supports both JSON and Yaml, but you just gotta make sure theres no errors. Usually online validators help with thisDoesn't work. MSR throws this error.
-
Try without the spaces so it looks like this
message: ${{window_names}} Open
. MSR supports both JSON and Yaml, but you just gotta make sure theres no errors. Usually online validators help with this@Pabla said in Is it possible to use a single reaction for multiple entities as variables?:
Try without the spaces so it looks like this
message: ${{window_names}} Open
. MSR supports both JSON and Yaml, but you just gotta make sure theres no errors. Usually online validators help with thisThat triggers the notification, but the value isn't returned.
-
@Pabla said in Is it possible to use a single reaction for multiple entities as variables?:
Don't use the play button next to the action, use the play button right under set reaction
Well that makes a difference! This has been driving me nuts all afternoon. Thanks for cluing me in!
-
It should look like this:
message: "${{window_names}} Open"
-
T toggledbits locked this topic on