This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Resources

resources

Resources are the key components in MyController.

Gateway

Gateway is the entry and exit point in MyController. It connects your network and MyController.

Node

Node is a kind of end point in the sensor world.

Source

Source is a single or group of fields

Field

Field is a final measurement point

Example

  • Take a couple ESP8266 boards
  • Those ESP8266 boards can be operated via MQTT protocol
  • Each board has sensors like, temperature, humidity, relay, push button, etc.,
  • Now relate with MyController resources
    • All the boards can be connected via MQTT to MyController - is called gateway
    • A board is a endpoint - is called node
    • temperature, humidity, etc., measurements are called field
    • group of fields or a single field goes under a source

1 - Gateway

MyController supports different type of providers network.
Each network can be connected to MyController via a gateway.
Gateway can be added/updated/deleted from the Resources >> Gateway page

Supported Providers list

Common Configurations

  • Form View gateway-settings

  • YAML View

    id: mysensor # (1)
    description: MySensors gateway # (2)
    enabled: true # (3)
    reconnectDelay: 15s # (4)
    labels: # (5)
      location: core # (6)
    
    1. id of the gateway. You cannot modify this field later
    2. description of the gateway
    3. enabled - You can enable or disable to disconnect from provider network.
    4. reconnectDelay - if the gateway disconnected from the provider network for some reason, will be reconnected automatically after this delay
    5. labels - labels are a key value pair used across the system
    6. labels.location this is a kind of filter used to restrict to run this gateway to a specific location(s)

Power of the labels

We can restrict to load a gateway to the specific host.

For example you are running gateway service on multiple hosts and all the gateway service connected to MyController via message bus. you have connected a serial port on Host B. When you add a gateway configuration on MyController, it sends the configuration details to all the gateway listener services. So all the gateway listeners are try to look that serial port on their hosts. expect from Host B all other gateway reports failed to load. To avoid these kind of situation, we have introduced labels. When we start a gateway service on a host, include label based filter. That gateway service listens only it is own configuration.

gateway setup

In the above setup, if we include labels as location=gw2 on the configuration, It loads on the Host C gateway service. Other gateways from the different hosts will ignore this configuration.

Provider Configurations

Message Logger Configurations

Message logger is recording received and transmitted messages.

Type of Message Logger

  • None - disable message logging system
  • File Logger - records the messages into a file (disk)
  • Form View gateway-settings

  • YAML View

     messageLogger:
      type: file_logger # (1)
      flushInterval: 5s # (2)
      logRotateInterval: 6h # (3)
      maxSize: 1MiB # (4)
      maxAge: 24h # (5)
      maxBackup: 3 # (6)
    
    1. messageLogger.type message logger type. support file_logger and none
    2. messageLogger.flushInterval how long once received message to be dumped to disk from memory
    3. messageLogger.logRotateInterval creates new file after this interval
    4. messageLogger.maxSize if the size reaches the maxSize, creates new file
    5. messageLogger.maxAge if the age reaches the maxAge, creates new file
    6. messageLogger.maxBackup retention files count

2 - MySensors

MySensors is an open source hardware and software community focusing on do-it-yourself home automation and Internet of Things. To know more about MySensors network follow this link

Provider Specific key points

  • In a network MySensors can have maximum of 254 nodes
  • node id 0 is always a gateway node
  • node id 1 to 254 can be allocatable to any node
  • Supported features in MyController
    • OTAfeatures / Firmware update
    • reboot a node
    • reset a node
    • get a node info
    • discover nodes
    • Heartbeat request
    • Response to internal message like I_TIME, I_CONFIG, I_ID_REQUEST
    • Assigns NodeId if nodeId set as AUTO on a node

Not implemented / supported features (that is supported on MyController 1.x)

  • Handle sleeping nodes
  • There is no node alive check

Common Configuration

  • Form view gateway-mysensors-provider

  • YAML View

    provider:
      type: mysensors_v2 # (1)
      enableInternalMessageAck: true # (2)
      enableStreamMessageAck: false # (3)
      retryCount: 3 # (4)
      timeout: 1s # (5)
    
    1. type should be selected as mysensors_v2
    2. enableInternalMessageAck enable acknowledgement for internal messages
    3. enableStreamMessageAck enable acknowledgement for streaming messages. ie: OTA/firmware messages
    4. retryCount - if do not receive the acknowledgement on the specified timeout, keeps resend the message till it reaches the retryCount
    5. timeout - wait for the acknowledgement till this timeout

Protocols

MySensors gateway supports the following protocols

