Add support for Hubspace by Afero

I PMed you debug info for several models.

Thanks. Logs helped. Check your PM and let me know if fixed

I just discovered this integration and I want to say thank you so much for all the hard work and dedication going into this project. I’ve been reviewing the code and I can’t seem to find much in regards to the motion sensor on the PIR light switch.

Two things I’d like to figure out how to do and maybe with your help we can!

  1. I’d like to be able to change the sensor mode either manually in HA or triggered by an event or scene:
    In Hubspace, it is listed as Off, Occupancy, or Vacancy. In HA, Manual (off), Automatic (occupancy), or Auto-off (vacancy).

  2. It would be nice to be able to use the PIR as a trigger as well.
    I noticed that there is:
    functionClass: pir-sensitivity
    functionInstance: pir
    value: 0

So HA is picking up some data. I also “listen to events” in the developer tools and found what I think HA is picking up something from the sensor, but I couldn’t make much sense of it.

Can anyone shed any light on taking advantage of the PIR in HA and/or changing the mode from HA?

I’m happy to help by providing data. While I am learning python and can generally follow the code, I don’t quite of the knowhow/experience to work on the coding much, but I can certainly provide data, logs, and maybe even a little debugging.

Glad you enjoy the integration.

  1. I think is possible, but I haven’t looked into how to set a “mode” in a homeassistant light integration. If you figure that out, I think I could send a command to do so. Perhaps it is a “service” call, which pushes an arbitrary field and setting. That could be very useful in testing as well. I just don’t know how to accomplish it in homeasssistant

  2. The PIR itself cannot be accessed by the API. I have looked into it before.

In regards to “mode”, here is some info:

          - functionClass: grace-period
            functionInstance: grace-period
            value: 15
            lastUpdateTime: 1665096853636
          - functionClass: auto-off-timer
            functionInstance: auto-off
            value: 300
            lastUpdateTime: 1665096853366
          - functionClass: fade-duration
            functionInstance: fade-off
            value: 0
            lastUpdateTime: 1665096854550
          - functionClass: brightness
            value: 100
            lastUpdateTime: 1665172403362
          - functionClass: trim
            functionInstance: high-trim
            value: 100
            lastUpdateTime: 1665096854156
          - functionClass: dark-threshold
            functionInstance: dark-threshold
            value: 30
            lastUpdateTime: 1665126352614
          - functionClass: trim
            functionInstance: low-trim
            value: 20
            lastUpdateTime: 1665096853952
          - functionClass: bright-threshold
            functionInstance: bright-threshold
            value: 55
            lastUpdateTime: 1665126353166
          - functionClass: power
            value: "off"
            lastUpdateTime: 1665172701855
          - functionClass: fade-duration
            functionInstance: fade-on
            value: 0
            lastUpdateTime: 1665096854347
          - functionClass: led-configuration
            value: blink
            lastUpdateTime: 1665118482745

