rhyst / linak-controller

A Python script to control Linak standing desks.
MIT License
355 stars 52 forks source link

query the state when in server mode #85

Open binlan opened 8 months ago

binlan commented 8 months ago

Hi,

i think there is no way currently to get the current hight of the table when it runs in server mode, right? Ok, i could look into the logfile, but It would be nice to be able to curl (or linak-controller) the server for the current status. i run the linak-controller on a raspberry-pi in server mode mounted on the table. i now would like to integrate it in my home automation and therefore it would be helpful to display the state.

what do you think.

thank you.

rhyst commented 8 months ago

You can run:

linak-controller --forward

to get the current height

binlan commented 8 months ago

ah, without everything. yes thats help.

thank you

rhyst commented 8 months ago

No problem, I will leave this issue open as a reminder to put that in the README

binlan commented 8 months ago

hmm, unfortunately it didnt do the job. if i e.g. move the table by hand, than a linak-controller --server-address my-table --forward move them back to the former position. I think it looks like, the server did not recognize the position change. If i would let my home automation poll with that method, it would make the hand switch unusable.

voruti commented 8 months ago

I have connected my desk to my home automation over a REST Api and a (pushing) webhook, which I implemented in my own branch https://github.com/voruti/linak-controller/tree/typescript-rewrite. Maybe this can help you.

rhyst commented 8 months ago

I am not sure what the problem is. When I move my desk using the physical switch, and run linak-controller (either using server mode or not) then it accurately reports the current height.