Custom Component: Hubitat

I’d like to throw another vote into supporting energy statistics.

1 Like

@jason0x43 Does the ‘sensor.hub_hsm_status’ entity pull its status in real-time? I’d like to use it but noticed I have to restart HA for it to pull whatever the current status is within HE.

As an example, I’m using the ‘hubitat.set_hsm’ to control HSM but the status entity doesn’t change unless I restart HA. Thoughts?

Check to see if the “Include location events” checkbox is checked in Hubitat.

1 Like

That did it! For some reason, I kept that setting off. Thank you for the quick reply!!

Hi,
I am new here, but I’ve been reading up and learning a lot from this thread. I am finding myself with a problem that someone described over a year ago, but I didn’t see a conclusion or resolution about it.

I can see all my HE devices as entities in HA, but everytime I toggle a switch in the HA ui, it holds for a couple of seconds and then reverts back. This is happening with Inovelli dimmer switches (all of them).

If I turn on a switch from the HA interface, this is what I get in the HA logs:

2021-10-19 22:13:04 DEBUG (MainThread) [custom_components.hubitat.light] Turning on Living Room Dimmer with {}

2021-10-19 22:13:04 DEBUG (MainThread) [hubitatmaker.hub] Sending command on(None) to 22

2021-10-19 22:13:04 DEBUG (MainThread) [custom_components.hubitat.device] sent on to 22

And this is what I get on the HE side:

