Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to new DigitalStrom API #34

Closed
albertomontesg opened this issue Apr 26, 2022 · 5 comments
Closed

Migrate to new DigitalStrom API #34

albertomontesg opened this issue Apr 26, 2022 · 5 comments

Comments

@albertomontesg
Copy link
Contributor

There are any plans to migrate to the new DigitalStrom API: https://developer.digitalstrom.org/api ?

@gaetancollaud
Copy link
Owner

Holy moly, finally something new! I was waiting for it for a long time. I need to spend some time investigating but yeah for sure! I don't have time to go through it right now but I will for sure do it as soon as I have time.

Did you receive a notification or something? If yes, on which channel? Because I didn't get anything.

@albertomontesg
Copy link
Contributor Author

Actually I encountered this surfing the web and making some searches at Google.

@gaetancollaud
Copy link
Owner

I just give it a try and it looks really really promising !
You can ask for the status of all the devices of the appartements and it returns it in ~50ms !

Documentation about auth is still really bad... Did get the bearer token to work

Websocket also works (for notifications) but seems tricky and not documented.

Note for my futur self:

ws://dss.local:8090/api/v1/apartment/notifications

{"protocol":"json","version":"1"}

@gaetancollaud
Copy link
Owner

I had a second look at this new API and it looks very promising. It's a big more complicated to do some actions, but it's crazy fast compare to the previous one. The Websocket also bring new possibilities compare to the previous event endpoint.

I don't think I will have time to work on this in the next few months, but I will fore sure implement it eventually. I will rebase my work on the PR #35 because it has some good benefits I think.

@gaetancollaud
Copy link
Owner

I took some time to investigate the new API. I ended up almost reimplementing everything. I based my work on #35 to have a proper architecture.

Good news:

Downside:

  • Stuff has been shuffled arround (for instance circtuits are now controllers, and actually they now use "meterings" for power sensors), this will be reflected in the mqtt topics
  • no more scene event (no api provided)
  • no more button event (was a workaround anyway)

I will polish it and make a new release soon, but it will be a version 2.0 and will have some breaking changes unfortunattely 😫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants