blacksmithlabs / orbit-bhyve-remote

A simple remote for interacting with your Orbit Bhyve wifi sprinkler control system
MIT License
30 stars 8 forks source link

Getting device id #16

Closed bemindt closed 2 years ago

bemindt commented 2 years ago

In your notes you mention that you don't know how to get the device id. If you do a HTTP get to the following url:

            https://api.orbitbhyve.com/v1/devices?user_id=your_user_id

You will get a payload back with a lot of information including the device id for each bhye device you have. Of course you need to have the appropriate headers set on the get request.

killermonk commented 2 years ago

Thanks! This end point is implemented in my hosted firebase solution since it has a UI that lets you build the configuration.

For configuring this headless, self hosted version it doesn't make as much sense to try to call the API during configuration. The manual steps in the readme felt like the best way for this project.

bemindt commented 2 years ago

I am working on a java based solution for this and I am trying to model after the work you did, but unable to get the websockets to respond. I am not a js expert, but are you really using web sockets?

killermonk commented 2 years ago

Yes. I am using web sockets to do all the communication. I just kind of built it as needed, so the code is not super well structured or planned out. I've started a discussion where I tried to capture everything I could about the design and handling of the web socket that makes everything work.

Let's take this over there: https://github.com/blacksmithlabs/orbit-bhyve-remote/discussions/17

I've never coded WebSockets in Java, but am quite experience using the language. Feel free to post any code you're writing that is having issues in the discussion and I can help you debug it.