I’m really excited about the development of this integration as well!
I haven’t been able to get @mecolmg’s version working either. I have the recessed RGBW lights as well, and I’m looking forward to finally being able to control the color of them from home assistant.
Since I have mine working, I was not planning on making updates. I do not have any other devices besides the PIR dimmer, so will need people to contribute. You can either DM me your user/password and I can try to figure out how to set the RGBW. Or if you have python, you can edit/run this script (Hubspace-Homeassistant/TestHubspace.py at 21eb2951791f662c55a0edb2d513e185e4744d92 · jdeath/Hubspace-Homeassistant · GitHub) and DM me the output. Be good if you run it with the lights in different states (Ie, red, blue, green, white only). No guarantee when I’ll get to it and testing will be hard without the device.
Hmm, if i had to guess, it’s probably the combination of FunctionClass and FunctionInstance differs per-device. I’m making some changes now which will parse the function definitions we get from the API and use those to determine and update the state. I’ll update here once that’s working and checked-in.
Like @jaaem suggested though, I’m only able to test this with the Hubspace device I own (ceiling fan), so any output you can retrieve from his TestHubspace script would be very helpful in ensuring any changes will actually work for you. Keep in mind though, there is sensitive data which can be outputted by that script, so you may want to DM the output and/or scrub it before posting.
If your model supports RGBW, please post or DM me the model. This can be found from my script or from the latest version of my integration. It should show the model in the state attributes in the entity listed in developers tools.
I keep getting this error after I have downloaded the hubspace and put it into my config folder. I have added my hubspace username and password into configuration .yaml. Any help is appreciated.
Setup failed for custom integration hubspace: No setup or config entry setup function defined.
Logger: homeassistant.components.light
Source: custom_components/hubspace/hubspace.py:156
Integration: Light (documentation, issues)
First occurred: 2:46:02 PM (1 occurrences)
Last logged: 2:46:02 PM
Error while setting up hubspace platform for light
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 249, in _async_setup_platform
await asyncio.shield(task)
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/hubspace/light.py”, line 53, in setup_platform
entities = [HubspaceLight(username, password, friendlyname) for friendlyname in config.get(CONF_FRIENDLYNAMES)]
File “/config/custom_components/hubspace/light.py”, line 53, in
entities = [HubspaceLight(username, password, friendlyname) for friendlyname in config.get(CONF_FRIENDLYNAMES)]
File “/config/custom_components/hubspace/light.py”, line 80, in init
[self._childId, self._model] = hs.getChildId(self._refresh_token,self._accountId,self._name)
File “/config/custom_components/hubspace/hubspace.py”, line 156, in getChildId
model = lis.get(‘description’).get(‘device’).get(‘model’)
AttributeError: ‘NoneType’ object has no attribute ‘get’
Hmm. Not sure. Maybe pair down the list to just one light, maybe bathroom. Looks like it is login in, but getting tripped up on the name of one of your lights.
Also, if can run python, there is a test script in the GitHub, that will allow easier trouble shooting. Try running that if running just one light doest work.
Ok, so I went down to 1 light (switch), and still got the same error, I changed the “one item” between a few different switches, I get the error on most of them except ‘Laundry’. ‘Laundry’ doesn’t produce an error but it also does not show in the device list or on the dashboard…
Please post the model numbers of the versions you go to work read only, let us start there. I found model ‘AL-TP-RGBCW-60-2116, AL-TP-RGBCW-60-2232’: need another field sent which the dev version does. Those might too.
Also, please try the DEV branch, as that has the latest fixes. Just go to Github, switch to dev, and download the light.py and hubspace.py.
Basically, if it is a model I don’t have, you may need to run the python script to do a dump, DM me the output, and I can try to figure out what is going on.
So I learned that you can’t have a Space in the Name. I update the Names and got these to Load as entities only and Read only.
Friendlynames - Model
-‘Guest_Bath’ - HPDA311CWB
‘Girls_Bath’ - HPDA311CWB
‘Laundry’ - HPDA311CWB
‘Mud_Room’ - HPDA311CWB
‘Master_Closet’ - HPDA311CWB
‘Fireplace_Left’ - 50291, 50292
‘Fireplace_Right’ - 50291, 50292
‘Fireplace_Outlet’ - HPKA315CWB
‘Master closet’ - Error Line 157 hubspace.py:157 UnboundLocalError: local variable ‘model’ referenced before assignment
‘Mud Room’ - Error Line 156 hubspace.py:156 AttributeError: ‘NoneType’ object has no attribute ‘get’
That unique ID could be a new thing to add in home assistant. I’ll look into it. Try the new dev branch, I just put your model numbers in to require a primary flag. Let’s see if that works. Also, try just one light, maybe that will avoid the unique ID issue
Debug info is included in the state attributes. If you cannot get a light to work, but it shows up in your UI, PM me the debug info field and the model number (with light both on and off). From there, I should be able to figure out what is going on and add your model number. Besure to PM, because may be “personal info”, such as the device MAC address.
In light.py you can set HUBSPACEDEBUG = False near the top of the file, if you don’t want the debug information, but want the latest features
Easist way to get the dev branch version is go to the github, switch branch to dev (near the top left that says “main”), and download light.py and hubspace.py
I added the new Dev branch, and all my Items were added as entities correctly from what I can see, Still playing with it. they are no longer Read only.
I was going to do just one item as a test,… but figure I would edit the config yaml if it didn’t pull then in correctly and go from there.
I’ll PM you a few example for your reference.
Also @jaaem how do I “buy you a coffee”? you have a link? I appreciate making the update. with Insteon going belly up this will help a lot.
UPDATE:
Status - Model - Description -
Works (On/Off, Brightness) - HPDA311CWB -CE(Brand) Single Pole Smart Dimmer w/ Motion Sensor
Works (On/Off, RGB) - 50291, 50292 - CE(Brand) 4 in. Selectable CCT Ultra Slim Integrated LED Recessed Light Kit
Does not Respond - HPKA315CWB - CE (Brand) 15 Amp 120-Volt Smart Hubspace Tamper Resistant Duplex Outlet