Closed novski closed 6 years ago
@novski This is only for adding native Web Things that conform to the WoT spec. Anything else requires a separate adapter.
@novski Well. From what i can see in their REST-API documentation, it just does not conform with the WOT-API that the thing-url-adapter is expecting.
When you call the /toggle
ressource it toggles (because that is what the switch does when that ressource is called), but the response is not WOT conform (https://iot.mozilla.org/wot/#thing-resource).
There is nothing we can do from here. You can write your own adapter(which then runs on the Gateway), that wrapps the switch API into a WOT confrom response. That way you could get it to work properly. Examples/Tutorial: https://hacks.mozilla.org/2018/02/creating-an-add-on-for-the-project-things-gateway/ https://hacks.mozilla.org/2018/02/making-a-clap-sensing-web-thing/ https://github.com/mozilla-iot/example-adapter
Adding myStrom device with REST API using the things/+/Add by URL.. link and typing the API URL:![bildschirmfoto 2018-04-26 um 09 44 48](https://user-images.githubusercontent.com/6088056/39292461-8a186e62-4936-11e8-97ab-d4568b32c92c.png)
http://192.168.178.77/toggle
shows a error:Invalid thing description
that prevents me from saving that thing. Althroug it switches perfectly if i press the submit button.The device has a simple (to simple?) API that is described here: https://mystrom.ch/de/mystrom-for-developers/ and the dedicated API-description file is this: https://mystrom.ch/wp-content/uploads/REST_API_SWI.txt