Integration of Sparkfun-style Weather Kit into HA via ESPHome.io

I did find those in my research as well, and since I had plenty of CAT5 cable in hand I decided to just run another line dedicated for the I2C, and another breaking out the Rain, Wind Speed and Direction. I needed one more wire for the status LED so that got it’s own run. I bought some I2C light sensors (VEML6070 & SI1145) for UV and lightning detection, but have not had a chance to toy with them yet. Everything fits within the original housing for RF and batteries, and this addition would require another box. I’ll do that when I situate the station on the roof of the house instead of the garage.

I finally built PCB and a case (of course not finished) for the NodeMCU. I just need to practice my Dremel skills and get some shorter screws for the display mount.

I also did finally update my gist and fork from @mkuoppa who originally got this all to work!!

2 Likes

@bassicrob, this is lookin’ pretty awesome. Do you have a 3D printer? I don’t but these kinds of one-off smart home devices are just begging for 3D printed housings and that’s primarily why I’d want to spend the cash on one. I like the display! I have a few of these little displays hanging around but I’ve only put one of them into production… not a bad idea to put one on the weather station.

A 3D printer would certainly make these things easier to house, @SpikeyGG !! However my wife thinks that it would be yet another time consuming hobby that I don’t need, haha!

Honestly, although they don’t look as good, the project boxes don’t take nearly as long as laying out and assembling the board itself.

1 Like

@bassicrob i used you’re code with the same rain sensor. Got an output like this:

[12:01:14][D][pulse_counter:159]: 'SolarWeatherStation Rain': Retrieved counter: 30.00 pulses/min
[12:01:14][D][sensor:092]: 'SolarWeatherStation Rain': Sending state 10.77763 mm with 2 decimals of accuracy

Perhaps i don’t understand the calculations, but get easily 200mm rain. if i read the local weather authority they talk most of the times about 0,5 - 3 mm ?

I changed the 'update_interval: 2s ’ instead of 60sec, or does it need to be at 60 sec? I need it because of deep sleep entering in around 35 sec.
Thanks

I based my rain sensor code off of what @mkuoppa provided, but converted it to inches. The original metric conversion if that is what you are looking for is commented out in the code. It may explain your excess readings. Sometimes though I will get triggers even on a sunny day. If your mast is not secure the wind may trigger the flap to flip, triggering the reed switch in the rain bucket. This also assumes that your pin is not floating due to cable length or interference. Mine is 50’ and I have no additional resistors on that line.

HI,

Would it be possible to share the wiring schema?

It sounds like, after reading your post about the resistor values for a wind direction sensor that reads line voltage or resistance…that you might have some code you might share for incorporating a spark fun weather station kit wind direction sensor for HA. I have the reference material, and have the example code for arduino IDE which talks about that, but how do I incorporate that into the ESP and HA? I assume it would be as simple as creating a new sensor in the main device’s yaml but I am really new to this platform and could use some cheat sheets.

I have everything else working well, but not sure how to get the direction into HA.
I created my own board with the pull ups…just need to know how to call it into existence on HA.
Thanks.

The resistance values are calculated from the onboard ADC sensor (A0 pin). Depending on your resistor value used for the voltage supply you are sending, line length, and many other variables, your values may differ than those I provided in my code that works on my setup. I’ve calculated those during benchtop tests with a multimeter and ESPHome debug logs to tell me those values are “within range” of the values I should expect when the anemometer is pointed at the indicated direction. Further, the datasheet gives expected value ranges on the A0 pin based on a resistor value.
I suggest setting the vane up on a bench, mark the position of the instrument “North”, connect the wires per the datasheet or my gist with the specified resistor value, and rotate the vane to the other directions recording their values on the A0 pin. Once you’ve determined a range that applies to your setup, you can add those values to the code as indicated in the notes. I do not know how your own designed board is specifically configured to apply it to the config that is working for mine, but I am sure if you read the #comments you can get everything working, as well as the first ~15 or so posts of this thread and the referenced links.

The two links in the 2nd post of this thread provide insight on wiring diagrams and specifically my setup that worked for me. Hopefully you have figured yours out since your post, but if you still need help lmk.