Custom Component: Neo Smart Blinds Cover - modified and updated

Thank you to 4n0nD3v3l0p3r for the original version they created. Located here: Custom Component: NeoSmartBlinds Cover

I have adjusted the code for easier maintainability. I also updated the documentation and improved the installation instructions.


Be sure to check the readme.md for the latest and best instructions.

Notable Changes

  • The blind code should not have the dash “-” on the end anymore. This is now handled internally.
  • Two protocol options, http, and tcp
    – http port: 8838
    – tcp port: 8839
  • This release also takes care of the “This entity does not have a unique ID, therefore its settings cannot be managed from the UI.” message and allows for it to be managed from the UI.

Custom Component for NeoSmartBlinds Integration on Home Assistant

The NeoSmartBlinds platform allows you to control a NeoSmartBlind / group of NeoSmartBlinds via a NeoSmartBlinds controller.

There is currently support for the following device types within Home Assistant:

  • Cover

Installation

To begin with, it is recommended you ensure your NeoSmartBlinds controller has a static IP address, you may need to configure this via your routers DHCP options.

  1. Download the latest release from the GitHub listed above
  2. Extract the file
  3. Copy the neosmartblinds folder to your config/custom_components/ directory
  4. Go to Config -> Server Controls -> Under “Server Management” click restart
  5. Go to configuration example for how to set up your config.

Cover Configuration

Example of basic configuration.yaml

cover:
  - platform: neosmartblinds
    name: Blind One
    host: 192.168.0.13
    hub_id: 000000000000000000000000
    protocol: http
    port: 8838
    blind_code: 021.230-04
    close_time: 30

Configuration variables

cover:

platform (String)(Required)

Must be set to neosmartblinds

host (String)(Required)

The IP of the NeoSmartBlinds controller, e.g., 192.168.0.10.

Getting the IP:

hub_id (String)(Required)

The 24 character device ID of the Smart Blinds Hub, found in the APP

protocol (String)(Required)

The protocol to use for sending commands. (http, tcp)

port (String)(Required)

Port use for the connection. for TCP use 8839, for HTTP use 8838

name (String)(Required)

The name you would like to give to the NeoSmartBlind.

blind_code (String)(Required)

The blind code. - This is available from the NeoSmartBlind app

Getting the codes:

  • Room Code: will control all blinds in that room
  • Blind Code: will control only that blind

“​ID1.ID2-CHANNEL"

“ID1” : controller byte 1, from integer “000” to “255”

“.” : address separator

“ID2” : controller byte 2, from integer “000” to “255”

“-” : channel separator

“CHANNEL”: channel, the individual channel from integer “01” to “14”, use channel “15” for a group

close_time (String)(Required)

Time taken in seconds to close this blind (use a stopwatch to measure)

Entity Options in UI:

Entity Options

Entity Control allows for fine adjustment and extra controls:

Lovelace UI panel provides basic control

Supported features

Open
Up

Close
Down

Tilt-Up
Micro-Up

Tilt-Down
Micro-Down

Set-Position & Favourite Position - please note this is calculated using the close_time

Setting the position:

<= 49 will move the blind down, this means set position 25, moves the blind down and stops after 50% of your close_time

>=51 will move the blind up, this means set position 75, moves the blind up and stops after 50% of your close_time

==50 will set your blind to its stored favorite position

Hi,

Just wondering if this warning is taken care of in this version, before I upgrade?

Log Details (WARNING)

Logger: homeassistant.components.cover
Source: components/cover/init.py:340
Integration: Cover (documentation, issues)
First occurred: July 31, 2020, 9:51:43 AM (1 occurrences)
Last logged: July 31, 2020, 9:51:43 AM

CoverDevice is deprecated, modify NeoSmartBlindsCover to extend CoverEntity

Thanks,

Rob

Yes, I switched it over to using CoverEntity instead of CoverDevice to fix this error.

Thanks, I’ll give it a try.

FYI, I see this error now: Invalid config for [cover.neosmartblinds]: [hub_id] is an invalid option for [cover.neosmartblinds]. Check: cover.neosmartblinds->hub_id. (See ?, line ?).
Home Assistant has started!

I just pushed a new release that brings it up to date with the code in the repository. Should clean this up.

Thanks, looks to be working, I missed where the new update was, but then I’v found it.

Awesome! good to hear.

Let me know if you have any other issues with it.

mtgeekman, this is great! Integrated without issues. Directions were really clear, and I can now raise and lower my blinds with HomeAssistant and Alexa too.

One question, that I can’t figure out, and was wondering if you knew a way to accomplish/work around, I have 2 top down bottom up within the Neoblinds less than stellar app, I can change the rail being controlled through a Rail Selector button which has 3 modes.

