Open zelial opened 8 months ago
As per https://www.home-assistant.io/integrations/cover/ what this is about are not shutters but blinds.
@vsechnozabrany in reply to https://github.com/slesinger/HomeAssistant-BMR/issues/7#issuecomment-1972638388, yes, I know, actually you don't have to access the service menu, you just need to set the corresponding bit via modbus, but otherwise it's as you said.
Anyway, the approach with actually logging in to the web interface and changing values there is fine, plus you won't lose the manual control via the web interface as with the modbus approach, so adding a support for blinds would be great.
Blinds support will be problematic for me as I do not have external blinds controlled by BMR. Can you do me a favor to show how XHR requests look? Login to your local BMR web interface with Chrome. Open Developer Tools > Inspect > Network > XHR. Then browse through the web UI, visit list of blinds and move one up/down. Finally, right click in the inspector "Save all as HAR with Content" and attach it here. (your password will not be here if you opened Inspect after login screen). Thank you.
Sure, here it is. Also with screenshots so that you know how it looks like. The "natoceni" which you see on the screenshot is not used in my case, as I have regular roler blinders, it is used with venetian blinds (rolety vs. zaluzie). har.zip
Thank you. Can you please specify what is the very minimal viable set of features?
I think if you just added setting the blinds via manual setting and reading the status (but I didn't browse to the status page so you would probably need that too), it would be a good start, then you can set up schedule using automations.
@slesinger I have blinds and was planning to (eventually ;) ) code the support myself. But if somebody else does it I wouldn't mind :)
The idea was to use the internal API the webUI uses, similar to how heating is controlled. E.g.
curl -X POST http://bmr.zelial.cz/saveManualChange -H 'Content-Type: application/x-ww-urlencoded; charset=UTF-8' -d 'manualChange=04710'
The numeric parameter represents the blind ID to be controlled [0-1], position[2] and tilt [3].
The position has only 4 values so the blinds can't be controlled precisely (e.g. set to 56%) and BMR doesn't expose the dumb low-level controls to the motors so we'd have to make do with this. But it's sufficient for most my use-cases.
Also BMR blinds only have 8 programs available so supporting manual change via switching to a different program isn't feasible (unlike with heating which AFAIK has 32 programs). So my plan was to expose just the manual change interface and not the programs.
Here are my notes for the manualChange parameter:
manualChange format:
Thanks @Dehumanizer77 and @zelial for providing details. I have blindly implemented blinds support in this package (I need to extend HA package, too). I still need some more info from you.
/wholeRollerShutter
returns a cryptic value like 1Kuchyna 0000010000000000000
. Can you experiment and try to decode what the long number means?/windSensorStatus
returns a cryptic value like 0000000001111111111111111111111111111111100000000000
. Can you experiment and try to decode what the long number means?/rollerShutterIntermediate
any good?Latest master (4a7cc02a05489af2d898b509d609355938d0f7c2) contains my changes in case you want to play with that. Or wait for the HA package.
How do I test the API?
I don't have the windsensor so can't test that but I'll try to decipher the /wholeRollerShutter
and test your changes.
If you can explain me how do I get to this API, I can ask the someone from BMR (the manufacturer), I know people there, they will surely be able to help.
I cannot show it on my BMR but the API is called in recorded session. You can download above har.zip and unzip. Next, open Chrome browser, right-click, Inspect, Network, Import HAR file (shown on screenshot)
I am sure when somebody from BMR will see it, will be able to tell what the output "0000010000000000000" actually means.
Similar issue is with the other APIs `/windSensorStatus
and /rollerShutterIntermediate
.
Thank you
ok, I am quite busy right now, but in two weeks I am going to a vacation, so I'll take a look
- API
/wholeRollerShutter
returns a cryptic value like1Kuchyna 0000010000000000000
. Can you experiment and try to decode what the long number means?
I've tested and documented it in #21.
I'm sorry, it's really hard with a 6-months old kid on a vacation, I didn't have time at all :-)
Latest master (4a7cc02) contains my changes in case you want to play with that. Or wait for the HA package.
I've tested the code. saveManualChange
works well (thanks!) but the value mapping is quite unintuitive. Tilt is mapped from 0-10 to 0-100 for some reason and position is mapped from 0-100 to 100-0 i.e. reversing the meaning. This broke my brain when using it. Is there a reason for not using the value ranges as bmr does? E.g. is this what Home Assistant expects?
I cannot contribute on the code side, but I'd like to help with testing of blinds + I had pretty good contact to manufacturer. Is there anything I can help with?
The BMR control unit is able to control blinds ("venkovni žaluzie"). The controls are exposed via web UI similarly as heating ones are. Would be nice to have support for them in pybmr (so that it can then be added to Home Assistant as well).