Git Product home page Git Product logo

Comments (12)

Kane610 avatar Kane610 commented on September 6, 2024 3

Hi,
Where I can find some sample code to get me started.
It would be great to put it in README doc for other to use this package.
I could create something like that if you are OK with it.
I now have API key and can connect to my gateway check sensors etc, but wondering how I could use your code.
Please advise.
Thanks

Feel free to contribute 👍🏻

I think improving the main file is a good way to show case how to set up the basics of the integration. I can probably do that within the next few days.

If you want to delve deep into it everything is done to work with Home Assistant so you can look at the deconz integration to get inspiration. https://github.com/home-assistant/core/tree/dev/homeassistant/components/deconz

from deconz.

Kane610 avatar Kane610 commented on September 6, 2024 1

You will laugh, the default user and password was the ones in your main code, both are delight , I though it was something you set previously, i am getting the apikey without problems.

Thanks a lot

Great! It was so obvious I didn't think I'd need to ask the question 😂

from deconz.

Kane610 avatar Kane610 commented on September 6, 2024

Rest API documentation: https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/configuration/

Make a new method similar to initialize which calls request with

await self.request("put", "/config/", json={"permitjoin": 60})

Note this is untested and might not work

async def initialize(self) -> None:

from deconz.

markicos avatar markicos commented on September 6, 2024

Thanks it was a very useful help,

Now i am facing a problem, I am trying to use the basic authentification, but it is reporting always user and password is not recognized. I saw in your main.py that you comment the user and pass in kw, have you had problems with it?

#'username': 'delight',

Later I tested to get into Conbee II thought Web App
I am getting always an error:
image

I am using the same pass than in Phoscon APP where I have no problem. I am doing something wrong...

from deconz.

Kane610 avatar Kane610 commented on September 6, 2024

I should probably improve the main a bit :), what you should do is generate an api key

async def async_get_api_key(session, host, port, username=None, password=None):

In Phoscon you should open up for pairing of third party applications and then use the async_get_api_key function

from deconz.

markicos avatar markicos commented on September 6, 2024

I was expecting not to use the pairing :(, but in any case thanks a lot...

from deconz.

Kane610 avatar Kane610 commented on September 6, 2024

If you get your credentials right it's just a matter of altering this line with the basic auth parts from async_get_api_key, unfortunately I stopped using the credentials a couple of years ago but it should still work

async with self.session.request(method, url, json=json) as res:

from deconz.

markicos avatar markicos commented on September 6, 2024

Thanks, I think the problem is the user not the password, but don't know how to get the proper one, I will keep you updated in any case.

from deconz.

markicos avatar markicos commented on September 6, 2024

You will laugh, the default user and password was the ones in your main code, both are delight , I though it was something you set previously, i am getting the apikey without problems.

Thanks a lot

from deconz.

markicos avatar markicos commented on September 6, 2024

Hello,

I have one more question, is it mandatory to run up the deconz software to use the discovery function?, as if i have not this software running i am having allways "[ ]" as response.

from deconz.

Kane610 avatar Kane610 commented on September 6, 2024

No the discovery function is a helper function in cases where you don't have full knowledge of the system or want to provide a better user experience

from deconz.

voytecPL avatar voytecPL commented on September 6, 2024

Hi,
Where I can find some sample code to get me started.
It would be great to put it in README doc for other to use this package.
I could create something like that if you are OK with it.
I now have API key and can connect to my gateway check sensors etc, but wondering how I could use your code.
Please advise.
Thanks

from deconz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.