Configure a Renogy Power Sensor

Configure a renogy sensor to integrate a Renogy charge controller into your machine:

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Select the power_sensor type, then select the renogy model. Enter a name or use the suggested name for your sensor and click Create.

Renogy power sensor configuration tab

Edit the attributes as applicable to your power sensor, according to the table below.

{
  "components": [
    {
      "name": "ren1",
      "model": "renogy",
      "type": "power_sensor",
      "namespace": "rdk",
      "attributes": {
        "serial_path": "<string>",
        "serial_baud_rate": <int>,
        "modbus_id": <int>
      },
      "depends_on": []
    }
  ]
}
{
  "components": [
    {
      "name": "your-renogy-sensor",
      "model": "renogy",
      "type": "power_sensor",
      "namespace": "rdk",
      "attributes": {
        "serial_path": "/dev/serial/by-path/usb-0:1.1:1.0",
        "serial_baud_rate": 9600,
        "modbus_id": 1
      },
      "depends_on": []
    }
  ]
}

The "serial_path" filepath used in this example is specific to serial devices connected to Linux systems. The "serial_path" filepath on a macOS system might resemble "/dev/ttyUSB0" or "/dev/ttyS0".

The following attributes are available for renogy sensors:

AttributeTypeInclusionDescription
serial_pathstringOptionalThe full filesystem path to the serial device, starting with /dev/. To find your serial device path, first connect the serial device to your machine, then:
  • On Linux, run ls /dev/serial/by-path/* to show connected serial devices, or look for your device in the output of sudo dmesg | grep tty. Example: "/dev/serial/by-path/usb-0:1.1:1.0".
  • On macOS, run ls /dev/tty* | grep -i usb to show connected USB serial devices, ls /dev/tty* to browse all devices, or look for your device in the output of sudo dmesg | grep tty. Example: "/dev/ttyS0".

Default: /dev/serial0
serial_baud_rateintegerOptionalThe baud rate to use for serial communications.
Default: 9600
modbus_idintegerOptionalController MODBUS address.
Default: 1

Test the power sensor

After you configure your power sensor, navigate to the Control tab and select the dropdown panel dedicated to your power sensor. The panel contains readings for your voltage, current, and power.

An instance of the power sensor component in the control tab with voltage, current, and power readings



Have questions, or want to meet other people working on robots? Join our Community Discord.

If you notice any issues with the documentation, feel free to file an issue or edit this file.