#Here is where you set the mode:  Manual (off), Automatic (occupancy), or Auto-off (vacancy)

         - functionClass: sensor-mode
            value: automatic
            lastUpdateTime: 1665131412622
          - functionClass: dark-determination
            value: "off"
            lastUpdateTime: 1665126129152
          - functionClass: pir-sensitivity
            functionInstance: pir
            value: 20
            lastUpdateTime: 1665132134714```

What other kind of data can you use?

It is not the hubspace data (I actually have this device, so that is easy). I have no idea how to make homeassistant set a mode/effect in a light. Open to help, code is on github for PRs.

Hello,

I had this working and for the last week or so I’ve been having issues. I removed the hubspace integration a few times and reconfigured it with no change in results.

Here’s an error I’m receiving:

Logger: homeassistant.components.light
Source: util/color.py:623
Integration: Light (documentation, issues)
First occurred: 3:18:32 PM (2 occurrences)
Last logged: 3:18:32 PM

Error adding entities for domain light with platform hubspace
Error while setting up hubspace platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 605, in _async_add_entity
    capabilities=entity.capability_attributes,
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 914, in capability_attributes
    data[ATTR_MIN_COLOR_TEMP_KELVIN] = self.min_color_temp_kelvin
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 886, in min_color_temp_kelvin
    return color_util.color_temperature_mired_to_kelvin(self.max_mireds)
  File "/usr/src/homeassistant/homeassistant/util/color.py", line 623, in color_temperature_mired_to_kelvin
    return math.floor(1000000 / mired_temperature)
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

Can anybody help me figure out why suddenly I’m having issues?

my friendly name is exact with no spaces and no common names:

    friendlynames:
      - 'Shower1Light'
      - 'Shower2Light'

Someone added capability for color temp. Perhaps your model does not support it?
Look in /config/custom_compotents/light.py starting around line 180 for your model. Remove the “ColorMode.COLOR_TEMP,” part of the array for your model. Restart homeassistant and report back. I’ll update the code for your model.

At first I was like, I HAVE color temp. But then I did what you said and in looking at the app, my guess is this is rgb white.

That also makes sense why my adaptive lighting throws errors on these devices.

I removed the line you indicated and they immediately appeared in my system again.

great. What is the model so I can remove that in the code? I think color temp refers to the “white” color, so your light appears to have it in the app. Perhaps hubspace changed something.

If you set debugging: true in the integration and PM me the sensor attributes with a few different colors (white Temp 5000k and a couple others), I can try to figure it out.

I understand the rest of your request and I’ll send you a PM when I get it. On the model, I’m a little unclear. It doesn’t seem to specify this in the app and I’ve long ago thrown the box away. I compared all the model numbers in light.py to what I saw in the settings screen and I couldn’t detect any obvious cross-walks. According to the HACS integration, it says its:
50291, 50292 but I have no idea if that’s correct. Is there somewhere else I should look for the model?

Yup, that it is

1 Like

What’s the proper way to reinstall this cleanly? If I delete my hubspace folder, and remove the lines in configuration.yaml, then download again, that should work, right?

What’s the proper syntax for the friendlynames or room names on the config yaml?

I had something go wonky in my HA and none of the hubspace lights would show status or respond. I updated HA core and OS, then in my half asleep troubleshooting, I renamed my hubspace folder, then copied in the current files from github. I had copied over the lines to go into the config yaml and failed to enter my hubspace login info, which I realized the next morning after taking a fresh look.
I was able to delete original entities and went looking for the “_2” ones to rename. Only my dual outlets show up in the entities list. The dashboard shows “Entity not available” for many of them, but they do not appear in the entities list.

Yes, that is the proper sequence. Remove everything, and restart homeassistant. Then remove all the old entities.

Proper syntax is in the readme.
https://github.com/jdeath/Hubspace-Homeassistant/blob/2469cffa68729b1f2914a6d91bb33046a2903b87/README.md

Most entities will be automatically detected now, so no need to use friendly/room names, but your old syntax should still work. The _2 issue is known side effect of the latest release.

If there is still a problem, post an issue on github. The automatic discovery may still not be 100%

Is there a way to allow this integration to work with a Hubspace lock/deadbolt?

Possibly. Please follow the directions on the github to post your anonymized data and create an issue. Hopefully we can figure it out, but it might take a while. Lock/deadbolt might be very different than a light.

Thanks for getting this to work - I have about two dozen lights that are attached to Lutron switches for on/off but now I can also mess with colors, brightness and temperature from within HA - awesome! I wonder if I did something wrong though… I can see all the individual lights but not the Integration itself in nor can I see the lights in Devices in devices and services. I can see all the lights in the Entities tab though. BTW, I am only specifying the roomnames, not the friendlynames but did try with a single friendlyname as a test but still do not see the hubspace integration. Do I need to change anything?

You are not doing anything wrong, nothing to change. It does not show up in the integrations page or devices. It is not that advanced!

FYI - I have a few of the $8 Ecosmart 60W bulbs. They are discovered, but the integration cannot control color, brightness, or temperature like it can with my can LED’s. The hubspace app allows this but clearly shows they are different types of lights. Just passing this along in case you were unaware. Still a great addition - thanks again.

Does anyone have a good set of scenes for lights (i.e. all green for St Pattys day, all pink for Valentines day, RWB for 4th of July, etc.)? Just looking to have some nice scenes to choose from without having to reinvent the wheel.

Thanks