Author Topic: Exporting Weathercat data to Home Assistant  (Read 8400 times)

MichaelMaggs

  • Gentle Breeze
  • **
  • Posts: 17
    • IHERTSBE2
  • Station Details: Davis Vantage Pro 2
Exporting Weathercat data to Home Assistant
« on: May 10, 2021, 04:25:00 PM »
Is there any way of exporting WeatherCat data into Home Assistant so that it can contribute to a home automation setup?

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
This app? What data? (Re: Exporting Weathercat data to Home Assistant)
« Reply #1 on: May 10, 2021, 10:10:47 PM »
Dear Michael and WeatherCat home automation enthusiasts,

Is there any way of exporting WeatherCat data into Home Assistant so that it can contribute to a home automation setup?

Is this the application you want to send WeatherCat data to?

https://apps.apple.com/us/app/home-assistant/id1099568401

What sort of data were you hoping to send to Home Assistant?  WeatherCat compiles some HVAC related statistics.  Where you thinking about that sort of statistics or raw weather data?

Let us know.

Cheers, Edouard

MichaelMaggs

  • Gentle Breeze
  • **
  • Posts: 17
    • IHERTSBE2
  • Station Details: Davis Vantage Pro 2
Re: Exporting Weathercat data to Home Assistant
« Reply #2 on: May 13, 2021, 05:50:19 PM »
Yes, that's the application. It's become over the last few years a huge open source ecosystem of home automation enthusiasts, with many integrations but alas not WeatherCat. See for example here: https://www.home-assistant.io/integrations/#weather. There isn't much that can provide local data from a personal weather station, though. Especially for MacOS.

To work with a home automation system a real-time API is really needed so that, for example, the heating can be adjusted up based on home external temperature measurement, or greenhouse ventilation controlled by inside temperature and humidity. Essentially all the real-time data would need to be exposed, though not derived values as those can be calculated externally.

Without a WeatherCat API the only way to use home automation is to obtain the real-time data from the local weather station itself. I've raised that as a separate issue in another thread about the Davis Weatherlink Live, now that the WeatherlinkIP logger has been discontinued.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Dear Michael and WeatherCat

Yes, that's the application. It's become over the last few years a huge open source ecosystem of home automation enthusiasts, with many integrations but alas not WeatherCat. See for example here: https://www.home-assistant.io/integrations/#weather. There isn't much that can provide local data from a personal weather station, though. Especially for MacOS.

At the moment, there are many feature requests associated with WeatherCat.  All that you can do is make your suggestion and see how much interest there actually is.

Alternatively, WeatherCat supports an AppleScript interface that exposes all the weather data.  If you were willing to roll up your sleeves and do some scripting (or find someone will to do this,) WeatherCat has the means to get all data into other applications.


To work with a home automation system a real-time API is really needed so that, for example, the heating can be adjusted up based on home external temperature measurement, or greenhouse ventilation controlled by inside temperature and humidity. Essentially all the real-time data would need to be exposed, though not derived values as those can be calculated externally.
. . . . .

While not as geeky, there is much to learn by using WeatherCat as a tool to trim the settings of your HVAC system.  For many years I have used the graph and table features to make choices about how to heat and cool the house.  Unless your home is so automated that you have windows that open and close automatically, some things need to be done manually.  You can learn a lot about how your home behaves by watching how inside and outside temperatures effect one another.  That might in turn modify your home automation strategies.

Cheers, Edouard

mikegf

  • Gentle Breeze
  • **
  • Posts: 15
    • FW4257
    • INSWYASS5
  • Station Details: Davis VP2 Pro, Macstudio M2U, MacOS 15.0
Re: Exporting Weathercat data to Home Assistant
« Reply #4 on: August 30, 2021, 11:22:13 PM »
Bit late (don't monitor a lot) but I have been doing this (via MQTT) for about a year now.  HA has native MQTT support (which I also used for other things).  To set it up you need:

1.  MQTT Broker.  There are some publicly available but I use mosquitto on the mac via homebrew to keep my system entirely behind my firewall.
2.  Set up the weather cat "scraping" via AppleScript.  Mine is based on mangrovemikes but is now very stable. You can find at https://github.com/mikethefarmer/WeatherCatMosquittoBridge.  There are a couple of lines that need configuring at the top for your setup.
3.  Install MQTT add-on in HA.
4.  Setup MQTT sensors in HA.

I have attached an extract of my Weathercat sensors definition.  Note that there is no "sensors" section header, as I have mine in a separate sensors.yaml file (good idea as I have pages of MQTT sensors - you wouldn't be able to jump over them if all in config.yaml!).  There are quite a lot as I have a second Temp/Hum unit together with a soil moisture unit, so you may not need quite so many.  The MQTT topic "base" and broker address as set in the applescript.

I also tend to run a terminal window subscribing to all my MQTT topics to keep an eye on the broker.  Just use mosquitto_sub -h localhost -v -t "#"  to subscribe to all

I have promised to write an MQTT section of the wiki, just been far too busy just yet. 

I also have an AppleScript to get external MQTT into WeatherCat as a synthetic channel - it described in another post somewhere in this section (about a year ago?).

R, Mike

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks for sharing (Re: Exporting Weathercat data to Home Assistant)
« Reply #5 on: August 31, 2021, 09:29:30 PM »
Dear Mike and WeatherCat "spread the wealth" types,

Thanks so much for sharing this!  It is a bit involved but there are certainly some WeatherCatters that might take up the challenge.

Cheers, Edouard  [cheers1]

mikegf

  • Gentle Breeze
  • **
  • Posts: 15
    • FW4257
    • INSWYASS5
  • Station Details: Davis VP2 Pro, Macstudio M2U, MacOS 15.0
Re: Exporting Weathercat data to Home Assistant
« Reply #6 on: September 01, 2021, 11:54:31 PM »
Home Assistant starts off nice and simple, then as you progress to "really" wanting to integrate disparate systems, you seem to be expected to become an overnight expert in yaml formatting, python and (depending on your setup) Linux, Docker, Mosquitto etc.  Then when I needed to add LoRaWAN sensors    .........  in case your are wondering I am working on the final installation of soil moisture sensors scattered around the farm - with one sensor each the Davis solution doesn't cut it (financially or capability) so I built my own.  That meant a gateway, yet another Rpi, etc.[banghead]

That said, not only do I have most of the house lights automated (much to the displeasure of the wife who prefers the old fashioned digital switches!), the weather and home soil moisture integrated (WeatherCat via MQTT), my 80s A/C (via simple on/off using a Shelly switch), my greenhouse (temp/hydroponics control/fan control by custom Esp32s using EspHome and diesel heater via MQTT), some specialist sensors like sky temperature and cloud cover (for astronomy) and the upcoming soil sensors (via LoRaWAN and MQTT).

By far the most stable in all of this is WeatherCat (of course) and MQTT.

Any you can see why I haven't got around to writing the MQTT wiki yet!

Blicj11

  • Storm
  • *****
  • Posts: 4076
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.5 | WeatherCat 3.3.3 | Supportive Wife
Re: Exporting Weathercat data to Home Assistant
« Reply #7 on: September 07, 2021, 06:36:33 PM »
That said, not only do I have most of the house lights automated (much to the displeasure of the wife who prefers the old fashioned digital switches!),

Hahahaha! I feel your pain. I automated our home about 15 years ago, as we were building, before home automation was a thing, using complicated technology from a company called Vantage. They are still in business, but home automation is much simpler these days. Anyway, my point is my wife also hates the automation and wishes we still controlled everything with manual switches.
Blick