Custom Component: Hubitat

@jason0x43, the latest firmware hotfix adds support for set Color maps. Thought you would be interested :wink:

https://community.hubitat.com/t/release-2-2-0-available/38487/5

1 Like

Hello all i am a newb to HA and I am having trouble with getting the settings right in Configuration>+ >Hubitat. I believe everything is setup correctly in the HACS. I am using a synology NAS and the setup was smoother than i thought it was going to be but I am snagged on the configuration of the Hubitat settings inside HA.

I know my Hub Address but for the 2nd entry I am not certain I have the correct syntax for the Maker API app ID or the 3rd entry the Maker API access Token. The error I am getting after trying is “The access token is invalid”

For the second entry The Get All Devices URL is: http://192.168.1.29/apps/api/396/devices?access_token=4d7720d6-9077-49da-8e99-f87122a482ae

For the 3rd entry I will post a snip of my Maker API tokens.

I read in the setup that the 4th entry the Port will be setup automatically, if this is not true then any help there would be appreciated.

TIA for any assistance.

From your example use the following:

  • Line 1 - Hub address: 192.168.1.29

  • Line 2 - Maker API app ID: 396

  • Line 3 - Maker API access token: 4d7720d6-9077-49da-8e99-f87122a482ae

2 Likes

That usually indicates that HA isn’t receiving events from Hubitat. Do other devices behave properly?

Thanks for the help, I was thinking I needed forward slashes and URL’s… newb-non-coder reporting for duty… Just added my bar light to my dashboard, this is an rgb strip, very impressed with the controls, see pic.! Thanks again!

bar light|240x500

1 Like

Update: I’ve removed and readded the device in Hubitat and restarted HA. I can turn on the device with the UI, but not off. I can turn it off and on with Alexa and Siri. Once its off, the UI will turn it back on again.

How are Alexa and Siri interfacing with the device? Like, is that also running through Home Assistant, or are they connecting in other ways? (Hubitat’s Alexa integration, homebridge, etc)

i went back and checked at and it had the echo integration enabled. disabling it now breaks that voice control, so your integration only seems to be able to power on and not power off swidget zwave inserts.

Hmmm…interesting. There’s nothing device specific about the integration – if it’s working with some of your switches from Hubitat, it should be working with them all.

The first thing to check is what happens when you flip a switch in HA. Make sure debug logging is enabled for the hubitat integration – in your configuration.yaml:

logger:
  default: info
  logs:
    custom_components.hubitat: debug
    hubitatmaker: debug

Flip a switch, then look at both your HA logs and your Hubitat logs. The expected sequence of events should look like

  1. HA sends a command
  2. Hubitat receives the command and does the thing
  3. HA receives an event from Hubitat saying the thing was done

Turn on with UI button:
2020-04-26 19:27:08 DEBUG (MainThread) [custom_components.hubitat.switch] Turning on Towel Warmer with {}
2020-04-26 19:27:08 DEBUG (MainThread) [hubitatmaker.hub] Sending command on() to 67
2020-04-26 19:27:08 DEBUG (MainThread) [custom_components.hubitat.device] sent on to 67
Press again with button
2020-04-26 19:27:47 DEBUG (MainThread) [custom_components.hubitat.switch] Turning on Towel Warmer with {}
2020-04-26 19:27:47 DEBUG (MainThread) [hubitatmaker.hub] Sending command on() to 67
2020-04-26 19:27:49 DEBUG (MainThread) [custom_components.hubitat.device] sent on to 67

