jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
191 stars 46 forks source link

Can someone ELI5 the event URL #213

Closed Hanselljlh closed 1 year ago

Hanselljlh commented 1 year ago

Where do I configure what? e.g. everything is working except HA updating status of HE devices. Can control but can't know.

I am 99% sure it is the URL that is the issue. Do I set it in HA or use the shown in HE and modify the embedded [url] ?

HA 192.168.1.10 HE 192.168.1.11 Port 11044

Thanks for the guidance

jason0x43 commented 1 year ago

The event URL is the URL that Hubitat will use to send event updates to HA. This address will be set in Hubitat by the integration when HA starts up.

By default, this address will be automatically set to a value that should work if HA and Hubitat are on the same network. If they are, you shouldn’t set any values for the address or port in the integration config.

You can check that the address is being set properly by opening the Maker API instance in Hubitat and checking the URL that events are POSTed to. Based on your description, it should be something like http://192.268.1.10:11044 (the port will likely be different each time HA is restarted).

Hanselljlh commented 1 year ago

This is what is in HE:

URL to POST device events to http://192.168.1.11:11044/apps/api/5/postURL/[URL]?access_token=xx

Send POST URL (replace [URL] with actual URL to send POST to (URL encoded) http://192.168.1.11/apps/api/5/postURL/[URL]?access_token=xx

jason0x43 commented 1 year ago

URL to POST device events to http://192.168.1.11:11044/apps/api/5/postURL/[URL]?access_token=xx

That looks like the URL that HA uses to access Hubitat. The event POST URL won’t have any query params, and will point to HA’s address, not Hubitat’s.

In the integration config in HA (three-dot menu on the Hubitat integration in the Integration page), remove any value you have for the event server URL and port. Leave those blank. Save the config and then reload the integration (also from the three-dot menu). After doing that open the Maker API page in Hubitat — what do you have for the event POST URL?