Announcement

Collapse
No announcement yet.

Set Device to Expression - What am I doing wrong?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Device to Expression - What am I doing wrong?

    I am having troubles getting the "Set Device to Expression" to work in conjunction with device references...

    The Value of "Light - Beam Art - Upper Red (021)..." is 41.

    I would expect the Device to be set to 20, which is "Round(41 / 2)" but it is not changing at all.

    If I hard code the value to something like 13 then it does change, so I know that the Event is triggering.

    I suspect the problem is something to do with my syntax in:
    Round($$DVR:285:/2)


    But I am new and don't see where the error is. Any thoughts?

    Here are some screen clippings so you can see exactly what I have:
    Click image for larger version

Name:	Screen Shot 2018-10-21 at 18.48.14.png
Views:	0
Size:	0
ID:	1254546

    Here is the Virtual Device with Ref ID 285:
    Click image for larger version

Name:	Screen Shot 2018-10-21 at 18.55.27.png
Views:	0
Size:	0
ID:	1254545

    #2
    Try Round($$DVR:285: /2, 0). The 0 is the number of decimal places, making the result an integer.
    Last edited by randy; October 21, 2018, 09:33 PM.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Yes, thank you, that solved the problem.

      I wrongly assumed that (Round) would default to an Integer rounding. Apparently not.

      Again, thank you. It worked.

      Comment


        #4
        FYI, some documentation about operators and functions for expressions: I have just added a topic about available operators and expressions: https://forums.homeseer.com/forum/ul...in-easytrigger

        Comment

        Working...
        X