Add support for Hubspace by Afero

I don’t thing so. Keep playing with the template and review the template docs. Put the
{{ is_state('light.FrontDoor', 'on') }} into your template section of developer tools and it should change from true/false when the state changes. That needs to work first. Maybe it needs to be lowercase, try changing to {{ is_state('light.frontdoor', 'on') }} . Maybe someone else knows what is going on

Going more into it, I’ve determined that my Hubspace app does have a delay with integrations. Even with the built in integration with google assistant it’s slow to respond. So I doubt there’s much to be done about that. It’s just strange that both lights don’t have the same response time.

Hello,

I am so grateful for the smarter people out there working on things like this. I am neither new, nor seasoned with home assistant, but was duped into thinking the ecosmart bulbs were a good idea.

I have followed the install instructions, but cannot find anything anywhere in home assistant to utilize. When I try to install from HACS, it tells me I cannot, and to follow the instructions in the documentation, but the folders are already created, and the integration contents are there. I have no card under integrations, no devices, no entities. Nothing. It is as if I didn’t install it. I did make the update to my yaml.conf file.

Can anyone point me in the right direction? I feel like there is something easy I am missing.

Thank you in advance.

I am attempting to add the HPPA11AWB outlet, but I do not understand the friendlyname instructions. What exactly is the “name of the parent device?”

My configuration.yaml entry is as follows:

light:
  - platform: hubspace
    username: [email protected]
    password: password
    debug: false
    friendlynames:
      - 'SmartOutlet1'

No entity or device appears. What am I doing wrong?

Friendlyname is whatever your outlet is named in the Hubpace App. It gets complicated for fans, but not outlets. If you cannot get it to work, you probably can leave out the freindlyname and it will find it automatically.

My Driskol 60 inch fan/light is detected and gives me 2 entities light light.ceiling_fan and light.ceiling_light. Unfortunately only the fan on/off works. I only have the following added to config

light:
  - platform: hubspace
    username: [email protected]
    password: password
    debug: true

That appears to be a new model and perhaps the light works differently than others. The fans are very hard to get working. If you can, please run the https://github.com/jdeath/Hubspace-Homeassistant/blob/53657206f064dc10f6b89fb5c02a40f4110ecd9a/TestHubspace.py and post the output as a github issue (data is anonymized). If you can’t run that, PM me the entity details of the light.ceiling_light. Since you are running debug:true all the same info is there (but not anonymized).

You could try to specifying the friendlyname: “ceiling” (in your case) in the configuration and see if it works better, but my guess is it wont since a new model.

This integration will only create entities not devices as you are used to. After 5 months, I just found this out. Look for the name of the light entity from the ‘Entities’ section of the device settings. You will find it there.

Howdy folks,

I’m using the v1.91 release of jdeath’s code, and I’m running into an issue. My configuration is as follows:

# Hubspace
light:
  - platform: hubspace
    username: <snip>
    password: <snip>
    debug: true

fan:
  - platform: template
    fans:
      bedroom_fan:
        friendly_name: "master"
        value_template: "{{ states('light.ceilingfan_fan') }}"
        percentage_template: "{{ (state_attr('light.ceilingfan_fan', 'brightness') / 255 * 100) | int }}"
        turn_on:
          service: homeassistant.turn_on
          entity_id: light.ceilingfan_fan
        turn_off:
          service: homeassistant.turn_off
          entity_id: light.ceilingfan_fan
        set_percentage:
          service: light.turn_on
          entity_id: light.ceilingfan_fan
          data_template:
            brightness: "{{ ( percentage / 100 * 255) | int }}"
        speed_count: 4

This “works”- what I mean to say is on my dashboard I get the following if I expose the entities:

image

and these toggles, when I toggle them, seem to make the Hubspace app if I check it do the same thing. I haven’t ran upstairs to truly test it yet, but given the toggles in the Hubspace app seem to be great at representing current state (I’ve never had an issue with it using the app) I’m taking it as gospel for now. I’ll edit this if I see an issue testing it later tonight. so that said, I see two errors in my logs

