myio C API 0.0.1

The myio C API allows you to remotely manage myio devices connected to a myio C.

Operations

Sub status_update

The topic on which slave liveness is reported

Status update

Accepts the following message:

Status update statusUpdate

Inform about the status of a particular slave

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

status
required
string
  • online: The slave is powered on and communicating with a particular myio C
  • offline: Either the slave is unpowered, unreachable or malfunctioning
Enum: "online" "offline"
average_retries
number

If the communication between the myio C and a particular slave experiences difficulties, this reports the average number of retries it took to reestablish communication

Additional properties are allowed.

Examples

statusUpdate
Payload
{
  "id": 0,
  "status": "online",
  "average_retries": 0
}
This example has been generated automatically.

Sub infrared_update

The topic on which a myio remote reports the ambient temperature

Infrared update

Accepts the following message:

Infrared update infraredUpdate

Inform about the status of a particular myio remote

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

temperature
required
number

Ambient temperature measured in Celsius

active
required
boolean

Reports whether a particular myio remote is active (true) or sleeping/unreachable/turned off/etc. (false)

charging
boolean

Reports the battery changing status if a particular myio remote has a built in battery

battery
integer
>= 0 <= 100

Reports the battery level if a particular myio remote has a built in battery

Additional properties are allowed.

Examples

infraredUpdate
Payload
{
  "id": 0,
  "temperature": 0,
  "active": true,
  "charging": true,
  "battery": 0
}
This example has been generated automatically.

Sub consumption

The topic on which energy consumption is reported

Energy consumption update

Accepts the following message:

Consumption update consumptionUpdate

Inform about energy consumption of a given scope

Payload
object
Examples: { "value": 111, "scope": "all" } { "value": 0, "scope": "slave", "id": 121 } { "id": 7, "value": 309, "scope": "slave", "phases": { "a": 109.05882352941177, "b": 198.7294117647059, "c": 0 } }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

value
required
number
>= 0

Real time energy consumption measured in Watts

scope
required
string
  • all: Total consumption from all aggregated slaves registered in a given myio C
  • slave: The reported consumption from all channels of a given slave, regardless of its value being aggregrated within the all scope or not. i.e. a myio switch reports a single value which accounts for the measured consumption from both of its channels
Enum: "all" "slave"
phases
object

If a particular slave has tree-phase measurement capability (such as the myio medidor), each phase is measured individually

a
number
>= 0

Real time energy consumption measured in Watts

b
number
>= 0

Real time energy consumption measured in Watts

c
number
>= 0

Real time energy consumption measured in Watts

Additional properties are allowed.

Additional properties are allowed.

Examples

consumptionUpdate
Payload
Example #1
{
  "value": 111,
  "scope": "all"
}
Example #2
{
  "value": 0,
  "scope": "slave",
  "id": 121
}
Example #3
{
  "id": 7,
  "value": 309,
  "scope": "slave",
  "phases": {
    "a": 109.05882352941177,
    "b": 198.7294117647059,
    "c": 0
  }
}

Sub user_action

The topic on which human actions such as toggling a light switch are reported

User action

Accepts the following message:

User action userAction

Inform about manual human interactions

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

user
required
string
uuid

User universally unique identifier. Validated by the myio cloud

command
required
string

The action executed by the user

Enum: "light_control"

Additional properties are allowed.

Examples

userAction
Payload
{
  "id": 0,
  "user": "750E6C87-5959-47CC-A922-A1A97F0FB879",
  "command": "light_control"
}
This example has been generated automatically.

Sub channel_update

The topic on which switch state changes are reported

Slave channel update

Accepts the following message:

Channel update channelUpdate

Inform about state changes of a particular slave channel

Payload
object
Examples: { "id": 11, "channels": [ { "value": 100, "id": 0 }, { "value": 100, "id": 1 } ] }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channels
required
array<object>

Items:

0
object
id
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

value
integer
>= 0 <= 100

Meaning varies depending on the channel_type, as follows:

  • dimmer: 0 -> off; dimmable output from 1 to 100 percent
  • flow_sensor: Use the pulse_updates topic instead
  • door_sensor: 0 -> open; 100 -> closed
  • presence_sensor: 0 -> idle; 100 -> presense detected
  • light_sensor: 0 -> dark environment; 100 -> enough light detected
  • smoke_sensor: 0 -> idle; 100 -> smoke detected

Unless otherwise specified, 0 means off and 100 means on; no values in between are allowed unless the channel_type supports it, such as dimmer.

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

Examples

channelUpdate
Payload
Example #1
{
  "id": 11,
  "channels": [
    {
      "value": 100,
      "id": 0
    },
    {
      "value": 100,
      "id": 1
    }
  ]
}

