YannF
(Yann)
March 25, 2020, 1:47pm
1
Dear all,
I would like to factor my rule. Is it possible to transmit a value from sitemap to a rule ?
For example :
Items :
Switch test1 (groupA)
Switch test2 (groupA)
Sitemap :
Switch test1 mappings=["var1"="ON"]
Switch test2 mappings=["var2"="ON"]
I would like to use var1 or var2 in a rule. Is it possible ?
When I click on test1 I would like to trigger rule “action” and I would like to use var1.
When I click on test2 I would like to trigger rule “action” and I would like to use var2.
It should be the same rule.
Thanks
rossko57
(Rossko57)
March 25, 2020, 1:49pm
2
Perhaps you want to trigger from Member of
rlkoshak
(Rich Koshak)
March 25, 2020, 4:24pm
3
If you want the text from the mappings you need to use a String Item and define the mappings as ["actiontest1"="actiontest1"]
.
And your Rule is a whole bunch of nonsense. There is no such thing as a Group trigger. sendCommand
takes two arguments, an Item and the command.
Over all this looks a whole lot like an XY Problem. What are you actually trying to achieve?
YannF
(Yann)
March 25, 2020, 5:11pm
4
I have edited my post in order to explain a little more
rlkoshak
(Rich Koshak)
March 25, 2020, 5:17pm
5
My solution is still the same.
But why have two Items? Why not mappings["var1"="var1", "var2"="var2"]
?
Trigger the Rule with the one test Item and look at test.state
to see which “button” was pressed?
1 Like