Skip to content

PHP library to wrap coap-client commands to control ikea tradfri hub

License

Notifications You must be signed in to change notification settings

WebProject-xyz/ikea-tradfri-php

Repository files navigation

ikea-tradfri-api

PHP api to control Ikea smart lights (tradfri)


Inspired by

hvanderlaan/ikea-smartlight Python

Status

Main

Codacy Badge Cocdeception Maintainability Test Coverage codecov StyleCI

Develop

Cocdeception Codacy Security Scan codecov StyleCI

Requirements and initial setup

see requirements.md

How to use

Docker Coap-Client

Get client

https://hub.docker.com/r/webproject/coap-client

docker pull webproject/coap-client:latest

Run command in Docker

Generate API User and <COAP_API_KEY> (Shared Key)

docker run --rm --name coap-client webproject/coap-client -m post -u "Client_identity" -k "<COAP_GATEWAY_SECRET>" -e '{"9090":"php-api-user"}' "coaps://<COAP_GATEWAY_IP>:5684/15011/9063""

Get all api endpoints

docker run --rm --name coap-client webproject/coap-client -m get -u "php-api-user"  -k "<COAP_API_KEY>" "coaps://<COAP_GATEWAY_IP>:5684/.well-known/core"