Use Hubitat to power off:
2020-04-26 19:27:54 DEBUG (MainThread) [hubitatmaker.hub] Received event: {‘name’: ‘switch1’, ‘value’: ‘off’, ‘displayName’: ‘Towel Warmer’, ‘deviceId’: ‘67’, ‘descriptionText’: None, ‘unit’: None, ‘type’: None, ‘data’: None}
2020-04-26 19:27:54 DEBUG (MainThread) [hubitatmaker.hub] Updating switch1 of 67 to off
2020-04-26 19:27:58 DEBUG (MainThread) [hubitatmaker.hub] Received event: {‘name’: ‘power1’, ‘value’: ‘0’, ‘displayName’: ‘Towel Warmer’, ‘deviceId’: ‘67’, ‘descriptionText’: None, ‘unit’: ‘W’, ‘type’: None, ‘data’: None}
2020-04-26 19:27:58 DEBUG (MainThread) [hubitatmaker.hub] Updating power1 of 67 to 0

Turn back on with a UI switch
2020-04-26 19:28:02 DEBUG (MainThread) [custom_components.hubitat.switch] Turning on Towel Warmer with {}
2020-04-26 19:28:02 DEBUG (MainThread) [hubitatmaker.hub] Sending command on() to 67
2020-04-26 19:28:02 DEBUG (MainThread) [custom_components.hubitat.device] sent on to 67
2020-04-26 19:28:03 DEBUG (MainThread) [hubitatmaker.hub] Received event: {‘name’: ‘switch1’, ‘value’: ‘on’, ‘displayName’: ‘Towel Warmer’, ‘deviceId’: ‘67’, ‘descriptionText’: None, ‘unit’: None, ‘type’: None, ‘data’: None}
2020-04-26 19:28:03 DEBUG (MainThread) [hubitatmaker.hub] Updating switch1 of 67 to on
2020-04-26 19:28:06 DEBUG (MainThread) [hubitatmaker.hub] Received event: {‘name’: ‘power1’, ‘value’: ‘47’, ‘displayName’: ‘Towel Warmer’, ‘deviceId’: ‘67’, ‘descriptionText’: None, ‘unit’: ‘W’, ‘type’: None, ‘data’: None}
2020-04-26 19:28:06 DEBUG (MainThread) [hubitatmaker.hub] Updating power1 of 67 to 47

Hmmmm…I think I see at least part of the issue. The device is using a switch1 attribute for its switch state rather than the switch attribute, so the integration will never report the proper state of the switch (it’s always looking at switch, not switch1). I’ll need to update the integration to handle that case.

I’m not sure what the difference is between the “turn on with button” and “turn on with switch” cases. Both of them are sending the on command to the device, but the “turn on with button” case doesn’t seem to be receiving the update event, while the other does.

Huh, switdgets… Interesting…

Edit: Expensive… but neat…

1 Like

True

Too true

2 Likes

I really like the idea but I’ve been living the ESP life lately, seeing these prices just makes me cringe at what some of these other devices cost. After everything going on in the world I’d gladly pay middle of the road for some US Made, or at least US Assembled products.

@jason0x43 I was wondering what the correct thing to do is, when, say, you add a new device to Hubitat, enable it in the allowed devices in the Maker API app (in Hubitat), to get it to show up in the list of devices HA sees via this custom component. I’ve added a couple more zigbee plugs, and Hubitat sees them and has them enabled in the Maker API app, but not sure how to get Home Assistant to pick them up.

Thanks again for this fantastic component. This has enabled me to slowly move to Home Assistant in small bites, while keeping my current Hubitat automations intact.

1 Like

You just need to restart Home Assistant. Currently new devices are only picked up during initialization.

1 Like

Thank you so much Jason! That makes good sense.

I backed them on Kickstarter and slowly added more. Most recently, I found 17 on eBay for $13 each, so I loaded up.

1 Like

Has anyone run into an issue where a device is found and added into HA, but it doesn’t change states in HA. The device in question is a z-wave motion sensor. I see the motion activity in Hubitat but HA doesn’t show the same state.

If only one device is failing to update in HA, the device may be reporting its state on a non-standard attribute. For a motion sensor, the standard attribute is motion. If the device is using something else (e.g., motion1), that currently isn’t handled by the integration.

If all Hubitat devices are failing to update in HA, Hubitat may not be able to send messages to Home Assistant (it’s on a different network, blocked by a firewall, etc.).