Protocol Configuration - MQTT

  • Form view gateway-mysensors

  • YAML View

    provider:
      protocol:
        type: mqtt # (1)
        transmitPreDelay: 15ms # (2)
        broker: tcp://192.168.1.21:1883 # (3)
        insecureSkipVerify: false # (4)
        username: '' # (5)
        password: '' # (6)
        subscribe: out_rfm69/# # (7)
        publish: in_rfm69 # (8)
        qos: 0 # (9)
    
    1. type type of the protocol. here it should be mqtt
    2. transmitPreDelay - wait till this time to avoid collision and sends the data to provider network
    3. broker mqtt broker url
    4. insecureSkipVerify if you want to skip the insecure ssl, enable this option
    5. username username of the mqtt broker. if it is anonymous leave it as a blank
    6. password if username supplied, password should be supplied. otherwise leave it as a blank
    7. subscribe topic to be subscribed to get messages from MySensors gateway
    8. publish topic to be used to post data from MyController to MySensors network
    9. qos MQTT qos

Protocol Configuration - Serial

  • Form view gateway-mysensors-serial

  • YAML View

    provider:
      protocol:
        type: serial # (1)
        transmitPreDelay: 15ms # (2)
        portname: /dev/ttyUSB0 # (3)
        baudrate: 115200 # (4)
    
    1. type of the protocol. here it should be serial
    2. transmitPreDelay - wait till this time to avoid collision and sends the data to provider network
    3. portname name of the serial port
    4. baudrate baud rate of the serial port

Protocol Configuration - Ethernet

  • Form view gateway-mysensors-serial

  • YAML View

    provider:
      protocol:
        type: ethernet # (1)
        transmitPreDelay: 15ms # (2)
        server: tcp://192.168.1.42:5000 # (3)
        insecureSkipVerify: false # (4)
    
    1. type of the protocol. here it should be ethernet
    2. transmitPreDelay - wait till this time to avoid collision and sends the data to provider network
    3. server ethernet server address with port
    4. insecureSkipVerify if you want to skip the insecure ssl, enable this option

3 - Tasmota

Tasmota is an Open source firmware for ESP8266 devices

Common Configuration

  • Form view gateway-provider-tasmota

  • YAML View

    provider:
      type: tasmota # (1)
    
    1. type should be selected as tasmota

Protocols

Tasmota gateway supports the following protocols

Protocol Configuration - MQTT

  • Form view gateway-tasmota-mqtt

  • YAML View

    provider:
      protocol:
        type: mqtt # (1)
        transmitPreDelay: 15ms # (2)
        broker: tcp://192.168.1.21:1883 # (3)
        insecureSkipVerify: false # (4)
        username: '' # (5)
        password: '' # (6)
        subscribe: jktasmota/# # (7)
        publish: jktasmota # (8)
        qos: 0 # (9)
    
    1. type type of the protocol. here it should be mqtt
    2. transmitPreDelay - wait till this time to avoid collision and sends the data to provider network
    3. broker mqtt broker url
    4. insecureSkipVerify if you want to skip the insecure ssl, enable this option
    5. username username of the mqtt broker. if it is anonymous leave it as a blank
    6. password if username supplied, password should be supplied. otherwise leave it as a blank
    7. subscribe topic to be subscribed to get messages from MySensors gateway
    8. publish topic to be used to post data from MyController to MySensors network
    9. qos MQTT qos

MQTT configuration on the Tasmota node

tasmota-node

The following changes needs to be updated on the Tasmota node MQTT settings to connect with MyController

  • Topic - should be updated as tasmota_%06X
  • Full Topic - should be updated as jktasmota/%prefix%/%topic%/
    • here jktasmota can be any name, should be in lowercase and special characters are not allowed

To know more about MQTT settings on Tasmota follow this guide

4 - PhilipsHue

PhilipsHue is smart home lighting.
To know more about PhilipsHue developer API follow this link

Configuration

  • Form view gateway-philipshue

  • YAML View

    provider:
      type: philips_hue # (1)
      host: http://192.168.1.34:80 # (2)
      username: myhueuser # (3)
      syncInterval: 10m # (4)
      bridgeSyncInterval: 10m # (5)
    
    1. type should be selected as philips_hue
    2. host - PhilipsHue bridge address to communicate
    3. username of the PhilipsHue bridge
    4. syncInterval - polls the connected devices status from the PhilipsHue bridge
    5. bridgeSyncInterval - gets the PhilipsHue bridge configurations on this interval

5 - System Monitoring

System Monitoring is an internal plugin developed and maintained by MyController

Configuration

  • Form view gateway-system-monitoring
  • YAML View
    provider:
      type: system_monitoring # (1)
      hostIdMap: {} # (2)
      hostConfigMap: {} # (3)
    
    1. type should be selected as system_monitoring
    2. hostIdMap - is a group of key value map
    3. hostConfigMap configurations of monitoring resources

Host ID Map Configuration

Host ID Map (hostIdMap) is used to map the real host id with a friendly name

Samples:

be0164ad-6f25-4448-b691-567946392b47: rpi_1
a574ac8d-4c9f-40d6-b0ce-bbc7d98cd87d: rpi_2

Here be0164ad-6f25-4448-b691-567946392b47 is the actual id of the host and it is mapped with rpi_1. If data received from this node, The node name will be as rpi_1

Host Config Map Configuration