[app:115](http://192.168.1.102/logs#app115)2021-10-19 10:13:11.484 pm [debug](http://192.168.1.102/installedapp/configure/115)device event: {"name":"lastActivity","value":"2021 Oct 19 Tue 10:13:11 PM","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":null,"data":null}

[app:115](http://192.168.1.102/logs#app115)2021-10-19 10:13:11.481 pm [debug](http://192.168.1.102/installedapp/configure/115)device event: {"name":"power","value":"2","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":"W","type":null,"data":null}

[dev:22](http://192.168.1.102/logs#dev22)2021-10-19 10:13:11.449 pm [debug](http://192.168.1.102/device/edit/22)Living Room Dimmer: MeterReport(meterType: 1, precision: 1, scale: 2, size: 4, meterValue: [0, 0, 0, 24], rateType: 1, deltaTime: 0, previousMeterValue: [])

[app:115](http://192.168.1.102/logs#app115)2021-10-19 10:13:08.904 pm [debug](http://192.168.1.102/installedapp/configure/115)device event: {"name":"switch","value":"on","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":"digital","data":null}

[app:115](http://192.168.1.102/logs#app115)2021-10-19 10:13:08.891 pm [debug](http://192.168.1.102/installedapp/configure/115)device event: {"name":"lastActivity","value":"2021 Oct 19 Tue 10:13:08 PM","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":null,"data":null}

[dev:22](http://192.168.1.102/logs#dev22)2021-10-19 10:13:08.864 pm [debug](http://192.168.1.102/device/edit/22)Living Room Dimmer: BasicReport(value:50)

I’ve reset both the HE hub and HA a couple of times and tried re-installing the integration, with the same result. Any tips on what else can I do to fix this, or to continue troubleshooting?

Thanks!

Sounds to me like the HE MakerAPI app’s URL to POST updates back to your HA hub is not configured correctly. Just a guess.

As @ogiewon says, the issue is that Hubitat can’t get messages back to HA. The issue is usually that HA is running somewhere that isn’t directly accessible to Hubitat.

When the HA integration starts up, it sets the POST URL in the Maker API instance on Hubitat. By default, it uses the address of the HA machine to create the POST URL. If HA is running in a VM or behind a proxy or something, Hubitat isn’t going to be able to reach that URL.

The solution is to go into the Hubitat integration options in HA and set the event server URL to something that’s accessible to Hubitat, such as the address of the physical machine that HA is running on. You’ll probably also need to map a port on your physical machine to whatever HA is running in (VM or container).

1 Like

Thanks!
I will try to debug further with that info, but I have HA running on a RPi4 in the same network, and I can successfully ping both the HE hub and the RPi4’s IP from other computers in the network.
:thinking:

If I look at the logs for Maker API on the HE side, I get this after I activate one of the switches (from within HE)

[app:128](http://192.168.1.102/logs#app128)2021-10-22 12:49:56.366 am [debug](http://192.168.1.102/installedapp/configure/128)device event: {"name":"lastActivity","value":"2021 Oct 22 Fri 12:49:56 AM","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":null,"data":null}

[app:128](http://192.168.1.102/logs#app128)2021-10-22 12:49:53.754 am [debug](http://192.168.1.102/installedapp/configure/128)device event: {"name":"switch","value":"on","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":"digital","data":null}

[app:128](http://192.168.1.102/logs#app128)2021-10-22 12:49:53.735 am [debug](http://192.168.1.102/installedapp/configure/128)device event: {"name":"lastActivity","value":"2021 Oct 22 Fri 12:49:53 AM","displayName":"Living Room Dimmer","deviceId":"22","descriptionText":null,"unit":null,"type":null,"data":null}

It just occurred to me…

I do have another Maker API instance in HE, sending events to Node Red. And that one seems to work correctly. I’m guessing it’s possible to have more than one instance of Maker API running at the same time, but wonder if that could be part of the problem?

I have three Maker API apps running on my hub. No issues.

Thanks again. I started over and now it works. I think it was missing a port in the IP address on the HE side.

The only thing I recall doing differently is that I didn’t give HA an explicit “Event server URL” while setting it up. I left that field empty, but it still added its own IP under “URL to POST device events to” in the HE Maker API instance. The only difference is that now it added a port, too.
If I remember correctly, I had previously given it an IP but no port, and in that case it seemed to fill just the IP in the Maker API instance, without a port.

Either way, things seem to be working now. Thanks for the tips!

1 Like

I’ve done a fresh start on my install (long story) and am trying to get this one going again but I cannot sort why it’s installed but won’t integrate. I’ve utilized the hacs and manual method and see the folder inside custom_components both times … when I go to add the integration there’s nothing connected to hubitat. Looks like it’s installed via the hacs ui …

What do you mean by “there’s nothing connected to Hubitat”?

I mean I cannot see it / add it etc. I can’t find where to add the Maker API bit

unbelievably … hubitat just finally became available to add. wow, that took a while. All set!

Glad to hear it!

Hello, was setColor added to the integration or can it only be executed through webhook? I couldn’t get it working on my Inovelli Inovelli LZW45 Light Strip.

Edit: I think it updated but I need to check my syntax

Edit 2: Got it working. Here is the proper syntax for the argument:

Has anyone else seen a problem where a thermostat that’s passed into HA will have its temperature wrap around once it gets down to ~50F or so? I have multiple thermostats in HE (both physical and virtual), and all of them show this behavior. If the sensed temperature gets below 50F or so, it wraps around to ~120F. In some cases, even the reported setpoint wraps around. I’m trying to track down where this issue is coming from, and I suspect it might be from this integration, but I’m not positive.

Edit to add a history graph showing the issue:

Our Centralite Pearl Thermostat connected via Hubitat doesn’t do that. Of course it hasn’t called for heat lately since it’s zone controller died (it should be fixed sometime after Thanksgiving) in the meantime our downstairs zone is heating the whole house.

I think so! I wasn’t able to exactly figure out when that happened, but your explanation makes enough sense and seems consistent with what I remember. Occasionally I would see temperatures as reported around 120F, even though the real temperature was nowhere close to that. Looking at my recent history, it does indeed seem to happen when it should probably be reporting around 50 (I know it might be hard to tell from the image, but the closest valid reading on either side of the spike is 50.5 for me):

image

In my case, I’m using a Z-Wave thermostat, but since it happens with a virtual device for you, I doubt that the underlying protocol has any bearing. My first assumption was some C-to-F conversion (or vice versa) error, but the values where it happens doesn’t make any sense to me…

In any case, my thermostat is rarely at this temperature long enough to bother me (on Home Assistant or in real life :cold_face:) and I figured it was just something odd with my setup, but I figured I’d share this since you brought it up and it appears I’m not!