braiins / bos-plus-api

BOS+ API
19 stars 8 forks source link

Trouble with authentication token in smarthome #18

Open Enermatz opened 3 months ago

Enermatz commented 3 months ago

Hi, i tried to integrate some miners into my smarthome to make use of excess energy from PV. Since all my other stuff gets handled on a raspberryPi with Node-Red, i tried integrating the BOS+API there. There seems to be only one repository that can handle gRPC on node-red: https://github.com/julien-pal/node-red-contrib-grpc I got it to work, since i can read out the GetApiVersion, but that's where the problem starts.

For every other command, you also need so send the authentication token, which i think i know how to do that, if i had a chance to retrieve the token. I tried reaching out to the contributors of node-red-contrib-grpc, but the project seems to be abandoned. Editing the code by myself didn't work neither. There seems to be no option to somehow read out the response header in node-red.

Since you most likely have no time to dig into node-red or mentioned repositorys, is there a way to maybe integrate an option for the user to decide if u need an auth-token as mandatory, or instead just use 'username/pwd' as plaintext, or don't use authentication at all?

Everything else with your api works like a charme, just the auth-header prevents me from fully automating the whole thing.

Every help is appreciated, thanks in advance! Enermatz

Enermatz commented 3 months ago

Got it to work without the mentioned repository. Node-Red can run terminal commands through the exec node, works just fine.