Mode 1 - The “middle” rail
Mode 2 - the bottom fail
Mode 3 - Both Rails

The integration defaults to Mode 1, unsure if there’s any obvious way to select the bottom rail?

There currently is no way to choose the modes for selecting a rail. I think I’ll have to contact NEO Smart Blinds to see if they have any documentation on how to do that.

I do not have any top-down / bottom-up blinds currently, I might be able to sniff out what they are doing if I did.

I’ll let you know what I find out.

1 Like

For anyone following this thread with top down bottom up motorized blinds integrated with the neoSmart Hub, mtgeekman’s implementation can be modified to replace the tilt commands with bottom rail commands instead. Replace the micro up and micro down commands with u2 and d2, then HA’s tilt control will control the bottom rail. You can then use a service call (which I’ve mapped to a button using the “multiple entity row” custom integration).

2 Likes

@mtgeekman
Hi

Wow this is a late reply… hah… hope all is well in these strange times

You’ve done great work from the foundation built !

As the original author I’m just happy to see it expand as required… that what open source is about!

Thanks @4n0nD3v3l0p3r, I’m glad you approve. Its been an adventure figuring it all out.

Thank you @4n0nD3v3l0p3r and @mtgeekman for the addon. This has been very helpful in getting my blinds integrated with home assistant.

I am having an issue and was hoping if someone here can give me direction. I have my blinds working in Home Assistant and this works well with web interface and the iOS app, but with HomeKit bridge, I am getting an error:

The configuration.yaml file contacts the following definition for the blinds:

cover:
  - platform: neosmartblinds
    name: Study Blind
    host: 192.000.000.000 <redacted>
    hub_id: 000000000000000000000000 <redacted>
    protocol: http
    port: 8838
    blind_code: 000.000-00 <redacted>
    close_time: 26

The blinds can be managed from Home Assistant, this is just an error message I am getting while enabling the cover entity in the HomeKit Bridge config.

Below is the output of the Blind status from the developer page.

State is ‘Unknown’ and always remain unknown.

current_position: 50
current_tilt_position: 50
friendly_name: Study Blind
supported_features: 63
device_class: blind

(apologies, I could not attach the screenshot of the dev page as new users cannot post more than 1 image)

Also doubling down on the props to @4n0nD3v3l0p3r for the orig and @mtgeekman for the fork. I was able to work with @mtgeekman to modify his integration to gain scrappy control over the bottom rail for a set of top down bottom up blinds I purchased from BlindsGalore.

Re: @nerdyoda, with my particular blinds, I found that the position would never provide HA with a state -though it functioned correctly, the state was always unknown.

Though quite silly, I ended up adding an additional integration on top of this my modified integration from mtgeekman. I used the fork from Robi on this page: Custom Component: Cover Time Based and used the time to open and close, then integrated service calls into the front end and used Lovelace: Multiple entity row to put it all together again for Lovelace.

After doing all of this, HA now shows open and closed states, as well as pretty accurate position states (solely calculated by time).

This allows me to have a single button to control the top rail, and the bottom rail for the 4 most common positions I use (represented with battery icons): all the way open (both rails up), all the way closed (top rail up, bottom rail down), sitting privacy, and standing privacy (bottom rails down and top rail at 52%, and 30%. Lastly, I used a helper toggle to track if the bottom rail is down all the way or not, which lets me change the delay before moving the other rail before the stop command stops both rails.

All in all a very round about convoluted way to get full functionality. I suspect doing something similar will give HomeKit the extra position info it seems to be asking for in the error -but not positive, since I haven’t done it myself.

1 Like

Sorry, I’m having difficulties getting the component to work.
My configuration.yaml contains

cover:
  - platform: neosmartblinds
    name: Kitchen Blind Left
    host: 192.168.0.xxx
    hub_id: 44xxxxxxxxxxxxxxxxxxxx38
    protocol: http
    port: 8838
    blind_code: 045.xxx-xx
    close_time: 37

I’m getting the error:

2020-10-08 21:30:28 ERROR (MainThread) [homeassistant.components.cover] Error while setting up neosmartblinds platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/neosmartblinds/cover.py", line 67, in setup_platform
    cover = NeoSmartBlindsCover(
  File "/config/custom_components/neosmartblinds/cover.py", line 98, in __init__
    self.hass.data[DATA_NEOSMARTBLINDS].append(self._client)
AttributeError: 'NoneType' object has no attribute 'data'

What stupid error have I made?

Just to be certain, you did download the 1.1 release right? not the 1.2 beta files. (1.2 is not functional just yet.)

Yes, neosmartblinds_v11.zip

Home Assistant 0.115.6
HassOS 4.13

Can I convince you to redownload and reinstall the component files?

I’m running out of ideas to have you try, your config looks ok and from the error in the log everything is where it should be.

1 Like