# Copyright 2019 IOTech Inc. All rights reserved.
name: "Network Power Meter"
manufacturer: "Dent Instruments"
model: "PS3037"
description: "Power Scout Meter"
labels: 
  - "modbus"
  - "powerscout"
deviceResources:
    -
        name: "DemandWindowSize"
        description: "Demand window size in minutes; default is 15 min"
        attributes:
            { primaryTable: "HOLDING_REGISTERS", startingAddress: "4603" }
        properties:
            value:
                { type: "UINT16", readWrite: "R", size: "1", scale: "1", minimum: "0", maximum: "65535", defaultValue: "0"}
            units:
                { type: "String", readWrite: "R", defaultValue: "min"}
    -
        name: "LineFrequency"
        description: "Line frequency setting for metering: 50=50 Hz, 60=60Hz"
        attributes:
            { primaryTable: "HOLDING_REGISTERS", startingAddress: "4609" }
        properties:
            value:
                { type: "UINT16", readWrite: "R", size: "1", scale: "1", minimum: "0", maximum: "65535", defaultValue: "0"}
            units:
                { type: "String", readWrite: "R", defaultValue: "Hz"}
deviceCommands:
    -
        name: "Configuration"
        set:
            - { index: "1", operation: "set", object: "DemandWindowSize", parameter: "DemandWindowSize" }
            - { index: "2", operation: "set", object: "LineFrequency", parameter: "LineFrequency" }
        get:
            - { index: "1", operation: "get", object: "DemandWindowSize", parameter: "DemandWindowSize" }
            - { index: "2", operation: "get", object: "LineFrequency", parameter: "LineFrequency" }
coreCommands:
    -
        name: "Configuration"
        get: 
            path: "/api/v1/device/{deviceId}/Configuration"
            responses: 
                - 
                    code: "200"
                    description: "Get the Configuration"
                    expectedValues: ["DemandWindowSize","LineFrequency"]
                -
                    code: "503"
                    description: "service unavailable"
                    expectedValues: []
        put:
            path: "/api/v1/device/{deviceId}/Configuration"
            parameterNames: ["DemandWindowSize","LineFrequency"]
            responses:
                -
                    code: "204"
                    description: "Set the Configuration"
                    expectedValues: []
                -
                    code: "503"
                    description: "service unavailable"
                    expectedValues: []
