Custom Component: Neo Smart Blinds Cover - modified and updated

Of course. Me too, doesn’t make sense. I’ll try now.
pprint(locals()) gives

{'close_time': 37,
 'device': '045.xxx-01',
 'home_assistant': <homeassistant.core.HomeAssistant object at 0x74811130>,
 'host': '192.168.0.xxx',
 'name': 'Kitchen Blind Left',
 'port': 8838,
 'protocol': 'http',
 'self': <Entity Kitchen Blind Left: None>,
 'the_id': '44xxxxxxxxxxxxxxx38'}

I’m really sorry, that fixed it. I’ve no idea what went wrong first time - I’ll try to work it out for my peace of mind. I can’t get positioning to work but that’s not a big deal, and I’ll investigate.
Thank you so much for developing this - it’s great. I’d received a copy of the API a while back but never progressed it.
B

Glad to hear that fixed it, wish we could track down what happened.

The positioning is a little weird because the blinds do not report a position, so its all based on the “close_time” variable. its a hacky work around that kinda works.

Hi,

First of all, thanks to the original dev work, and also for this further development. I was able to set everything up, but I have a minor issue: How, within the lovelace, can I trigger the favorite position ? It seems I do not have a control for that. I only get the up, stop and down control.

Thanks,

1 Like

I just got this set up on my end – you have to move the position slider to exactly 50 in order to trigger it to go to your predefined saved favorite.

That was a bit hard to do so what I ended up doing is hard coding a set of buttons. One having a tap_action to call-service with the service being ‘cover.set_cover_position’. And then in the service data, setting the position to exactly ‘50’. This button also doubles a stop button if any blinds are currently in motion it seems as well.

type: button
tap_action:
  action: call-service
  service: cover.set_cover_position
  service_data:
    position: 50
    entity_id: cover.back_kitchen_blind
icon: 'mdi:heart'

@marshes that looks awesome, any chance you could/would share the code at all please?

I just got a couple of blinds installed and this is exactly what I am looking at doing.

just saw this. I’ll send you a message directly to walk through what I did and better understand your usecase.

Just upgraded to 2021.1.3 and trying to setup Neo Smart Blinds integration but it’s not working. I can telnet to 8838 and 8839 to my controller and control the blinds with the app so I know it’s online and functional. Below is my setup in the configuration.yaml. Is there a log somewhere I could look at to see if I can figure out what’s failing?

#Neo Smart Blinds Integration
cover:
  - platform: neosmartblinds
    name: TestBlind
    host: redacted
    hub_id: redacted
    protocol: http
    port: 8838
    blind_code: redacted
    close_time: 27

Hi all, firstly thank you for all those contributed to this, and glad there an option for the neo blinds

I have downloaded all the latest stuff on ha 2021.1.4
And 1.1 of the custom component.

The no blinds are appearing on my overview, I haven’t seen an specific errors, config checker has said config is valid, do I need to activate the blinds in the overview

Sorry community, I feel like I’m being a pain now, I have blinds now displaying on the overview, but they don’t work, up down arrow do nothing, have I missed something this is what my config looks like this

  - platform: neosmartblinds
    name: Kitchen
    host: x.x.x.7
    hub_id: 1xxxxxxxxxxxxxxxxxxxxxxxx8
    protocol: http
    port: 8838
    blind_code: 1xx.xxx-00
    close_time: 30 
  - platform: neosmartblinds
    name: Living_Room
    host: x.x.x.7
    hub_id: 1xxxxxxxxxxxxxxxxxxxxxxxx8
    protocol: http
    port: 8838
    blind_code: 1xx.xxx-00
    close_time: 35

This is my configuration.yaml entry:

cover:  
  - platform: neosmartblinds
    name: Living Room Blinds
    host: !secret neosmartblindIP
    hub_id: !secret neosmartblindID
    protocol: http
    port: 8838
    blind_code: 239.005-15
    close_time: 99

When I attempt to send commands to my blinds I receive the following errors in the logs:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/neosmartblinds/neo_smart_blind.py:102 
Integration: Home Assistant WebSocket API (documentation, issues) 
First occurred: 4:43:48 PM (2 occurrences) 
Last logged: 4:43:48 PM

[140495037748752] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 276, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

I’m wondering if it is a problem with the connectivity to the controller. When I do a ping there are a significant number of packets timing out.

I believe your guess might be correct for the packet loss. That is quite a few dropped packets from pinging it on a local network.

Is the hub very far from your router?

Try changing your blind code from 1xx.xxx-00 to 1xx.xxx-01 (the last digit is now a 1, this changes the motor code that is sent over to the controller hub)

I don’t see anything wrong with your config, does the blind show up in the HA interface after you added that? under the entities?

Morning @mtgeekman thanks for your reply, although my blinds appear in HA, every time I change anything to do with the “cover:” in the config, it creates a new entity and disables the initial one (but not sure if that’s an issue)

I have now tried
xxx.xxx-00
xxx.xxx-01
xxx.xxx-15

And none are working, any other suggestions would be awesome.

Many thanks
Diviesh

Sorry Again, Heres the Log

Logger: homeassistant.core
Source: custom_components/neosmartblinds/neo_smart_blind.py:102
First occurred: 12:50:57 (1 occurrences)
Last logged: 12:50:57

Error executing service: <ServiceCall cover.open_cover (c:1dbe497766aadce1f449bc1ea4559dbc): entity_id=['cover.living_room']>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x68dc2e20>: Failed to establish a new connection: [Errno 110] Operation timed out

From the log, it looks like your home assistant isn’t able to actually connect to the IP address you put in the config for your controller.

I would suggest making sure they are both on the same subnet and double-check what the neo smart blinds app says your controller IP is.

IE: if your controller has an IP of 192.168.1.15 your and your home assistant hub has an IP of 192.168.2.10 you would have to be on a subnet of 255.255.0.0 (or a /16 ) for them to be able to talk. having a /16 subnet at home is very uncommon.

I’m a pretty techie bloke (if I do say so my self :slight_smile:) I will see if I can spot what’s happening, and report back, thanks for your reply

It is in the next room, I will move it into the same one and see if the performance gets better.

Great shout, it didn’t click at first, the smart hub needs to be connected to 2.4ghz network, so I set up a guest network at home that’s on 2.4, the main network does 5ghz, the pi is connected directly to the hub, even though the hub runs both networks, the guest network cant speak to the main network, I have now created a link between the two, and viola it worked straight away - Absolutely awesome app and community support is 2nd to none

2 Likes