1

Activate Outputs with HTTP queclink

Тема: Activate Outputs with HTTP queclink

Anybody knowns how can I activate outputs over http protocol?

Which method do I need to use? Is on devices API ?

I need to send this command to my GV300 Queclink

AT+GTOUT=gv300,1,,,0,0,0,0,0,0,3,,0,0,,,,FFFF$

Thank you so much.

2

Activate Outputs with HTTP queclink

Re: Activate Outputs with HTTP queclink

chcg710, you may proactively operate with devices via flespi in two ways: on channel level or on device level. In both of this ways you actually do some action via REST API and flespi will queue and deliver your command once device will be connected.

On channel level you do not have to register device on the flespi, so basically just need to send your command to the channel with corresponding ident (device unique identifier). Please see the schema of the queclink protocol commands and you need to call this method via REST. Alternatively you may use protocol REST to fetch all commands available on protocol (you need correct flespi token for this):

curl -X GET --header 'Authorization: FlespiToken XXXX' 'https://flespi.io/gw/protocols/name%3Dqueclink/commands/all'

curl sample of what you need to send command to device on channel level looks like this:

curl -X POST --header 'Content-Type: application/json' --header 'Authorization: FlespiToken XXXX' -d '[{"address":{"ident":"1234567890","type":"connection"},"name":"generic.at","properties":{"password":"gv300","cmd":"GTOUT","payload":"1,,,0,0,0,0,0,0,3,,0,0,,,,FFFF"},"ttl":86400}]' 'https://flespi.io/gw/channels/protocol_name%3Dqueclink/commands-queue'

On device level you may just activate corresponding device setting with REST. In that case you have to register device onto flespi, but this is more interesting as you just operate with device on logical level and do not need to know the actual text of the command. Also flespi can remotely read setting from the device. Actual method described here, schema for settings available here and non-deep-technical description of the feature you read here.

P.S. please note that command name changed from "generic.at" to "at".

Follow us on http://www.facebook.com/Gurtam
And take a look at new IoT backend by Gurtam.
3

Activate Outputs with HTTP queclink

(23/10/2018 04:37:25 отредактировано chcg710)

Re: Activate Outputs with HTTP queclink

Thank you so much.

It works, just one thing.

curl -X POST --header 'Content-Type: application/json' --header 'Authorization: FlespiToken XXXX' -d '[{"address":{"ident":"1234567890","type":"connection"},"name":"generic.at","properties":{"password":"gv300","cmd":"GTOUT","payload":"1,,,0,0,0,0,0,0,3,,0,0,,,,FFFF$"},"ttl":86400}]' 'https://flespi.io/gw/channels/protocol_name%3Dqueclink/commands-queue'

Missed one '$' after FFFF.

4

Activate Outputs with HTTP queclink

Re: Activate Outputs with HTTP queclink

Just to be precise: there is no need to pass ,FFFF$ in command's payload. This is appended by server automatically.
So, in this case payload should be:

"payload":"1,,,0,0,0,0,0,0,3,,0,0,,,"

And the whole command example:

curl -X POST --header 'Content-Type: application/json' --header 'Authorization: FlespiToken XXXX' -d '[{"address":{"ident":"1234567890","type":"connection"},"name":"generic.at","properties":{"password":"gv300","cmd":"GTOUT","payload":"1,,,0,0,0,0,0,0,3,,0,0,,,"},"ttl":86400}]' 'https://flespi.io/gw/channels/protocol_name%3Dqueclink/commands-queue'

P.S. please note that command name changed from "generic.at" to "at".

5

Activate Outputs with HTTP queclink

Re: Activate Outputs with HTTP queclink

namo пишет:

Just to be precise: there is no need to pass ,FFFF$ in command's payload. This is appended by server automatically.
So, in this case payload should be:

"payload":"1,,,0,0,0,0,0,0,3,,0,0,,,"

And the whole command example:

curl -X POST --header 'Content-Type: application/json' --header 'Authorization: FlespiToken XXXX' -d '[{"address":{"ident":"1234567890","type":"connection"},"name":"generic.at","properties":{"password":"gv300","cmd":"GTOUT","payload":"1,,,0,0,0,0,0,0,3,,0,0,,,"},"ttl":86400}]' 'https://flespi.io/gw/channels/protocol_name%3Dqueclink/commands-queue'

P.S. please note that command name changed from "generic.at" to "at".

Developer
flespi team
6

Activate Outputs with HTTP queclink

Re: Activate Outputs with HTTP queclink

More detailed explanation about flespi commands, their JSON scheme and how to use them via API in our knowledge base on channel level and on device settings level.

Follow us on http://www.facebook.com/Gurtam
And take a look at new IoT backend by Gurtam.