Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ambient Weather variant #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhracturedBlue
Copy link

AmbientWeather and Ecowitt use nearly identical protocols. Ecowitt uses a POST form, whereas AmbientWeather sends all data as params with a GET request.

The only other differences I found with my WS2902 was it sends 'batt_co2' instead of 'co2_batt' (even though it doesn't have any co2 sensor)

This plus a small home-asistant patch enabling 'GET' in the webhook were the only changes I needed to get my weather station working with HASS.

@GSzabados
Copy link

@joostlek, this one should be verified with some documentation on the "AmbientWeather" protocol. It would be a nice to have, and would likely make happy a lot of Ambient Weather station owners, as I remember it doesn't have a local option in HA, but from the Ambient Weather site. (And some quirky solutions, as I read in this thread https://community.home-assistant.io/t/ambient-weather-available-locally-now-integration-anyone/299180

@PhracturedBlue, could you provide some documentation on this? Logs, settings to activate the protocol. And any info if there is any PR to core to implement in HA. (That would need a documentation update as well.) I am not fully convinced that this is just a minor change.

@PhracturedBlue
Copy link
Author

The only changes in homeassistant are:

--- /usr/src/homeassistant/homeassistant/components/ecowitt/__init__.py
+++ ./__init__.py
@@ -30,7 +30,8 @@
         return await ecowitt.handler(request)
 
     webhook.async_register(
-        hass, DOMAIN, entry.title, entry.data[CONF_WEBHOOK_ID], handle_webhook
+        hass, DOMAIN, entry.title, entry.data[CONF_WEBHOOK_ID], handle_webhook,
+        allowed_methods=[METH_GET, METH_POST, METH_PUT]
     )
 
     @callback

Other than that is just works. In the ambient weather app, I just paste the webhook url as:

server IP:
hass ip address
Path:
/api/webhook/<hass webhook-id>?

And everything works

I can't really file a PR for HASS until this change is accepted, since I need to update the proper version of aioecowitt.

The aioecowitt module doesn't seem to have any documentation, but I can file a PR for Hass documentation as well. But again, it makes little sense to to do util I've filed the HASS PR, which is gated by getting the changes into this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants