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

include angel in position moving #3

Closed hubecker closed 2 years ago

hubecker commented 3 years ago

Hi, Is ist also possible to have the angel moving of the shades included in your project? According to this i found in HA forum:

/protocol.xml?protocol=9004082100020300AAffffff&_=1586803111 90 - I don’t know 04 - Counter it always has to be different, I have the first digit for the room and the second for the position, but I can also make something that automatically counts up 0821 - move command 00 - room (as in the web interface, starts counting at 0) 00 - roller shutter in the room (as in the web interface, starts counting at 0) 03 - Fixed value I have no idea 64 - Position for roller shutters or external venetian blinds (Pos * 2 in Hex) AA - Angle (only with external venetian blinds) I have a table, but no access at the moment, but if necessary I can search for the determined values. Thanks Hubert
Stephan1908 commented 3 years ago

Hi,

I was able to find out the following: If I have the value AA /protocol.xml?protocol=9004082100020300AAffffff&_=1586803111 If I replaced one of the tables here, I can use it to adjust the angle.

grafik

cornim commented 2 years ago

Sorry for the late reply, I must have had notifications turned off at some point.

Yes, in principle that should be possible. Unfortunately I don't have any blinds which support angle change, so I can't reverse engineer or test this, but what @Stephan1908 wrote certainly is in line with what I observed for the rest of the calls, i.e. rather arbitrary mapping of HEX values to open/close settings.

If you have blinds which support angle and are able to extend this, I'd be happy to review any pull request you send.

cornim commented 2 years ago

I'm closing this for lack of a reply.

thesaint1975 commented 2 years ago

hi, sorry for reopen this one.

i added a fix value for the angle/tilt, cause i only need my raffsatores down and tilt closed. therefore i changed SHADE_POSITION = '03{}dfffffff' when i now set postion in a python console from (eg. shades[0].set_shade_position(100)) it works as expected, when i do the same in Home Assistant (regardless if via automatisation or manual via UI) the first time a day, it just go down to the position set, but the tilt stays open. if i repeat the command in console, tilt closes. then it works in Home Assistat too, until the next day.

do you have any hints what i miss here?

thanks, roland

cornim commented 2 years ago

That sounds very strange indeed. I would recommend enabling debug logging in HA for the warema module. That will show you which commands are actually being send.

thesaint1975 commented 2 years ago

i added following to the config.yaml: logger: default: debug logs: warema_wms_webcontrol: debug homeassistant.components.warema_wms_webcontrol: debug where can i find this logs now? (sorry, as you already noticed, i'm a noob)

cornim commented 2 years ago

hi, the logs can be found in the HA front-end under Configuration -> Server Controls -> Logs.

The logger specification doesn't look quite right but I have no means of testing it out right now.

thesaint1975 commented 2 years ago

hi cornim, thanks, i found it already but without gain of knowledge, haha after some "reverse engineering" with wireshark, i extended your code, now i'm able to adjust the angle/tilt too. it works via python console, now i have to adapt your HA Integration when i get time. if you are interested i can provide this extensions. thanks, roland

cornim commented 2 years ago

sounds good. if you set up a pull request i'm happy to review it.

cornim commented 2 years ago

also i can possibly give some pointers on how to adapt the HA integration if I see how tilt is implemented in the library.

thesaint1975 commented 2 years ago

I'll try to figure out how these pull requests work, I've never done it before, I just have to ask for a little patience until I find time for it. tips & hints regarding the HA Integration would be very helpful and welcome.
a first quick n' dirty approach results in an attribute error (Shade object has no attribute 'stop_moving_shade' or something like that), but had no time for debugging.