mtgeekman / Home_Assistant_NeoSmartBlinds

Adds NeoSmart Blinds support to Home-Assistant.
46 stars 14 forks source link

Add support for any % position #8

Closed Bacichetti closed 3 years ago

Bacichetti commented 3 years ago

@mtgeekman @clara-j One of the compatible motor brands with Neo Smart Controller actually supports the use of specific positions.

The motor brand is our home brand NEO motors. And it's the same that supports the second favourite position. Here is how to tell if you have a NEO motor: 1 - Go to your motor advanced page. 2 - Check the "motor code" for your motor at the end of the page. You have a NEO motor if the code is "no" 3 - Test if your NEO motor works with the % position by enabling the toggle "% position" and testing your blind to see if the % position commands work. 4 - If you don't see the % position toggle. Change your account's setup code to "NEOV1".

The command code to use the % position is the desired % position. Open and close still the required way to open and close completely the blinds. Here are the examples for the command codes: 0% => CMD_UP = "up" 100% => CMD_DOWN = "dn" any other XX% => "xx" (in decimal and must be 2 chars), from "01" to "99"

image image image

clara-j commented 3 years ago

I checked on my app and I see the "motor code: no", but there is no % position toggle. I did try with the API though and it does seem to work, which is great.

First off, thank you for the information. Great to have. Question for you, is there a way to detect this support in the API so that it would be possible to dynamically detect. If not it could be handled through a config parameter.

Is there any ability to read back the current position?

IMG_8228

mtgeekman commented 3 years ago

@clara-j Which version of the app are you using?

@Bacichetti which version of the app includes that setting?

I, unfortunately, do not have the "no" motors in my blinds. Mine are "bf" motors.

clara-j commented 3 years ago

I am using iOS version 4.3.6. I will look into adding this support and will for now likely do it as a config parameter to enable it, otherwise use the current method to modify the position.

Bacichetti commented 3 years ago

Sorry, I forgot a step there (item 4). The feature still not available to all so codes with the NEO motor.

clara-j commented 3 years ago

Spent a bit of time yesterday and have a working version with percent positioning. Need to do some more testing a code cleanup before I will push the changes.

I have added a config parameter of "percent_support: 1" to enable the feature which will default to 0 so shouldn't break any existing users that upgrade.

@Bacichetti is there any command to read back the current position through the API?

Bacichetti commented 3 years ago

@clara-j , unfortunately, no. The actual motors cannot send any feedback. That would require the use of bidirectional communication hardware. We're working on new hardware that will offer that option still this year. The solution will be new motors with options for BLE + our new Smart Controller that also has BLE or some limited motor models with Wi-Fi (only for the plugged-in curtain motors). Retrofitting motors will be possible most of the time, we actually already sell a Bluetooth add-on for our NEO motors. Maxxmar calls our motors "Maxxmar New Gen".

There is nothing planned for other motor brands since they do not offer a bi-directional option. Sorry.

clara-j commented 3 years ago

No problem, thought maybe there was an option that would include the position in the HTML response to the call.

Thanks for all the info, appreciate it.

mtgeekman commented 3 years ago

@Bacichetti is there any chance of you sharing the latest API Doc with us? I think the last copy I have is from almost a year ago now.

Thanks!

clara-j commented 3 years ago

I have pushed my changes to my branch which now supports % positioning. I will create a pull request to the main branch soon, but just want to test it out a bit more and let anyone else try it out if they want in the meantime.

mtgeekman commented 3 years ago

Sounds good, thanks for working on this!

Bacichetti commented 3 years ago

@mtgeekman , I'm working on an API update. I'll let you know when I have it finished. I've finally installed Home Assistant during the weekend. I'll see if I can do some tests this week.

clara-j commented 3 years ago

Code has been merged now with the main branch. If anyone that has blinds that support this feature can test it out, and anyone with existing blinds can confirm nothing breaks that would be great.