Sub temperature_update

The topic on which measured ambient temperature is reported

Temperature update

Accepts the following message:

Temperature update temperatureUpdate

Inform about the environment temperate where a particular slave is located

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

value
required
number

Ambient temperature measured in Celsius

Additional properties are allowed.

Examples

temperatureUpdate
Payload
{
  "id": 0,
  "value": 0
}
This example has been generated automatically.

Sub infrared_detection

The topic on which IR/RF signal detection is reported

IR/RF signal detection

Accepts the following message:

Detection of IR/RF signal infraredDetection

Inform about IR/RF signal detection where a particular myio remote is located

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

Additional properties are allowed.

Examples

infraredDetection
Payload
{
  "id": 0
}
This example has been generated automatically.

Sub pulse_update

The topic on which detected pulses are reported

Pulse update

Accepts the following message:

Pulse update pulseUpdate

Inform about detected pulses of a particular slave channel

Payload
object
Examples: { "id": 210, "channels": [ { "id": 0, "last_pulses": [ { "value": 2, "timestamp": "2020-06-30 20:00:00" }, { "value": 3, "timestamp": "2020-06-30 21:00:00" }, { "value": 23, "timestamp": "2020-06-30 23:00:00" }, { "value": 21, "timestamp": "2020-07-01 17:00:00" } ] }, { "id": 1, "last_pulses": [ { "value": 2, "timestamp": "2020-06-30 20:00:00" }, { "value": 0, "timestamp": "2020-06-30 21:00:00" }, { "value": 53, "timestamp": "2020-06-30 23:00:00" }, { "value": 20, "timestamp": "2020-07-01 17:00:00" } ] } ] }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channels
required
array<object>

Slave channels which are recording pulses

Items:

0
object
id
required
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

last_pulses
required
array<object>
<= 30 items

Up to the last 30 hours of pulse count measurement, aggregated by hour

Items:

0
object

Amount of pulses recorded in a hour

timestamp
required
string
date-time

UTC time reference

value
required
integer

Pulse count. This value is not cumulative between hours

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

Examples

pulseUpdate
Payload
Example #1
{
  "id": 210,
  "channels": [
    {
      "id": 0,
      "last_pulses": [
        {
          "value": 2,
          "timestamp": "2020-06-30 20:00:00"
        },
        {
          "value": 3,
          "timestamp": "2020-06-30 21:00:00"
        },
        {
          "value": 23,
          "timestamp": "2020-06-30 23:00:00"
        },
        {
          "value": 21,
          "timestamp": "2020-07-01 17:00:00"
        }
      ]
    },
    {
      "id": 1,
      "last_pulses": [
        {
          "value": 2,
          "timestamp": "2020-06-30 20:00:00"
        },
        {
          "value": 0,
          "timestamp": "2020-06-30 21:00:00"
        },
        {
          "value": 53,
          "timestamp": "2020-06-30 23:00:00"
        },
        {
          "value": 20,
          "timestamp": "2020-07-01 17:00:00"
        }
      ]
    }
  ]
}

Pub channel_control

The topic on which slave channels can be controlled

Accepts the following message:

Channel control channelControl

Command a particular slave channel to change its value

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channel
required
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

value
required
integer
>= 0 <= 100

Meaning varies depending on the channel_type, as follows:

  • dimmer: 0 -> off; dimmable output from 1 to 100 percent
  • flow_sensor: Use the pulse_updates topic instead
  • door_sensor: 0 -> open; 100 -> closed
  • presence_sensor: 0 -> idle; 100 -> presense detected
  • light_sensor: 0 -> dark environment; 100 -> enough light detected
  • smoke_sensor: 0 -> idle; 100 -> smoke detected

Unless otherwise specified, 0 means off and 100 means on; no values in between are allowed unless the channel_type supports it, such as dimmer.

Additional properties are allowed.

Examples

channelControl
Payload
{
  "id": 0,
  "channel": 0,
  "value": 0
}
This example has been generated automatically.

Sub timeout

The topic on which command timeouts are reported

Command timeout

Accepts the following message:

Command timeout timeout

Inform about when a particular slave has not responded to a given command

Payload
object

Given slave commands are processed synchronously, that is, once an attempt to control a particular slave is made such as by using the channel_control topic, further attempts to control that particular slave get queued (FIFO) within the myio C, enabling one to infer which command returned a timeout by keeping track of the order they were sent

id
required
integer
>= 0

Slave identifier unique to a particular myio C

Additional properties are allowed.

Examples

timeout
Payload
{
  "id": 0
}
This example has been generated automatically.

Sub current_update

The topic on which energy current is reported

Energy current update

