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 3.0.0.548
        Operating System: Microsoft Windows 10 Pro - Work Station

        Enabled Plug-Ins
        3.0.0.6: AK Smart Device 3.0.1.9: AmbientWeather 2.0.63.0: BLBackup 3.0.55.0: BLGData 3.0.38.0: BLLock 2.0.26.0: BLUPS 3.2.0.1: Device History 3.0.0.73: EasyTrigger 3.25.614.1: HSBuddy 3.1.0.22: MeiHarmonyHub 3.1.0.2: SDJ-Health 19.10.7.1: TPLinkSmartHome 3.0.6681.34300: UltraCID3 3.0.6644.26753: UltraLog3 3.0.6554.33094: UltraMon3 3.0.5960.36744: UltraSighthoundVideo3 3.0.7806.23606: UltraWeatherWU3 3.0.2.0: Z-Wave

        Comment

        Working...
        X