TemplateError('TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'') while processing template 'Template<template=({{ (state_attr('light.ceilingfan_fan', 'brightness') / 255 * 100) | int }}) renders=4>' for attribute '_percentage' in entity 'fan.bedroom_fan'

and

Error while processing template: Template<template=({{ (state_attr('light.ceilingfan_fan', 'brightness') / 255 * 100) | int }}) renders=2>

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 544, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2164, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 665, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 546, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

I literally started using the project today, so I don’t know enough about templates and how they work. Does anyone have any quick ideas on how to get me on the right track? I am on…

Home Assistant 2023.5.3
Supervisor 2023.04.1
Operating System 10.1
Frontend 20230503.3 - latest

EDIT: So it looks like I can just turn the respective entities on and don’t need to mess with the template pieces, but I’m curious as to how the templating system works. I’m messing around with it and I’ve made initial progress- I’m trying to get the template to control both the fan and the light (As I’ve gotten the light to work, the real problem was I didn’t have the entity ID correct). Once I got something I’ll post it here.

Review the template docs on the homeassistant website. You can test the values in the Developer Tools->Template tab. If the value_template: or percentage_template fields don’t work there, you have an error. Like the readme of the integration specifically says, the above template is only valid if your freindlyname is “ceilingfan”. If you named it something else in the Hubspace app, you need to change the template to match. The template is 100% optional.

Yeah, if I use the proper entity the template “works” but only for the light part. Sticking with entities works for me until I get time to play with them. Thanks for the great integration, I appreciate the effort you’ve put into it.

EDIT: I Fixed it - See Below

First, thank you so much for making this - I’ve had great success with getting my fan/light combo setup using this repo. I’m trying to figure out how I can use it as part of an automation. Basically, I’ve got a smart switch (with no load) on the wall and when I turn it on I want the fan and light to turn on, and when I turn it off, I want the fan and light to turn off. Then I’ll add more advanced automations later, like double tap sets it to X, etc.

From my research, it looks like I need to set the action of the automation to call a service. That service should be hubspace.send_command, from what I gather. But that’s where it breaks down for me.

Here is what I’ve got so far under actions:

action:
  - service: hubspace.send_command
    data:
      value: "off"
      functionClass: power
    target:
      entity_id:
        - light.office_fan
        - light.office_light

EDIT:
For the fan/light combo, you have to send light-power to the light and fan-power to the fan in the functionInstance field. I found this by running the python debug tool (thanks for that too!).

This works:

action:
  - service: hubspace.send_command
    data:
      value: "off"
      functionClass: power
      functionInstance: light-power
    target:
      entity_id:
        - light.office_light
  - service: hubspace.send_command
    data:
      value: "off"
      functionClass: power
      functionInstance: fan-power
    target:
      entity_id: light.office_fan
1 Like

Hi, @shmuby, great to see that you got this working. I have a similar use case, the only difference being I have 3 Hubspace fans which don’t have lights.

  • Room: Dining Room; Fan = Dining Fan
  • Room: Living Room; Fan = Living Fan
  • Room: Master Bedroom; Fan = Master Fan

What should the friendlynames be & would I need to configure the light entities or both the fan and light entities?

e.g.

entity_id: 
- light.livingroom_fan

I am unaware of fan models with no lights. Do your fans work in HA? If they do not work (I would be surprised if they do) in HA, please follow the directions to request support for a new model.

Sorry if this has been asked recently, but any news on the local deadbolt control?

No news. It does work via the cloud. I tried looking at local control via BLE, but no luck. The advertisements change when the lock state changes, but there is some type of encryption, so nothing correlates with open/close. I am not skilled enough to figure it out. Buy a $10 Nordic nRF52840 sniffer and give it a go!

Thanks @jaaem . I will download TestHubspace and raise a new github issue for supporting this new fan. As a reference, this the one on HD.com - Home Decorators Collection Tager 52 in. Smart Ceiling Fan with Remote Powered by Hubspace N383A-MBK+V8 .There are a few more similar ones as well which have no lights.

Hello, first a big “thank you” to the contributors here! I really appreciate the time you’ve spent on this integration.

I configured a HPKA315CWB dual outlet with the Jdeath integration (installed through HACS) and I can see the entities in developer tools. I can add them to a page and I can toggle each of the outlets and they physically change state as expected. But often the toggle in the UI switches itself back to the previous state, however the outlet itself does not. So they get out of sync. Sometimes the UI eventually catches back up, and sometimes it doesn’t. So it’s like HA loses the state of these outlets after I set them. When I test the same actions through the Hubspace app, it doesn’t seem to have this problem. I’ve tried with and without “friendly name” (as I can see this has been problematic at times) and the problem persists.

Any tips on troubleshooting? Thanks again.

It has always been a problem. I am not sure why they get out out of sync. The UI usually lags after a switch, but catches up after about 30-60 seconds