cornim / wms_webcontrol

A library to control a Warema WMS WebControl web server.
GNU Lesser General Public License v3.0
15 stars 6 forks source link

add tilt/angle #8

Open thesaint1975 opened 2 years ago

thesaint1975 commented 2 years ago

Hi Cornim,

as discussed earlier that day, here is my pull request. tilt can be adjusted from 30 (open) and 100 (fully closed) shades[1].set_shade_tilt_position(100)

with shades[1].get_shade_state(True) every of my 6 raffstores (venetian blinds) shows slightly different tilt values, so this are the "lowest common denominator", and the difference in tilt/ angle is imperceptible.

shades[1].stop_moving_shade() stops surprisingly a moving shade, sometimes it needs some seconds bust most of my trials it stops during 1or 2 seconds

please dont hesitate to reject if the quality is insufficient, my coding skills are very limited (as you have surely noticed).

if you have any pointers or clues regarding the HA Integration, it would be really helpful

cheers roland

cornim commented 2 years ago

While looking through this PR I realized that there is one thing missing. So far only one type of blind was supported so it wasn't necessary to distinguish different product types but if we want to integrate this properly into HA, the library needs to carry the information which product type a shade has. The info is returned as part of the channel request. My shades are <produkttyp>10</produkttyp><bedientyp>4</bedientyp>. I don't know which one is the relevant info but perhaps comparing with what you got will help us here. Can you have a look, please?

thesaint1975 commented 2 years ago

will check this hopefully tonight

thesaint1975 commented 2 years ago

sorry for the late response, my 6 blinds returning all the same, `0

2` for explanation, 4 venetian blinds are mounted in front of sloping roof windows and can take an angle of (simplified) -90° to +90° (where 0° = full open) technically speaking -90° and +90° are fully closed but with a different incidence of light depending on the position of the sun or whatever. the other two venetian blinds are in front of the terrace doors (so they are vertically) and technically open their angle between 0° and +90°C. Inconsistently, in the scrappy Warema App these two are also displayed with a tilt adjustment range of -90° to +90°. I'll provide exact model types later, for case it helps someone if i can do any further check or investigation, pls let me know regarding the move/tilt in one command, id dint have time yet, hopefully tonight
cornim commented 2 years ago

Thanks for looking it up. It seems that between the model that you have and the model that I have we can only distinguish between with/without tilt and we can use bedientyp for it. If you don't have time, I can try and come up with an implementation but it might take a couple of weeks as I have very limited free time at the moment.

thesaint1975 commented 2 years ago

unfortunately it's the same for me too (time management is very challenging with one-year-old twins, haha) unfortunately I'm also making no progress with move/tilt in one command and have to ask for a little patience.
regarding the Model Type, it seems that there is only one "Funkzwischenstecker" (kind of wireless adapter) from Warema.

Regarding your HA integration, I tried to implement the stop function, added SUPPORT_STOP in the import and feature section and def stop_cover(self, **kwargs): self.force_update_until = datetime.now() + timedelta(seconds=15) self.shade.stop_moving_shade()

unfortunately I always get a Shade Object has no Attribute stop_moving_shade error. do you have any idea what i missed here?