Closed alexkoenigs closed 2 years ago
Hi @alexkoenigs, I don't see any issue with your jsonata. However, a few comments:
position_url
is currently polled by HK only. So, does the position eventually update? I'm looking into implementing more regular polling on a defined interval, i.e., 15 sec for example.
Probably your motion_up_time/down_time is not correct, which is causing the large difference?
Does the position eventually self-correct to 21?
I'm wondering if it would be helpful to fetch position_url once before asking the blinds to move, to ensure they were at the desired starting position. Any more information you're able to share would be helpful as well.
Hi, Thanks for the reply!
If HomeKit blind status and real blind status align before issuing a command, it works perfectly. But in those cases of moving the shutters through other means than HomeKit, it breaks.
If there's anything else you'd like to see/know please feel free to ask.
Will test the eventual updating though and reply again here in about 15-20 minutes with the results.
fetching the actual position (position_url) before sending a move command would indeed be a very good idea! And probably not too hard to implement either. Having a configurable interval for fetching would still be a very welcome addition as well though.
Yes have been thinking about this approach also.
I've not tested to wait longer for it to self update, is there anything that might trigger it to fetch the position? or is it just a waiting game atm?
It's up to HK how often to poll. That's why I'm thinking of the above approach for your use case.
Try force quit the Home app on your phone/tablet, and relaunch going to the pane where your blinds are. It should force the position to be re-polled. If that is working, then probably we need to do 2 things:
Force restarting the app does not update the status. I've tested with both Home and Elgato Eve.
Setting "verbose" = true
shows that homebridge should be aware of the status, but still both apps show no change.
Thanks @alexkoenigs. Polling may just be the main / best way to do it. Can you post the logs though so I can see?
Also, if you restart homebridge, does the position update?
Logs after restarting Homebridge and force reopening Home App:
Position still not updated though, Apps show shutters closed completely close which was last HomeKit action performed like 2h ago. rolled up the shutters without homekit 20 minutes ago now and even restarting apps and homebridge no change to status "blinds closed" in apps.
@alexkoenigs there is still something strange here:
With verbose: true
, there should still be a line like:
Requested setCurrentPositionByUrl
...
which I'm not seeing in your logs. Can you also post the results of:
curl http://192.168.0.3/ocf/wlss9/openLevel
(Also, please check both standard and also error logs)... sometimes they are in different files.
I'll need another hint about what you mean by both logs. Homebridge? Your plugin? Please let me know where I can find the ones you mean.
But anyway: This is the beautified result of requesting http://192.168.0.33/ocf/wlss9/openLevel
openLevel is at 0 right now as blinds are closed (it's around midnight over here in Europe)
I'll need another hint about what you mean by both logs. Homebridge? Your plugin? Please let me know where I can find the ones you mean.
It's the homebridge logs (the plugin just logs to homebridge). Everything looks normal, but strange it is not showing the position request.
Right, but I can't find anything about separate standard and error logs. If you tell me where to find those error logs I'll make sure to send them your way
How do you run homebridge? If you use pm2, for example, could be:
/home/pi/.pm2/homebridge-out.log and /home/pi/.pm2/homebridge-error.log. It 100% will depend on your configuration/setup.
I'm running oznu/docker-homebridge
. I just scanned through my entire homebridge directory, found the regular logs, which show just the same that I sent you. There doesn't seem to be separate error logs.
And by the way, let me tell you I'm already amazed by how invested you are in helping me. Not to bribe you or anything but I'm definitely sending a few bucks your way when we finally get this working.
@alexkoenigs appreciate your support!
I'm not sure about docker logs for homebridge. One simple thing you could try is modifying your open/close/position_url to something wrong (like http://google.com/asdf) and see if you can get that error to show up when you start hb.
It will be in some log, just not sure if it's your primary one or not.
You can see logs from another user here, which show how it should look:
https://github.com/dxdc/homebridge-blinds/issues/31
I'm just wondering if there is some error being triggered by your position_url somehow. Even simple things like JSON being reported with extra symbols or so could break jsonata parsing.
Oh yeah errors in general show up in those logs. Had a broken plugin the other day and that was spamming my logs with error messages until i yote it.
Well also I just noticed you said that you expected setCurrentPositionByUrl
to show up somewhere, but I'm not sure it should, as I don't set my position using a parameter in the URL.
The thing is: My rollers' API is weird, so I can get the current position but I cannot set a target position that way. So for setting it all I can do is use your plugins' timing, but I could verify that the position is correct afterwards by requesting it
Well also I just noticed you said that you expected setCurrentPositionByUrl to show up somewhere, but I'm not sure it should, as I don't set my position using a parameter in the URL.
Using position_url
will trigger that. It should still be compatible w/ your use case. I need to do some refactoring of the plugin in general and implement some testing as well. It's on the list of to-do's just haven't gotten there yet...
In the meantime, you can also try editing the source to add some logging in places and try and figure out where it's struggling. The automated tests will be helpful to catch other issues though.
Yeah unfortunately no time for that :D I can squeeze in a bit of tinkering with Homebridge but that's really about it then. Please do let me know if you get around to addressing this at some point tho! I'll be waiting patiently :)
@alexkoenigs I've been quite busy, but I just implemented polling which I think may fix your issue.
Basically, as long as the blind movement wasn't triggered by HK, it will self-correct the setting in the plugin. Can you please enable verbose as well for the settings, and let me know how this works for you? I'm curious especially to see the logs.
sudo npm install -g homebridge-blinds@1.3.25-beta.3
# restart homebridge
In my setup, jsonata doesn't seem to work as intended, as changes not made through homebridge don't reach homebridge. Please have a look at the following screenshots explaining my issue. This first one shows the logs, where a position of 64% is requested but the openLevel returned shows that the blinds are actually at 21%.
This following screenshot shows my setup, which should find the "openLevel" in the returned JSON. Please let me know where I'm missing something.
If you need anything else to help please let me know. Thank you