Announcement

Collapse
No announcement yet.

convert temperature

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

    convert temperature

    how does one convert from C to F and also from F to C
    I did a search and came up with this but it does not work.
    &hs.SetDeviceValueByRef(6795,((hs.DeviceValueEx(3434)*9/5)+32),True)
    and
    &nhs.SetDeviceValueByRef(6795,((hs.DeviceValueEx(3434)*9/5)+32),True)

    thanks in advance
    Paul.

    #2
    I think you will either need to use a short script or the Easy Trigger plug-in. I haven't tested it, but his might do what you want:

    Code:
    Sub Main(ByVal Params As Object)
    Dim dblTemp as Double = (hs.DeviceValueEx(3434)*9/5)+32
    hs.SetDeviceValueByRef(6795, dblTemp, True)
    End Sub
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      I did a test and the first immediate script command seems to work fine here. Remember that it only sets the device value so may not show up on the device status.

      You can do something like this as an immediate script command to show the status. It's a bit long so a short script may be better:

      Code:
      &hs.SetDeviceString(6795,(hs.DeviceValueEx(3434)*9/5)+32 & "°F",True) : hs.SetDeviceValueByRef(6795,(hs.DeviceValueEx(3434)*9/5)+32,True)
      Jon

      Comment


        #4
        When it "doesn't work," what happens?
        HomeSeer Version: HS3 Pro Edition 4.2.6.0
        Operating System: Microsoft Windows 10 Pro - Desktop

        Enabled Plug-Ins
        AK Google Calendar 3.0.0.45,AK Smart Device 3.0.0.6,AK Weather 4.0.1.77,AmbientWeather 3.0.1.9,Big5 1.38.0.0,BLBackup 2.0.63.0,BLGData 3.0.55.0,BLLock 3.0.38.0,BLPlex 2.0.22.0,BLUPS 2.0.26.0,Device History 3.2.0.2,EasyTrigger 3.0.0.74,HSBuddy 3.25.614.1,mcsMQTT 5.21.4.1,MeiHarmonyHub 3.1.0.22,NetCAM 3.0.0.14,PHLocation 3.0.1.109,Restart 1.0.0.7,SDJ-Health 3.1.0.3,SDJ-VStat 3.1.0.7,TPLinkSmartHome 19.10.7.1,UltraCID3 3.0.6681.34300,UltraSighthoundVideo3 3.0.5960.36744,,Z-Wave 3.0.2.0

        Comment


          #5
          Greetings sirbooker,

          I do not know if this applies to your situation but some devices can be switched from reporting in one scale to another.

          The following parameter is from an Aeotec water sensor...

          Click image for larger version

Name:	Screenshot_2021-10-21_21-54-04.png
Views:	53
Size:	12.4 KB
ID:	1503470

          Roger D

          Comment

          Working...
          X