Home Assistant

Has anyone had any luck getting the integration for Home Assistant (found here: Custom Component: Hubitat - Custom Components - Home Assistant Community) to work? When trying it, I get the following error:

2020-04-07 20:33:53 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration hubitat: cannot import name 'InvalidInfo' from 'hubitatmaker' (/usr/local/lib/python3.7/site-packages/hubitatmaker/__init

__.py)

2 Likes

I think this question would be more appropriate in the thread you linked to in the HA forum. I would post the same error over there. That being said.... @jason0x43.

1 Like

From the error, it looks like you're using an older version of the integration. Usages of InvalidInfo from hubitatmaker were removed in v0.4.10, about 6 weeks ago. The current version is 0.4.16.

3 Likes

Thank you both for your responses. I had planned on posting to the other forum, but since I wanted to post here first to get it some attention and to see if anyone here had actually seen the issue.

@jason0x43: I downloaded the hacs-hubitat integration. Do I just overwrite the scripts from the hubitatmaker or remove the hacs-hubitat integration?

And to answer your question... Yes, I am using it and it works well. Jason has created a solid integration between the two systems.

2 Likes

If installing manually (without HACS), remove everything in <config>/custom_components/hubitat and replace it with the contents of <hacs-hubitat>/custom_components/hubitat, including the .translations directory, then restart Home Assistant.

You shouldn't need to manually do anything with the hubitatmaker package. That package is a dependency of the hubitat integration, and Home Assistant will take care of installing the required version.

1 Like

I set this up the other day just to play around with HASS. The installation through HACS couldn't have went any smoother and all of my hubitat devices showed up within seconds.

2 Likes

hmm, that is interesting. I copied the hacs-hubitat installation directly from Git (manually) and then copied the files over. That is the one that I got the InvalidInfo error from. Perhaps the dependency with hubitatmaker didn't work when I manually copied off Git?

I wanted to do the install via the Marketplace function, but there isn't one in my installation.

I removed and reinstalled pulling it down through Git. So far so good without error.

Hmmm...maybe you had an older commit checked out in the repo. That error was happening because the integration code was older than the hubitatmaker version that was installed. But who knows? ¯\_(ツ)_/¯

Hmmm...which Marketplace did you mean? The integration isn't available through Home Assistant's Add-on Store; that's for a different type of extension. It also won't show up by default in the HACS listing, because I haven't added it there yet. There are instructions in the project README to add the repo to HACS, though (which is nice, because then HACS can manage updates, too).

1 Like

I added one device just to test with, my ceiling fan, when I click it the switch goes right back off again. Any idea why that would be the case?

Same experience with Ikea Plug.
Same time no-name "smart zigbee 3.0 light controller" and aliexpress plug behave as they should.

Does the switch actually turn back off again, or is it just the toggle in HA that turns on and then back off again?

In my experience it varies. 99% of the times HA turns on and back off again with nothing happening at the switch, though there are times when the switch will actually turn on but HA just shows it going on and off.

Same with my Ikea plugs

When a switch changes and then changes back in HA, it usually means that HA isn't receiving device events from Hubitat. If the switch itself isn't actually toggling, though, it could also mean that HA can't send commands to Hubitat.

When you flip a switch to "on" in HA, HA updates the switch's visible state to "on", and the integration sends an "on" command to Hubitat. Hubitat turns on the switch, then sends a state update event back to the integration in HA, which updates the internal state of the switch in HA to "on". A couple seconds after you toggled the switch, HA goes back and double checks the HA device's state; if it's "on", the UI toggle stays on. If, however, no event was received from Hubitat, the device's internal state will still be "off", and HA will flip the UI toggle back to "off".

The best way to diagnose things from the HA side is to enable debug logging for the integration, interact with a troublesome device, and see what the log shows. In your configuration.yaml, add

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

Then watch <config>/home-assistant.log.

I do appear to be able to interact with the devices, just not consistently or get an accurate status. The one I had started with was a ceiling fan, then I added a dimmer and just to make sure the problem wasn't with a variable switch I added a basic on/off switch. For some reason, the configuration.yaml update for the logging doesn't seem to have had any effect at all on the logs showing in <config>/home-assistant.log. Here is my yaml:

homeassistant:                                                                                                                                                                                                                
  # Name of the location where Home Assistant is running                                                                                                                                                                      
  name: Home                                                                                                                                                                                                                  
                                                                                                                                                                                               
  # Impacts weather/sunrise data (altitude above sea level in meters)                                                                                                                                                         
  elevation: 0                                                                                                                                                                                                                
  # metric for Metric, imperial for Imperial                                                                                                                                                                                  
  unit_system: imperial                                                                                                                                                                                                       
                                                                                                                                                                                           
  # Customization file                                                                                                                                                                                                        
  customize: !include customize.yaml                                                                                                                                                                                          
                                                                                                                                                                                                                          
# Show links to resources in log and frontend                                                                                                                                                                                 
introduction:                                                                                                                                                                                                                 
                                                                                                                                                                                                                          
# Enables the frontend                                                                                                                                                                                                        
frontend:                                                                                                                                                                                                                     
                                                                                                                                                                                                                          
