OctoPod icon indicating copy to clipboard operation
OctoPod copied to clipboard

Implementation of new Tradfri outlet plugin

Open ScharV opened this issue 4 years ago • 5 comments

Hey @gdombiak there is a new plugin called Ikea tradfri which allows you to switch on and off your printers ikea outlet. Would be nice to do this via octopod too. Plugin: https://github.com/ralmn/OctoPrint-Ikea-tradfri

Best regards ScharV

ScharV avatar May 26 '20 11:05 ScharV

Nice new feature. Do you know how popular is this plugin? This plugin has its own unique API so adding support for it would be more involved. The other power plugins work very similar (since they were done by the same developer) so adding support for them was not much work.

I'm with limited time these days so trying to optimize it. :)

Thanks, Gaston

gdombiak avatar May 26 '20 15:05 gdombiak

Thanks for your fast reply💪🏼 Greetings Marv

ScharV avatar May 26 '20 18:05 ScharV

Hi,

I'm the creator of Tradfri plugin, I'm also interesting with this feature. I don't have time to see how to implement this feature in your app. But if you want my help to add endpoint in the API I can do that ;)

ralmn avatar Jun 21 '20 20:06 ralmn

Hey @ralmn, nice meeting you!! It would be convenient to have the following APIs:

  1. API to get list of devices and their statuses if possible
  2. API to be able to turn on/off and pass name of device. API returns success code or some error code if operation failed.

Thanks, Gaston

gdombiak avatar Jun 22 '20 02:06 gdombiak

Sorry for the delay.

The ikea plugin handle only one plug.

So the two endpoint are :

  • /plugin/ikea_tradfri/state with method GET would return json : { "state": true } or { "state": false }
  • /plugin/ikea_tradfri/state with method POST and body in JSON (header Content-Type: application/json) { "state": true } or { "state": false } : would set the plug state and return json : { "state": true } or { "state": false }

It's on version 1.3.1 (https://github.com/ralmn/OctoPrint-Ikea-tradfri/releases/tag/1.3.1) & commit https://github.com/ralmn/OctoPrint-Ikea-tradfri/commit/12753023a808e9628b5896ffef902dfaa07d9fd7

ralmn avatar Jul 16 '20 22:07 ralmn