2/ Once connected my first aim is to retrieve a state from a sensor.
Naively i suppose i can get the logs or events or functions of the manufacturer, then map them to the ST smartapp then to the DTH if i amright ?
It looks like you have picked out a âDirectly Connectedâ device. In ST terms that is really about having devices based on microcontrollers communicating directly with the ST cloud using MQTT.
What you are describing sounds more like a âCloud Connectedâ device in ST terms and I think you might want in particular to investigate the âSchemaâ connection as that is all about creating a mapping to a third party API.
What you probably need to do is to stop thinking about device handlers in the DTH sense. The legacy DTH model is very much about integrating devices that attach via the hub using Zigbee, Z-Wave or indeed using LAN connections. It could be (ab)used to handle cloud connections and direct connections to more intelligent devices but it was never the most elegant solution. There will be a replacement for device handlers and I would imagine the basic concepts will remain, but it doesnât make sense applying them for device integrations that donât go anywhere near a hub.
Hi, @mattrix! If you choose the path of ST Schema (cloud-connected device), hereâs a post that can help you begin with this kind of integration. Either way, Iâll be around in case you have any questions.
I am so gratefull you pointed that tutorial, however i get some newbee error.
Let me reexplain my aim is to switch on/off a smart plug that is cloud connected to smartlife app.
So i followed this tutorial and i could see my created device in the ST->My Testing Devices
When i click it, i choose a room, then i get a blank screen âCannot GET /oauth/loginâ with the url of the remixed glitch app at the top of the window.
Hi, @mattrix! Donât worry, here we support each other.
At the Schema Connector (server.js, line 22), there is a comparison to validate the ACCESS_TOKEN_PREFIX as follows:
As you configured this variable only in the OAuth server, the generated token has this prefix but itâs not recognized by the connector because it has an empty value. They must match to pass the validation.
No problem, the picture below is your environment variables configuration at the OAuth Server, I was wrong before, the one with an empty value for the ACCESS_TOKEN_PREFIX is that one.
This server generates a Token to validate the access, a random String, for example, ghueo. As the Schema Connector has this prefix configured, it is expecting something like: B71325EF:ghueo.
If you add the same value (marked in red), the OAuth process should be successful.