RELEASE: AcuRite Weather Station

Awesome, did you notice if the poll interval is actually changing when you set it to something new? Mine was stuck on 5 mins, or so I thought until I made the change above. It didn't show up in the scheduler right at the bottom of the device page either. But it does now, maybe i just didn't wait log enough.

To get the scheduler to work....

In preferences:

input "poll_interval", "enum", title: "Poll Interval:", required: false, options: [
            ["5":"5 Minutes"],
            ["10":"10 Minutes"],
            ["15":"15 Minutes"],
            ["30":"30 Minutes"],
            ["60":"1 Hour"],
            ["180":"3 Hours"]
        ], defaultValue: "5"

Then...

def updated() {
    if (debug) log.debug "AcuRite: updated() called"
    initialize()
}

def initialize() {
  unschedule()
  if (debug) log.debug "AcuRite: initialize() called"

  if (!acurite_username || !acurite_password || !device_id) {
    log.error "AcuRite: required fields not completed.  Please complete for proper operation."
    return
  }
    if(poll_interval == "5") runEvery5Minutes(poll)
    if(poll_interval == "10") runEvery10Minutes(poll)
    if(poll_interval == "15") runEvery15Minutes(poll)
    if(poll_interval == "30") runEvery30Minutes(poll)
    if(poll_interval == "60") runEvery1Hour(poll)
    if(poll_interval == "180") runEvery3Hours(poll)
    if (debug) log.debug "AcuRite: scheduled to run every ${poll_interval} minutes."
}

Hope this helps

2 Likes

Ahhh, @bptworld I see what you have done there. Easy to follow as well. Question, where would a guy start to learn the basics of this stuff? I have been hours reading and looking over code aimlessly, but I have zero background (unless you want to count MS-DOS back in the late 80's, lol). I have looked at a lot of the online courses but there are so many, I would really like a place to start to learn Groovy specifically.

This is exactly how I learned. Find a reason for an app, start basic and keep adding stuff. Learn something new with every change/addition. Ask questions here and Google everything! lol

Also, feel free to dig through any of my apps. I might not use the best (or right) way to get things done but in most cases, it works. :wink:

1 Like

Thank you very much. Good advice! I have looked at your code on github quite a few times, I find a big difference in being able to follow yours vs. some others I have looked at. It just seems step by step logical and you use the same style / patterns (for lack of better words) between all your code. This is better for me to understand. I find the Hubitat Documentation has lots to offer as well.

1 Like

@david22 I couldn't get the native HE weather tile to show the wind speed. I suspect it's the difference in the naming wind_speed vs. windSpeed. So I added a new attribute..
image
And then sent the information from wind_speed to it so the tile knows what it is (or at least I think I did, lol) it works!

All set, added windSpeed and re-added the list of attributes as my weather station sees them.

Question for the crowd - if attributes are required for value persistence, is there a similar place to store the unit that is sent in the event?

thanks!
Dave

2 Likes

Nice job @david22 ! Noticed another thing, the HE native weather tile is not accepting the wind_direction_xxx. Just the way the tile wants to see the data, I think, again. So I done this...

image

And this,

Then the arrow moved on the dashboard pointing to the direction of the wind. Everything else is working great. Thanks for this.

Cool, I didn't realize the weather tile had that. Fixed!

1 Like

I'm getting the same error that ymerj got. What was the fix? I retrieved my deviceID from My AcuRite. is that the correct ID?

What error are you seeing?

The 404 error...

Your device ID is wrong. Look for an info that says "hubID:" somewhere in the developer window.

Got it. Awesome driver! Thanks.

Took a bit of searching to find the ID, but found these steps in an ST thread...

For finding my accountId and hubId values, I loaded my dashboard at My AcuRite and hit F12 to open the developer tools of the browser. Select the Network tab in the tools panel, then reload the page. Scroll down the left column to find an entry “hubs”, and in the right panel, select the “response” tab. This will show some code that includes the hub’s ID number and name. A little further down the left column is an entry named with the hub’s ID number; this one will show the account ID number in its data.

The id is at the front of the string in the response window...

{"id":XXXXXX,"account_id":XXXXXX,"device_key":....

On my access I have the 5n1 and I also have two tower temperature/humidity devices. What would it take to be able to create a 'new device' that would show a tower vs the 5n1. Then I could actually use them as useful temp devices in my system. Right now their basically useless since the only way I can see them is with the myAcurite dashboard.

I modified a an early version of this driver for use with my 5 extra devices so they show up as child devices:

This is to say it is possible if the developer wish to do so.

1 Like

@baconphonemail If I'm understanding the question properly, the current driver could be used by creating multiple instances and specifying the deviceID.

@ymerj If you could share your code, I can see about integrating the changes to handle multiple devices more elegantly. Merci beaucoup!

1 Like

I like that. I was thinking of having a list and selecting the device you want the driver to reflect. But I love the child device idea. Would you be willing to share the changes you made so I don't have to reinvent the wheel so to speak?

@baconphonemail I used the original version of this driver and strip it down to only what I need and tied it to my specific setup. So it would be unusable for others.

But I will PM @david22 with what I did. Since he is a way better coder than I am, I'm sure he will come up with something far more refine and practical for you.