# Enables configuration UI                                                                                                                                                                                                    
config:                                                                                                                                                                                                                       
                                                                                                                                                                                                                          
http:                                                                                                                                                                                                                         
  # Secrets are defined in the file secrets.yaml                                                                                                                                                                              
  # api_password: !secret http_password                                                                                                                                                                                       
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.                                                                                                                                                
  # base_url: example.duckdns.org:8123                                                                                                                                                                                        
                                                                                                                                                                                                                          
# Checks for available updates                                                                                                                                                                                                
# Note: This component will send some information about your system to                                                                                                                                                        
# the developers to assist with development of Home Assistant.                                                                                                                                                                
# For more information, please see:                                                                                                                                                                                           
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/                                                                                                                                                           
updater:                                                                                                                                                                                                                      
  # Optional, allows Home Assistant developers to focus on popular components.                                                                                                                                                
  # include_used_components: true                                                                                                                                                                                             
                                                                                                                                                                                                                          
# Discover some devices automatically                                                                                                                                                                                         
discovery:                                                                                                                                                                                                                    
                                                                                                                                                                                                                          
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:                                                                                                                                                                                                                 
                                                                                                                                                                                                                          
# Enables support for tracking state changes over time                                                                                                                                                                        
history:                                                                                                                                                                                                                      
                                                                                                                                                                                                                          
# View all events in a logbook                                                                                                                                                                                                
logbook:                                                                                                                                                                                                                      
                                                                                                                                                                                                                          
# Enables a map showing the location of tracked devices                                                                                                                                                                       
map:                                                                                                                                                                                                                          
                                                                                                                                                                                                                          
# Track the sun                                                                                                                                                                                                               
sun:                                                                                                                                                                                                                          
                                                                                                                                                                                                                          
# Weather prediction                                                                                                                                                                                                          
sensor:                                                                                                                                                                                                                       
  - platform: yr                                                                                                                                                                                                              
                                                                                                                                                                                                                          
# Text to speech                                                                                                                                                                                                              
tts:                                                                                                                                                                                                                          
  - platform: google_translate                                                                                                                                                                                                
service_name: google_say                                                                                                                                                                                                  
                                                                                                                                                                                                                          
# Cloud                                                                                                                                                                                                                       
cloud:                                                                                                                                                                                                                        
                                                                                                                                                                                                                          
logger:                                                                                                                                                                                                                       
  default: info                                                                                                                                                                                                               
  logs:                                                                                                                                                                                                                       
hubitatmaker: debug                                                                                                                                                                                                       
homeassistant.custom_components.hubitat: debug                                                                                                                                                                            
                                                                                                                                                                                                                          
group: !include groups.yaml                                                                                                                                                                                                   
automation: !include automations.yaml                                                                                                                                                                                         
script: !include scripts.yaml

Make sure the hubitatmaker and homeassistant.custom_components.hubitat lines are indented properly:

  logs:
    hubitatmaker: debug
    homeassistant.custom_components.hubitat: debug

Also, you'll need to restart HA after making the changes (if you haven't already).

I changed the Default to debug, here are the logs once I changed it (I removed phone data and such that cluttered it up):

2020-04-12 16:14:09 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140354822129808] Received {'type': 'call_service', 'domain': 'light', 'service': 'turn_off', 'service_data': {'entity_id': 'light.kitchen_work_lights'}, 'id': 33}                                                          
2020-04-12 16:14:09 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_off, service_data=entity_id=light.kitchen_work_lights>                                                                                                                                         
2020-04-12 16:14:09 DEBUG (MainThread) [custom_components.hubitat.light] Turning off Kitchen Work Lights                                                                                                                                                                                                                   
2020-04-12 16:14:09 DEBUG (MainThread) [custom_components.hubitat.device] sent off to 41                                                                                                                                                                                                                                   
2020-04-12 16:14:09 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140354822129808] Sending {'id': 33, 'type': 'result', 'success': True, 'result': {'context': Context(user_id='160d73e52bac4a63b8a8226283661393', parent_id=None, id='8ae18e7ffa164b259ad000361149482c')}}                   
2020-04-12 16:14:10 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/webhook/aaf9d766cfb0223dca51787e6180bd6bdd484d057a396ab9a760d6527c851681 to 10.16.1.100 (auth: False)                                                                                                                             
2020-04-12 16:14:10 DEBUG (MainThread) [homeassistant.components.webhook] Handling webhook POST payload for aaf9d766cfb0223dca51787e6180bd6bdd484d057a396ab9a760d6527c851681                                                                                                                                                                                                                                                                                                                                                 
2020-04-12 16:14:11 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/webhook/aaf9d766cfb0223dca51787e6180bd6bdd484d057a396ab9a760d6527c851681 to 10.16.1.100 (auth: False)                                                                                                                             
2020-04-12 16:14:11 DEBUG (MainThread) [homeassistant.components.webhook] Handling webhook POST payload for aaf9d766cfb0223dca51787e6180bd6bdd484d057a396ab9a760d6527c851681

Download the Hubitat app