No announcement yet.

How to Dynamically show Day of Week text?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Dynamically show Day of Week text?

    Is there a way in Homeseer to get the text dynamically for today, today +1, today + 2, etc. This is likely a more generic HSTouch and scripting question, but I am trying to apply it to my UltraWeatherBug install.

    On my HStouch I show the 3 day forecast. I would like each label to say the day of the week (or abbreviation) instead of "2 Day" "3 Day". Thus in HSTouch you would like to see the below if it was Monday:

    Mon 78
    Tue 78
    Wed 78

    or if today was Weds you would see
    Wed 78
    Thu 78
    Fri 78

  • #2
    You should get that information from the Forecast weather data. I don't know how UWB works though. I use weatherXML it creates devices from the weather feed forecast. Then I add the device status where the day goes on HStouch. The feed includes the Day and will change on the screen each day.


    • #3
      Thanks! My issue wasnt getting the data per se' but rather dynamically showing the day of the week and future days of the week. I was able to figure out VB code to make devices and then update them each morning at 12:01

      PHP Code:
      Imports System.IO

      Sub updateDayOfWeek
      (ByVal params As Object)
      hs.setDeviceString(705DateTime.Today.ToString("ddd"), True)
      hs.setDeviceString(706DateTime.Today.AddDays(1).ToString("ddd"), True)
      hs.setDeviceString(707DateTime.Today.AddDays(2).ToString("ddd"), True)
      hs.setDeviceString(708DateTime.Today.AddDays(3).ToString("ddd"), True)
      End Sub

      Sub createDaysOfWeek
      (ByVal params As Object)

      Dim ref As Long
      hs.NewDeviceRef("Day of Week - Today")
      hs.setDeviceString(refDateTime.Today.ToString("ddd"), True)
      ref hs.NewDeviceRef("Day of Week - Today + 1")
      hs.setDeviceString(refDateTime.Today.AddDays(1).ToString("ddd"), True)
      ref hs.NewDeviceRef("Day of Week - Today + 2")
      hs.setDeviceString(refDateTime.Today.AddDays(2).ToString("ddd"), True)
      ref hs.NewDeviceRef("Day of Week - Today + 3")
      hs.setDeviceString(refDateTime.Today.AddDays(3).ToString("ddd"), True)
      End Sub