1) Give a description of the problem
I have a piston that is calculating a duration, but when it generates the string to make a POST request, it is either truncating all of the decimal points, or rounding.
2) What is the expected behaviour?
In the example log provided, I would have expected “8.239915” to be the “value” posted to my InfluxDB database.
3) What is happening/not happening?
After calculating 8.239915, it posted “8” to the database.
**4) Post a Green Snapshot of the piston![image|45x37]
5) Attach logs after turning logging level to Full
10/12/2019, 11:59:59 PM +79ms
+0ms ╔Received event [Home].time = 1570950000000 with a delay of -921ms
+149ms ║RunTime Analysis CS > 27ms > PS > 65ms > PE > 57ms > CE
+152ms ║Runtime (45611 bytes) successfully initialized in 65ms (v0.3.10e.20190628) (151ms)
+153ms ║╔Execution stage started
+188ms ║║Comparison (enum) off is (string) on = false (1ms)
+189ms ║║Cancelling condition #27’s schedules…
+190ms ║║Condition #27 evaluated false (11ms)
+191ms ║║Cancelling condition #26’s schedules…
+192ms ║║Condition group #26 evaluated false (state changed) (13ms)
+194ms ║║Cancelling statement #15’s schedules…
+202ms ║║Calculating (string) Total for the day: + (string) 08:14:23 >> (string) Total for the day: 08:14:23
+206ms ║║Total for the day: 08:14:23
+207ms ║║Executed virtual command log (2ms)
+217ms ║║Calculating (long) 29663694 / (long) 3600000 >> (long) 8.239915
+222ms ║║Calculating (string) duration,deviceName=Pool\ Recirc,groupName=Unknown,hubName=Home\ Hub,locationName=Home,unit=hours value= + (string) 8 >> (string) duration,deviceName=Pool\ Recirc,groupName=Unknown,hubName=Home\ Hub,locationName=Home,unit=hours value=8
+225ms ║║Calculating (string) duration,deviceName=Pool\ Recirc,groupName=Unknown,hubName=Home\ Hub,locationName=Home,unit=hours value=8 + (string) >> (string) duration,deviceName=Pool\ Recirc,groupName=Unknown,hubName=Home\ Hub,locationName=Home,unit=hours value=8
+229ms ║║Sending external web request to: xxx.xxx.xxx.xxx:xxxx/write?db=SmartThings
+447ms ║║Executed virtual command httpRequest (219ms)
+453ms ║║Executed virtual command setVariable (3ms)
+457ms ║╚Execution stage complete. (304ms)
+459ms ║Setting up scheduled job for Mon, Oct 14 2019 @ 12:00:00 AM MST (in 86400.463s)
+467ms ╚Event processed successfully (466ms)
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.