Home/Support/Support Forum/How do I place conditional statements in DIa .yml script
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How do I place conditional statements in DIa .yml script

0 votes
I want to put a conditional statement in the Dia .yml. For example, if /Channel1=true then /Channel2=False

Can anyone explain this to me please.

asked Oct 3, 2013 in Other/Legacy by kennemon New to the Community (2 points)

Please log in or register to answer this question.

2 Answers

0 votes
I'm not sure how to do this.
I think there is a way to control the channels in DIA in Digi ESP, but not sure. You may need to check with Digi people.
answered Oct 22, 2013 by 16ksa23 Veteran of the Digi Community (426 points)
0 votes
You might need to explain what you need a bit more. The example that you give above could be solved with the 'transforms' device. If you make a channel that has an expression like:

- Channel1
expr: not c[0]

For your channel2, then it will always be the inverse of Channel1. However, that's not necessarily conditional.

Transforms may still be an answer for you, if your gateway is new enough. Python added conditional expressions is 2.5, so gateways like the ConnectPort X2e or Transport products will allow you to use those as well.
answered Oct 22, 2013 by DigiGuy42 Community Contributor (102 points)