Accepts the following message:

Current update currentUpdate

Inform about energy current measurement of a particular slave

Payload
object
  • total_current: Total consumption from all phases (a + b + c)
  • a, b and c: The measured consumption for a particular phase
Examples: { "total_current": 3611, "id": 7, "c": 0, "b": 1472.721568627451, "a": 2124.1176470588234 }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

total_current
required
number
>= 0

Real time energy consumption measured in milliampere

a
number
>= 0

Real time energy consumption measured in milliampere

b
number
>= 0

Real time energy consumption measured in milliampere

c
number
>= 0

Real time energy consumption measured in milliampere

Additional properties are allowed.

Examples

currentUpdate
Payload
Example #1
{
  "total_current": 3611,
  "id": 7,
  "c": 0,
  "b": 1472.721568627451,
  "a": 2124.1176470588234
}

Sub voltage_update

The topic on which energy tension and power factor are reported

Energy tension and power factor update

Accepts the following message:

Tension and power factor update tensionUpdate

Inform about energy tension along with the power factor measurements of a particular slave

Payload
object
Examples: { "voltage": { "c": 0, "b": 0, "a": 123 }, "id": 7, "fp": { "c": 0, "b": 0, "a": 191 } }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

voltage
required
object
a
number
>= 0

Real time energy consumption measured in Volts

b
number
>= 0

Real time energy consumption measured in Volts

c
number
>= 0

Real time energy consumption measured in Volts

Additional properties are allowed.

fp
required
object
a
number

Instantanous Power Factor once divided by 255

b
number

Instantanous Power Factor once divided by 255

c
number

Instantanous Power Factor once divided by 255

Additional properties are allowed.

Additional properties are allowed.

Examples

tensionUpdate
Payload
Example #1
{
  "voltage": {
    "c": 0,
    "b": 0,
    "a": 123
  },
  "id": 7,
  "fp": {
    "c": 0,
    "b": 0,
    "a": 191
  }
}

Messages

#1 Status update statusUpdate

Inform about the status of a particular slave

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

status
required
string
  • online: The slave is powered on and communicating with a particular myio C
  • offline: Either the slave is unpowered, unreachable or malfunctioning
Enum: "online" "offline"
average_retries
number

If the communication between the myio C and a particular slave experiences difficulties, this reports the average number of retries it took to reestablish communication

Additional properties are allowed.

#2 Infrared update infraredUpdate

Inform about the status of a particular myio remote

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

temperature
required
number

Ambient temperature measured in Celsius

active
required
boolean

Reports whether a particular myio remote is active (true) or sleeping/unreachable/turned off/etc. (false)

charging
boolean

Reports the battery changing status if a particular myio remote has a built in battery

battery
integer
>= 0 <= 100

Reports the battery level if a particular myio remote has a built in battery

Additional properties are allowed.

#3 Consumption update consumptionUpdate

Inform about energy consumption of a given scope

Payload
object
Examples: { "value": 111, "scope": "all" } { "value": 0, "scope": "slave", "id": 121 } { "id": 7, "value": 309, "scope": "slave", "phases": { "a": 109.05882352941177, "b": 198.7294117647059, "c": 0 } }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

value
required
number
>= 0

Real time energy consumption measured in Watts

scope
required
string
  • all: Total consumption from all aggregated slaves registered in a given myio C
  • slave: The reported consumption from all channels of a given slave, regardless of its value being aggregrated within the all scope or not. i.e. a myio switch reports a single value which accounts for the measured consumption from both of its channels
Enum: "all" "slave"
phases
object

If a particular slave has tree-phase measurement capability (such as the myio medidor), each phase is measured individually

a
number
>= 0

Real time energy consumption measured in Watts

b
number
>= 0

Real time energy consumption measured in Watts

c
number
>= 0

Real time energy consumption measured in Watts

Additional properties are allowed.

Additional properties are allowed.

#4 User action userAction

Inform about manual human interactions

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

user
required
string
uuid

User universally unique identifier. Validated by the myio cloud

command
required
string

The action executed by the user

Enum: "light_control"

Additional properties are allowed.

#5 Channel update channelUpdate

Inform about state changes of a particular slave channel

Payload
object
Examples: { "id": 11, "channels": [ { "value": 100, "id": 0 }, { "value": 100, "id": 1 } ] }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channels
required
array<object>

Items:

0
object
id
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

value
integer
>= 0 <= 100

Meaning varies depending on the channel_type, as follows:

  • dimmer: 0 -> off; dimmable output from 1 to 100 percent
  • flow_sensor: Use the pulse_updates topic instead
  • door_sensor: 0 -> open; 100 -> closed
  • presence_sensor: 0 -> idle; 100 -> presense detected
  • light_sensor: 0 -> dark environment; 100 -> enough light detected
  • smoke_sensor: 0 -> idle; 100 -> smoke detected

