An open API service indexing awesome lists of open source software.

https://github.com/webproject-xyz/ikea-tradfri-php

PHP library to wrap coap-client commands to control ikea tradfri hub
https://github.com/webproject-xyz/ikea-tradfri-php

codeception ikea light-controller php smarthome tradfri

Last synced: 22 days ago
JSON representation

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

Awesome Lists containing this project

README

          

# ikea-tradfri-api

> PHP api to control Ikea smart lights (tradfri)

-----

Inspired by

> [hvanderlaan/ikea-smartlight](https://github.com/hvanderlaan/ikea-smartlight) _Python_

## Status

### Main

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a04395190abd4cb1aa4fa9c7c8077810)](https://www.codacy.com/gh/WebProject-xyz/ikea-tradfri-php/dashboard?utm_source=github.com&utm_medium=referral&utm_content=WebProject-xyz/ikea-tradfri-php&utm_campaign=Badge_Grade)
[![Cocdeception](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/cocdeception.yml/badge.svg?branch=master&style=flat)](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/cocdeception.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/c3a38c872794aa6a83c9/maintainability)](https://codeclimate.com/github/WebProject-xyz/ikea-tradfri-php/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c3a38c872794aa6a83c9/test_coverage)](https://codeclimate.com/github/WebProject-xyz/ikea-tradfri-php/test_coverage)
[![codecov](https://codecov.io/gh/WebProject-xyz/ikea-tradfri-php/branch/master/graph/badge.svg)](https://codecov.io/gh/WebProject-xyz/ikea-tradfri-php)
[![StyleCI](https://styleci.io/repos/115823629/shield?branch=master)](https://styleci.io/repos/115823629)

### Develop

[![Cocdeception](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/cocdeception.yml/badge.svg?branch=develop)](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/cocdeception.yml)
[![Codacy Security Scan](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/codacy-analysis.yml/badge.svg)](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/codacy-analysis.yml)
[![codecov](https://codecov.io/gh/WebProject-xyz/ikea-tradfri-php/branch/develop/graph/badge.svg)](https://codecov.io/gh/WebProject-xyz/ikea-tradfri-php)
[![StyleCI](https://styleci.io/repos/115823629/shield?branch=develop)](https://styleci.io/repos/115823629)

### Requirements and initial setup

> see [requirements.md](requirements.md)

## How to use

- [Example config](wiki/example/init-dist.php)
- [wiki/example](wiki/example)

## Docker Coap-Client

### Get client

>

```bash
docker pull webproject/coap-client:latest
```

### Run command in Docker

> Generate API User and (Shared Key)

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

### Get all api endpoints

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