Custom Component: Hubitat

I´m so very happy. Now it works. Amazon how fast this fix came! Thnxz!

@jason0x43 I had the Maker API integration working briefly in testing (was testing between some other MQTT Hubitat integrations) and now I’m ready to move to this integration. I’ve installed the repo (v. through HACS and restarted both Home Assistant and my whole Raspberry PI (Running haas.io) but I still can’t get Hubitat to appear in Configure -> Integrations -> (add), it doesn’t appear.

About a week or so into using Open Z-Wave beta… Missing Hubitat a little bit today… The weird VNC interface is… buggy at best… At least my nodes aren’t dead. Sometimes it’s very slow (control of devices) sometimes the interface is just beyond frustrating…

Resisting the urge to buy a new Hubitat hub…

I’m going to blame my computer, I swear I cleared the cache, and that the issue wasn’t because of cacheing but alas, it was caching. Installed now.

@jason0x43 Would you prefer I create a github issue or is reporting here enough? It seems that if you don’t select “Allow control of HSM” in HE MakerAPI then the integration bombs out and devices never great created in HA. I had not selected this as I wasn’t using HSM.

2020-11-30 14:49:32 DEBUG (MainThread) [hubitatmaker.hub] Loaded modes
2020-11-30 14:49:32 DEBUG (MainThread) [hubitatmaker.hub] Loaded hsm status
2020-11-30 14:49:32 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Hubitat for hubitat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/hubitat/__init__.py", line 33, in async_setup_entry
    if not await hub.async_setup():
  File "/config/custom_components/hubitat/device.py", line 184, in async_setup
    await self._hub.start()
  File "/usr/local/lib/python3.8/site-packages/hubitatmaker/hub.py", line 158, in start
    await self._load_hsm_status()
  File "/usr/local/lib/python3.8/site-packages/hubitatmaker/hub.py", line 336, in _load_hsm_status
    self._hsm_status = hsm["hsm"]
KeyError: 'hsm'

Hi @jason0x43 ,
do you know how to remove old devices that no longer exists in home assistant?
I have a couple of hubitat virtual buttons that I tried to bring over and now I can’t remove them in the HA devices.
Do advise. thanks

Remove them from makeapi in Hubitat and then they’ll become “unavailable” and you should be able to delete them in HA.

I tried before but I cant seem to delete it. Its in the “devices” tab

When I click on it, it shows this

Theres no option for me to delete it.

Have you tried a reboot?
From my understanding, this component loads the devices/entities on every start. Removing the device from makerapi on hubitat and then rebooting HA it should show as unavailable and then able to be removed. But as long as the HE component is telling HA that the device is there, you can’t manually override it.

1 Like

I don’t think you can delete individual devices through the UI. The only way I know of at the moment is to edit the device registry in <config>/.storage/core.device_registry.

1 Like

I managed to delete them individually this way. Thank you so much.

Is there an easy way to replace devices in hubitat and retain HA entity ids?

Ex I’m swapping out some old Leviton dimmers with Inovelli dimmers. I can’t use ZWave replace to keep the same device id in hubitat. Is there a nice way to keep a given home assistant entity_id and point it at new hubitat device id so I don’t have to swap out all the things in my HA automations?

I’m having a bit of a rough time getting this working correctly. It seems that my set-up still needs some tweaking to get the posts from HE into HA.

I’m running HA on my Unraid server as a docker. I’m using Lets Encrypt for reverse proxy using my own domain. This is for the ssl cert to allow me to use my own Alexa skill.

HE is sitting on a separate IoT vlan from the Unraid Box.

I’m able to connect the integration and control lights and switches within HA no issue. However any statuses from HE aren’t posting to HA. All sensors and even manual switch presses are reporting their state when HA came up.

The only way I’ve found to get this working correctly is removing HA from the UnRaid Proxynet, but that obviously kills my Alexa integration. I’ve also tried moving HE to the same vlan as the server keeping HA in the proxy and same issue. I’ve tried my domain as the post server, no help. A bit lost on other options.

There isn’t an automated way, but you can update entity ID’s through the UI in HA. Remove the old entities, then update the IDs of the new entities, and your automations won’t know the difference.

1 Like

At startup, the integration starts an HTTP server to receive event updates from Hubitat. The integration pings the Hubitat hub, and tells Hubitat to POST event updates to the address of the interface the integration used to reach the Hubitat hub.

If that doesn’t work, you can manually set (via the integration’s options) the address and port that Hubitat should post events to. Note that if you provide a manual address (of the format http(s)://address:port), you’ll need to specify the port as well (otherwise the integration will choose a random port, which likely won’t agree with the port in http(s)://address:port). The event server’s port will also need to be opened in a firewall if one is active between Hubitat and HA.

Something is getting blocked someplace I’ll have to keep digging. It’s probably something simple I’m missing.

I’ve tried the server IP, the docker IP, the domain. I have a firewall rule in place between the vlans, port forward set-up. I’m leaning towards something to do with my Let’s Encrypt docker and how it’s passing the data, need to keep digging on it.

One thing I noticed when entering a manual address and port, the port wouldn’t show up on the HE side, just the manual IP.

Hmmm…so you entered the manual address in the integration options as https://aaa.bbb.ccc.ddd:pppp, but in the Maker API app in Hubitat you only saw https://aaa.bbb.ccc.ddd for the URL to send events to?

So I was setting the Event Server as IP and Event Port, as the Port. seems the Event Server needs to be IP:Port and then the Port set.

Either way I’m still having issues, I think it’s the Proxy that is the issue, if I move the Docker Container out of the Proxy net on my Unraid box everything is working fine.

The event server address needs a port (unless it happens to be using port 80), and the the separate port value also needs to be set. That doesn’t happen automatically because they don’t have to be the same port (like, a router could be port mapping some external port to a different internal port).

Figured out the issue, I had switched over to NginX Proxy Manager, and the settings weren’t holding and it was using different ports then I had set within it’s settings.