Custom Component: Hubitat

Already there :smiley:

Happy new year!

That it is. Lesson learned - reading is a great thing.


Hi, can someone show an example of how to fill in the information here? No matter what I did, it didn’t work.

If you open your Maker API instance in Hubitat, at the bottom of the page will be a number of sample URLs, like:

http://192.168.10.24/apps/api/1/devices/[Device ID]?access_token=0fa4421e-084a-4d31-b890-b9e19473466c

All the necessary information is in any of these URLs.

Hub address: 192.168.10.24 (this must be accessible from HA)
Maker API app ID: 1 (it’s the number just after /apps/api/)
Maker API access token: 0fa4421e-084a-4d31-b890-b9e19473466c

You shouldn’t have to fill in any of the event server fields unless you find out that Hubitat isn’t able to communicate directly with HA.

2 Likes

Thank you it works fine

Hello everyone,

I have the Harmony Ultimate hub and have been using it with ST. I have it so that when I click one of the bulb switches on the remote it sets a virtual switch on, which then causes webCore to turn on a light. And same thing with a press and hold, but to turn off the light. I’m hoping to do the same with HE but don’t see how yet. Is this possible? Thanks!

This is the third time I have explained to you how to do it. The solution below does make use of this thread’s Hubitat integration with Home Assistant.

So I’ve been trying for a few weeks to get this to work and I just can’t seem to get past the connection screen. I am entering the IP of the hubitat, the app ID and the token and I just get a generic “unexpected error” like the one someone else above had. From the HA I can ping the IP of the HE hub so I know it can talk to it. Here are the logs from HA

2023-01-13 18:07:41.111 DEBUG (MainThread) [hubitatmaker.hub] Setting host to 192.168.120.25

2023-01-13 18:07:41.115 INFO (MainThread) [hubitatmaker.hub] Created hub <Hub host=192.168.120.25 app_id=266>

2023-01-13 18:07:41.130 DEBUG (MainThread) [hubitatmaker.hub] GET request to devices failed with [Errno 104] Connection reset by peer. Retrying...

2023-01-13 18:07:41.645 DEBUG (MainThread) [hubitatmaker.hub] GET request to devices failed with [Errno 104] Connection reset by peer. Retrying...

2023-01-13 18:07:42.663 ERROR (MainThread) [custom_components.hubitat.config_flow] Unexpected exception

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/hubitatmaker/hub.py", line 163, in check_config

await self._check_api()

File "/usr/local/lib/python3.10/site-packages/hubitatmaker/hub.py", line 304, in _check_api

await self._api_request("devices")

File "/usr/local/lib/python3.10/site-packages/hubitatmaker/hub.py", line 435, in _api_request

raise e

File "/usr/local/lib/python3.10/site-packages/hubitatmaker/hub.py", line 403, in _api_request

async with aiohttp.request(

File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1186, in __aenter__

self._resp = await self._coro

File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 559, in _request

await resp.start(conn)

File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 898, in start

message, payload = await protocol.read() # type: ignore[union-attr]

File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read

await self._waiter

aiohttp.client_exceptions.ClientOSError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/config/custom_components/hubitat/config_flow.py", line 88, in async_step_user

info = await _validate_input(user_input)

File "/config/custom_components/hubitat/config_flow.py", line 438, in _validate_input

await hub.check_config()

File "/usr/local/lib/python3.10/site-packages/hubitatmaker/hub.py", line 165, in check_config

raise ConnectionError(str(e))

ConnectionError: [Errno 104] Connection reset by peer

The “Connection reset by peer” message implies that the integration wasn’t able to open an HTTP connection to the Hubitat hub. What if you try to access the hub’s login page from the HA machine with curl? Do you get a bunch of HTML?

curl 'http://your.hub.ip/login'

No I get a “reset connection by peer” message. I can however ping the hubitat ip from the HA hub

I’ve got some type of networking issue, I disabled ip v6 as a troubleshooting step and it didn’t like that. Reinstalling from scratch and will report back my results.

Got it all sorted out, the issue was when i manually assigned my ip for whatever reason I ended is with a /32 instead of /24. I did do a fresh install but suspected that was my issue and verified with ip/24.
Thanks for the assist!

1 Like

Is there a way that the “Last Activity At” timestamp from the Hubitat device can be added as an entity in HA? Some of my battery powered Zigbee contact sensors show full 100% battery remaining even when they are dead. I was looking to see if I could setup an automation to send a notification in case they dont have any activity after a certain number of hours.

Hubitat devices in HA have a “Last Update Time” entity that’s disabled by default. Enable that and see if it suffices.

2 Likes

Looks like that was it, thanks!

Not sure If discussed earlier but Im having issues where for example hubitat mode changes are not updating automatically to HA. I need to manually reload integratuon and that helps. Is there anyone else having same issues and If…is there a fix for it?

Is it just Hubitat mode changes that aren’t updating, or are other device states not updating as well?

Usually just hub modes but just noticed that sensibo isnt working without reloading integration. And latest thing is that localtuya seems to Be out after latest HA update.

Well, as far as the Hubitat integration goes, the issue is usually either with the network configuration or with the Maker API settings in Hubitat. Ensure that “POST location events” is enabled in the Maker API instance in Hubitat. Also ensure that the address in “URL to POST device events to” will work – Hubitat has to be able to send messages to that address, so if it’s on a different subnet, or if it’s an address on an internal VM network, it won’t work. The address is configured automatically by the Hubitat integration in HA, so if it needs to be manually set, do that in the integration settings in HA, not in the Maker API settings in Hubitat.

I did not have Post location events enabled. Just enabled it. That could help right?

The thing is…If I create virtual switch to hubitat and use webcore piston to turn switch on when Day mode is on…and switch off when away mode is on…then I can use that switch on HA automations Via maker api and everything Works. Switch status is updated immediately to HA side. If Im trying to use hubitat hub mode option it doesn’t work. I need to manually reload integration so that hub mode updates. Also noticed that hub mode doesn’t work fully when used in automations. Hub mode status (fe disarmed) seems to work but that also needs to be manually reloaded to get automations running.

URL to Post Works fully. All devices are in The same subnet and all My hubs and devices have static IP addresses.