Originally posted by mrhappy
View Post
Announcement
Collapse
No announcement yet.
How to combine device status's into virtual device
Collapse
X
-
Originally posted by Just5 View PostThis script works great for me, however, I only get a rounded number as a string. Is there any way to:
1) Send to the DeviceValue variable instead of a DeviceString?
2) Show the entire decimal number from the addition of the two values, not just the rounded number?
Sub Main(Parms as Object)
hs.setDeviceValuebyref(166,(hs.deviceValueex(145) +hs.deviceValueex(148)),True)
End Sub
And in the value range you can specify the suffix as kWh
Leave a comment:
-
This script works great for me, however, I only get a rounded number as a string. Is there any way to:
1) Send to the DeviceValue variable instead of a DeviceString?
2) Show the entire decimal number from the addition of the two values, not just the rounded number?
Leave a comment:
-
Originally posted by rmasonjr View PostHi Chris - Tom has it right. Your script has a lot of extra spaces between the script command and the parens. If you will edit your script to look like Tom's and replace with your device id's you should be good to go.
Let us know if that doesnt get it.
Leave a comment:
-
Originally posted by TomTom View PostI'm not an expert on this, and hopefully Rob will chime in. I don't know if you or I have the latest version. Mine does work.
This is what I have.
Code:Sub Main(Parms as Object) hs.setDeviceString(166,"",True) hs.setDeviceString(166,(hs.deviceValue(145) +hs.deviceValue(148)) & "kWh",True) End Sub
Leave a comment:
-
Hi Chris - Tom has it right. Your script has a lot of extra spaces between the script command and the parens. If you will edit your script to look like Tom's and replace with your device id's you should be good to go.
Let us know if that doesnt get it.
Leave a comment:
-
I'm not an expert on this, and hopefully Rob will chime in. I don't know if you or I have the latest version. Mine does work.
This is what I have.
Code:Sub Main(Parms as Object) hs.setDeviceString(166,"",True) hs.setDeviceString(166,(hs.deviceValue(145) +hs.deviceValue(148)) & "kWh",True) End Sub
Leave a comment:
-
How to combine device status's into virtual device
OK, I'm stumped. I've tried figuring this out for a couple days but I give up.This will be easy for you guys, I'm sure. So I have the main panel energy monitor, and it only shows watts for each leg separately. Though...there is one child device called "Power" that sure looks like the combined power but it never updates.
I found the post by rmasonjr where he wrote a script to do this but it isn't working for me. Here is my script:
And the error.
Thanks!
ChrisTags: None
Leave a comment: