Announcement

Collapse
No announcement yet.

How to change value to 0 Decimal Places for One Wire devices

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

  • How to change value to 0 Decimal Places for One Wire devices

    Does anyone know if there is a way to change the decimal places to 0 for the value of One Wire devices. The issue is that when I have an event that changes based on the temp, it triggers every time the temp fluctuates .x degrees. I was able to truncate the status, but not the value.

    Thanks Click image for larger version

Name:	Capture.PNG
Views:	5
Size:	20.6 KB
ID:	1280162

  • #2
    I don't know about "one Wire" devices specifically, but the number of decimal places displayed is typically configured on the "Status Graphics" tab. Look in the "Status" column for the setting "Dec Places:" for each device.

    Click image for larger version

Name:	Capture.PNG
Views:	5
Size:	146.8 KB
ID:	1280172

    Comment


    • #3
      I ended up doing it in the sketch before sending to HS. Round it, compare to previous value, and only send it if it changed.

      Mike

      Comment


      • #4
        Unfortunately I have already changed the decimal places in status to 0 which shows correctly for the status / display purposes, but the underlying value still has a decimal and that is what is used for events. I did not want to make any modifications to the sketch for fear of avoiding issues with future updates.

        Are there any settings in the plugin to round the value? I have not seen any.

        Comment


        • #5
          Are you using the API version?

          Mike

          Comment


          • #6
            I believe so. If this is what you mean.

            Click image for larger version  Name:	Capture.PNG Views:	1 Size:	7.0 KB ID:	1280202

            UPDATE:
            Just reading the documentation. Doesn't look like I am using the API.

            Comment


            • #7
              If you were using the API version, you would know. It requires you to write the main body of the sketch on your own for the Arduino. The advantage to the API version is you have complete control over what the Arduino does and when it sends or receives data from HS. If you are at all familiar with writing Arduino sketches, then the API version isn't all that difficult to implement. I started with the Normal version, but quickly went to the API so I could customize it. What exactly will your Arduino be doing?

              Mike

              Comment


              • #8
                Thanks for all of your help! I have 2 boards completely loaded with inputs and outputs and a few One Wire and analog temp devices. I think it will be easier for me to just round the number in a script and store in another variable or let the events trigger and not log them.

                Comment


                • #9
                  I would tend to agree. I had the same issues as you (wanting rounding), but was starting from scratch so I didn't have anything pre-configured to work around.

                  Mike

                  Comment


                  • #10
                    Originally posted by zakrzep View Post
                    Unfortunately I have already changed the decimal places in status to 0 which shows correctly for the status / display purposes, but the underlying value still has a decimal and that is what is used for events. I did not want to make any modifications to the sketch for fear of avoiding issues with future updates.

                    Are there any settings in the plugin to round the value? I have not seen any.
                    Do you use the Easy Trigger plugin? If so, you may be able to do what you want using the "A devices value is set and expression is True" Trigger. In the expression, you can include a mathematical formula which can include functions like rounding and trimming numbers and you can compare a newly changed value to a previous value so you could use an expression like " Floor($NEWVALUE) != Floor($OLDVALUE)", or instead of Floor, you could use Round, Truncate, Ceiling, etc.

                    For reference, look at Post #3 of: https://forums.homeseer.com/forum/ul...-in-user-guide

                    And for the expressions you can use, look at: https://forums.homeseer.com/forum/ul...in-easytrigger

                    If you don't already have Easy Trigger, its available on a free trial basis. I found it to be the best $30 I've spent on HomeSeer plugins!

                    Comment

                    Working...
                    X