@abstract-entity/node-red-oklyn 中文文档教程

发布于 3年前 浏览 19 项目主页 更新于 3年前

node-red-oklyn

这套node-red节点与oklyn cloud API通信,如果你喜欢我的作品可以给我留言,star github repo and/or buy me a coffee it always pleasant

给我买杯咖啡

preview

Install

使用 Node-RED 编辑器菜单中的管理调色板选项,或者在您的Node-RED 用户目录 - 通常为“~/.node-red”

npm i @abstract-entity/node-red-oklyn

Flow example

下面的链接向您展示了每个带有手动触发器的 oklyn 节点的实现

Flow example


API Usage

Configuration

要找到您的 api 密钥,请按照以下步骤操作:

  1. Open your Oklyn mobile app, and go to 'my account'
  2. Open 'API Access' at the bottom of page
  3. Activate API access
  4. Copy your API key

api-key-conf

在 node-red 配置中添加你的 api key:

  1. Drag any oklyn node in your flow panel
  2. Double click the node
  3. For the 'Config' property select 'Add new oklyn-config', then click the 'edit pen'
  4. Paste your API key in 'Api key' peroperty, then click add

List devices

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call

Payload Input

  • No particular payload required

< strong>有效载荷输出

  • 输出

    [ {"id":228,"用户名":"第一个游泳池"}, {"id":229,"username":"二级家庭游泳池"}, {"id":230,"用户名":"第三游泳池"} ]

Read measures

配置

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id
  • Measure (required): Name of the measure to read, can be: air, water, ph, or orp

Oklyn-conf

有效载荷输入

  • 没有预期的特定有效载荷输入.

  • 您可以覆盖节点的设备 ID,方法是将其添加到 msg.deviceId(在有效负载之外)

    { “设备编号”:228 }

device-id-conf

有效载荷输出

  • 输出

    { “记录”:“2022-03-06T13:45:04+00:00”, “价值”:8.61, “状态”:“危险”, “原始值”:8.61 }

Read pump state

配置

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

负载输入

  • 没有预期的特定负载输入。

  • 您可以覆盖节点的设备 ID,方法是将其添加到 msg.deviceId(在有效负载之外)

    { “设备编号”:228 }

负载输出

  • 输出

    { “泵”:“自动”, “状态”:“关闭”, “changed_at”:“2022-03-07T05:00:01+00:00” }

Write pump state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • 您可以通过以下值更改泵的状态:on、off、auto

    { “泵”:“自动” )

  • 您可以覆盖节点的设备 ID,方法是将其添加到 msg.deviceId(在有效负载之外

    { “设备编号”:228 }

负载输出

  • 输出

    { “泵”:“自动”, “状态”:“关闭”, “changed_at”:“2022-03-07T05:00:01+00:00” }

Read auxiliary contact state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • 您可以覆盖节点的设备 ID,方法是将其添加到 msg.deviceId(在有效负载之外)

    { “设备编号”:228 }

负载输出

  • 输出

    { “辅助”:“关闭”, “状态”:“关闭”, “changed_at”:“2022-03-07T08:49:40+00:00” }

Write auxiliary contact state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • 您可以通过以下值更改辅助触点的状态:on、off

    { “辅助”:“关闭” )

  • 您可以覆盖节点的设备 ID,方法是将其添加到 msg.deviceId(在有效负载之外

    { “设备编号”:228 }

负载输出

  • 输出

    { “辅助”:“关闭”, “状态”:“关闭”, “changed_at”:“2022-03-07T08:49:40+00:00” }

node-red-oklyn

This set of node-red nodes communicate with oklyn cloud API, if you like my work you can leave me a message, star github repo and/or buy me a coffee it's always pleasant

Buy Me A Coffee

preview

Install

Either use the Manage Palette option in the Node-RED Editor menu, or run the following command in your Node-RED user directory - typically '~/.node-red'

npm i @abstract-entity/node-red-oklyn

Flow example

Link below show you an implementation of each oklyn node with manual trigger

Flow example


API Usage

Configuration

To find your api key follow this steps:

  1. Open your Oklyn mobile app, and go to 'my account'
  2. Open 'API Access' at the bottom of page
  3. Activate API access
  4. Copy your API key

api-key-conf

To add your api key in node-red configuration:

  1. Drag any oklyn node in your flow panel
  2. Double click the node
  3. For the 'Config' property select 'Add new oklyn-config', then click the 'edit pen'
  4. Paste your API key in 'Api key' peroperty, then click add

List devices

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call

Payload Input

  • No particular payload required

Payload output

  • output

    [ {"id":228,"username":"first swimming pool"}, {"id":229,"username":"Secondary home swimming pool"}, {"id":230,"username":"Third swimming pool"} ]

Read measures

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id
  • Measure (required): Name of the measure to read, can be: air, water, ph, or orp

Oklyn-conf

Payload Input

  • No particular payload input expected.

  • You can override device id of the node, by adding it to msg.deviceId (outside of the payload)

    { "deviceId": 228 }

device-id-conf

Payload output

  • output

    { "recorded": "2022-03-06T13:45:04+00:00", "value": 8.61, "status": "danger", "value_raw": 8.61 }

Read pump state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • No particular payload input expected.

  • You can override device id of the node, by adding it to msg.deviceId (outside of the payload)

    { "deviceId": 228 }

Payload output

  • output

    { "pump": "auto", "status": "off", "changed_at": "2022-03-07T05:00:01+00:00" }

Write pump state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • You can change the state of the pump by following values: on, off, auto

    { "pump": "auto" }

  • You can override device id of the node, by adding it to msg.deviceId (outside of the payload)

    { "deviceId": 228 }

Payload output

  • output

    { "pump": "auto", "status": "off", "changed_at": "2022-03-07T05:00:01+00:00" }

Read auxiliary contact state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • You can override device id of the node, by adding it to msg.deviceId (outside of the payload)

    { "deviceId": 228 }

Payload output

  • output

    { "aux": "off", "status": "off", "changed_at": "2022-03-07T08:49:40+00:00" }

Write auxiliary contact state

Configuration

  • Name (optionnal): Name to display for the node
  • Config (required): Oklyn api key to use for the call
  • Device id (required): Id of the device, if you manage multiple device you can specify the id of device to connect to. if you got only one device use 'my' to select it without knowing id

Payload Input

  • You can change the state of the auxiliary contact by following values: on, off

    { "aux": "off" }

  • You can override device id of the node, by adding it to msg.deviceId (outside of the payload)

    { "deviceId": 228 }

Payload output

  • output

    { "aux": "off", "status": "off", "changed_at": "2022-03-07T08:49:40+00:00" }

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文