Raspbee II command line get api key

hello
how to get the api key with command line for my raspbee II
need to add this key into the openHab binding
have a nice day
vinc

in openHab gibt es diese Info

Wenn kein API-SchlĂĽssel angegeben wird, wird ein neuer angefordert. Sie mĂĽssen den Zugriff auf die deCONZ HTTP-Schnittstelle autorisieren.

aber wie macht man es in command line?

You need to do it by unlocking the network in phoscon.

hello @Mimiix
unlocking the network in phoscon.
how do you do it - the linux is just the plain OS - and only port 22 is open for ssh
so what and how should i do it?
have a nice day
vinc

Hi,

It needs to be done in the browser. If deCONZ is started, you should be able to connect to it. Perhaps you need to add another port so you can communicate to it.

Acces over the Browser from remote is not working

how do i add another port to my raspberry pi to listen to ports!
SSH ist active so port 22 ist open too - else what should be done?

I have no idea, normally, if you have deconz started you should be able to reach phoscon with your browser by navigating to the IP of your RPI

When deconz is running it open itself a port for him, 2 in fact, one for the webapp+API and one for the websocket.
You can see one here https://phoscon.de/discover
It’s the one used for the API and the Webapp.

This direct link can work too if you have discover enabled Phoscon App

As Mimiix have said, you need to “authenticate” the application in phoscon if you are not on the same host.

As command line you can use (IP and PORT are the value displayed on first url, the same used to access phoscon)

curl http://IP:PORT/api/ -X POST -d '{"devicetype": "TestKey"}'

If you have autorisation/authentifiction error, go in phoscon/gateway/advanced/authenticate app and retry the command to have the api key.

More info Getting Started - deCONZ REST-API

1 Like