Host Config Map (hostConfigMap) is used to configure a specific node(s)

rpi_1: # (1)
  disabled: false # (2)
  cpu: # (3)
    interval: 1m
    cpuDisabled: false
    perCpuDisabled: false
  disk: # (4)
    interval: 1h
    disabled: false
    data:
      disk_root:
        disabled: false
        name: "Root"
        path: /root
        unit: MiB
      disk_storage:
        disabled: false
        name: "Storage"
        path: /storage
        unit: MiB
  memory: # (5)
    interval: 1m
    memoryDisabled: false
    swapMemoryDisabled: false
    unit: MiB
  process: # (6)
    interval: 1m
    disabled: false
    data:
      influxd:
        disabled: false
        name: "InfluxDB"
        unit: MiB
        filter:
          cmdline: influxd
      adguard:
        disabled: false
        name: "AdGuard"
        unit: MiB
        filter:
          cmdline: >-
            /opt/adguardhome/AdGuardHome --no-check-update -c
            /opt/adguardhome/conf/AdGuardHome.yaml -h 0.0.0.0 -w
            /opt/adguardhome/work            
      mycontroller:
        disabled: false
        name: "MyController"
        unit: MiB
        filter:
          cmdline: /app/mycontroller-all-in-one -config /app/mycontroller.yaml
      natsio:
        disabled: false
        name: "NatsIO"
        unit: MiB
        filter:
          cmdline: nats-server --config /etc/nats/nats-server.conf
      proc_gw:
        disabled: false
        name: "MYC GW"
        unit: MiB
        filter:
          cmdline: ./mycontroller-gateway -config gateway.yaml
  temperature: # (7)
    disabledAll: false
    interval: 30s
    enabled: []
rpi_2: # (1)
  cpu:
    # ...
  1. node_id - id of the node or host
  2. disabled - set true to disable data from this node. default value: false
  3. cpu configurations
  4. disk configurations
  5. memory configurations
  6. process configurations
  7. temperature configurations

CPU Configurations

cpu:
  interval: 1m # (1)
  cpuDisabled: false # (2)
  perCpuDisabled: false # (3)
  1. interval - metric measurement interval
  2. cpuDisabled - disable overall CPU metrics data
  3. perCpuDisabled - disable individual CPU(s) metrics data

Disk Configurations

disk:
  interval: 1h # (1)
  disabled: false # (2)
  data: # (3)
    disk_root: # (4)
      disabled: false # (5)
      name: "Root" # (6)
      path: /root # (7)
      unit: MiB # (8)
    disk_storage:
      disabled: false
      name: "Storage"
      path: /storage
  1. interval - metric measurement interval
  2. disabled - disable the all the disk metrics
  3. data - is a map of disk configurations
  4. This id will be used as fieldId in MyController, use lowercase, no special characters, _ allowed
  5. disabled - disable this particular disk metrics
  6. name - will be used as field name
  7. path - disk path used to measure the usage details
  8. unit - units guide

Memory Configurations

memory:
  interval: 1m # (1)
  memoryDisabled: false # (2)
  swapMemoryDisabled: false # (3)
  unit: MiB # (4)
  1. interval - metric measurement interval
  2. memoryDisabled - enable/disable memory measurement
  3. swapMemoryDisabled - enable/disable swap measurement
  4. unit - units guide

Process Configurations

process:
  interval: 1m # (1)
  disabled: false # (2)
  data: # (3)
    influxd: # (4)
      disabled: false # (5)
      name: "InfluxDB" # (6)
      unit: MiB # (7)
      filter: # (8)
        cmdline: influxd # (9)
    mycontroller:
      disabled: false
      name: "MyController"
      filter:
        cmdline: /app/mycontroller-all-in-one -config /app/mycontroller.yaml
  1. interval - metric measurement interval
  2. disabled - disable the all the process metrics
  3. data - is a map of process configurations
  4. This id will be used as fieldId in MyController, use lowercase, no special characters, _ allowed
  5. disabled - disable this particular process metrics
  6. name - will be used as field name
  7. unit - units guide
  8. filter - used to get a specific filter
  9. cmdline - one of the key used to filter a process

Supported keys in the filter

  • pid - Process ID
  • cmdline -
  • cwd - client’s Current Working Directory
  • exe -
  • name -
  • nice - nice value of the process
  • ppid - Parent Process ID
  • username -

Measurement Units

Bye default all the values reported in bytes. We have an option to convert the bytes to more readable values.
Update unit on the supported resources.
If you want the values in bytes leave the unit field as blank or remove it completely

Supported units: KiB, MiB, GiB, TiB, PiB, EiB

  • KiB - Kibibytes (10241 bytes)
  • MiB - Mibibytes (10242 bytes)
  • GiB - Gibibytes (10243 bytes)
  • TiB - Tebibytes (10244 bytes)
  • PiB - Pebibytes (10245 bytes)
  • EiB - Exbibytes (10246 bytes)