Roof Snowmelt controller,


(Jimbol) #1

Hi all,

Just started here, and I want to make an app to control some roof heat cables. I live at 10000ft, and it gets pretty cold, and snowy. My house has heating elements on the roof to assist with drainage. There is alot of it, and it’s mighty expensive, so I want to control it smartly.

It only needs to be on when it’s warm enough to melt, and only during the primary melt hours, say 10am-2pm, and only during snow months, say November thru April. So i want to make an app that will check the calendar, the local weather for temp, and if it’s over 25degF, and it’s between 10-2, to turn on my smart outlet, which in turn operates several contractors that run the heating cables.

So I’d like to figure out how to get the temp from the internet, and the local time, and turn on and off the smart outlet appropriately.

Any pointers on where to start/


(Solardave1) #2

Do you absolutely have to get the temp off the net? It’s usually not accurate because of the locations that the NWS monitors from. ADI has both analog and digital temp sensors and a lookup on digi will return a hundred other sensors. ST can handle the time of day. Or you can use an aeon multi which will als tell you if a bird landed on your roof.


(Jimbol) #3

No, I don’t have to have the temp off the net, I could do it locally with a sensor, it would just need to be one that could cope with a pretty harsh outdoor environment. It gets a little below -20f a handful of times a year here. The temp doesn’t have to be perfect. Just looking for a place to start, really.


(Brian Steere) #4

The api has built in methods for getting weather info from the net as well. It may not be as accurate, but it may cut down on the need for a (potentially) expensive sensor.


(Chrisb) #5

I know the AEON says that their motion/temp/humidity sensor is rated for outdoor, but only to -4F.

I tend to think getting it online would be good enough for your purposes. Like you said, just needs to be close, not perfect.


(Zach Naimon) #6

Given the temperature, and the tendency of devices to not function properly at extreme temperatures, I’d probably pull from DarkSkies API through JSON or something of that nature.

https://developer.forecast.io/docs/forecast

as for the calendar checking:

def installed(){
  initialize()
}

def updated(){
  unsubscribe()
  initialize()
}

def initialize(){
  def midnight = timeTodayAfter(startTime1, "00:00", timeZone)
  runDaily(midnight, checkDate)
}
  
def checkDate(){
  def day = ["Nov","Dec","Jan","Feb","Mar","Apr"].contains(new Date().format("MMM"))
  if(day){
    checkWeather()
  }
}

Where you have checkWeather defined as some sort of weather checking system, either through an API or a sensor. As another thought, you could place your temperature sensor in a garage (or other less insulated area, provided you have one), and record the average temperature when the external temp drops to your preferred range.

Note, this is just one implementation, and you could probably pass a month range preference instead of hardcoding it. If you need fragments of some months, I’d suggest defining fragmented months separately…something like

def novWinter = ["Nov.27","Nov.28","Nov.29","Nov.30"].contains(new Date().format("MMM.DD"))
def winter = ["Dec","Jan","Feb","Mar"].contains(new Date().format("MMM"))
def aprWinter = ["Apr.1","Apr.2","Apr.2","Apr.3"].contains(new Date().format("MMM.DD"))
if(novWinter || winter || aprWinter){
  doStuff()
}

Cheers

EDIT: Had a few extra quotes that weren’t needed.