Unless otherwise specified, 0 means off and 100 means on; no values in between are allowed unless the channel_type supports it, such as dimmer.

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

#6 Temperature update temperatureUpdate

Inform about the environment temperate where a particular slave is located

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

value
required
number

Ambient temperature measured in Celsius

Additional properties are allowed.

#7 Detection of IR/RF signal infraredDetection

Inform about IR/RF signal detection where a particular myio remote is located

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

Additional properties are allowed.

#8 Pulse update pulseUpdate

Inform about detected pulses of a particular slave channel

Payload
object
Examples: { "id": 210, "channels": [ { "id": 0, "last_pulses": [ { "value": 2, "timestamp": "2020-06-30 20:00:00" }, { "value": 3, "timestamp": "2020-06-30 21:00:00" }, { "value": 23, "timestamp": "2020-06-30 23:00:00" }, { "value": 21, "timestamp": "2020-07-01 17:00:00" } ] }, { "id": 1, "last_pulses": [ { "value": 2, "timestamp": "2020-06-30 20:00:00" }, { "value": 0, "timestamp": "2020-06-30 21:00:00" }, { "value": 53, "timestamp": "2020-06-30 23:00:00" }, { "value": 20, "timestamp": "2020-07-01 17:00:00" } ] } ] }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channels
required
array<object>

Slave channels which are recording pulses

Items:

0
object
id
required
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

last_pulses
required
array<object>
<= 30 items

Up to the last 30 hours of pulse count measurement, aggregated by hour

Items:

0
object

Amount of pulses recorded in a hour

timestamp
required
string
date-time

UTC time reference

value
required
integer

Pulse count. This value is not cumulative between hours

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

Additional items are allowed.

Additional properties are allowed.

#9 Channel control channelControl

Command a particular slave channel to change its value

Payload
object
id
required
integer
>= 0

Slave identifier unique to a particular myio C

channel
required
integer
>= 0

The channel id. Unique to the slave it belongs to, not global

value
required
integer
>= 0 <= 100

Meaning varies depending on the channel_type, as follows:

  • dimmer: 0 -> off; dimmable output from 1 to 100 percent
  • flow_sensor: Use the pulse_updates topic instead
  • door_sensor: 0 -> open; 100 -> closed
  • presence_sensor: 0 -> idle; 100 -> presense detected
  • light_sensor: 0 -> dark environment; 100 -> enough light detected
  • smoke_sensor: 0 -> idle; 100 -> smoke detected

Unless otherwise specified, 0 means off and 100 means on; no values in between are allowed unless the channel_type supports it, such as dimmer.

Additional properties are allowed.

#10 Command timeout timeout

Inform about when a particular slave has not responded to a given command

Payload
object

Given slave commands are processed synchronously, that is, once an attempt to control a particular slave is made such as by using the channel_control topic, further attempts to control that particular slave get queued (FIFO) within the myio C, enabling one to infer which command returned a timeout by keeping track of the order they were sent

id
required
integer
>= 0

Slave identifier unique to a particular myio C

Additional properties are allowed.

#11 Current update currentUpdate

Inform about energy current measurement of a particular slave

Payload
object
  • total_current: Total consumption from all phases (a + b + c)
  • a, b and c: The measured consumption for a particular phase
Examples: { "total_current": 3611, "id": 7, "c": 0, "b": 1472.721568627451, "a": 2124.1176470588234 }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

total_current
required
number
>= 0

Real time energy consumption measured in milliampere

a
number
>= 0

Real time energy consumption measured in milliampere

b
number
>= 0

Real time energy consumption measured in milliampere

c
number
>= 0

Real time energy consumption measured in milliampere

Additional properties are allowed.

#12 Tension and power factor update tensionUpdate

Inform about energy tension along with the power factor measurements of a particular slave

Payload
object
Examples: { "voltage": { "c": 0, "b": 0, "a": 123 }, "id": 7, "fp": { "c": 0, "b": 0, "a": 191 } }
id
required
integer
>= 0

Slave identifier unique to a particular myio C

voltage
required
object
a
number
>= 0

Real time energy consumption measured in Volts

b
number
>= 0

Real time energy consumption measured in Volts

c
number
>= 0

Real time energy consumption measured in Volts

Additional properties are allowed.

fp
required
object
a
number

Instantanous Power Factor once divided by 255

b
number

Instantanous Power Factor once divided by 255

c
number

Instantanous Power Factor once divided by 255

Additional properties are allowed.

Additional properties are allowed.