Victron VRM Portal API data integration

‘Instance’ number is the ‘idDataAttribute’ value, if I am not wrong…?

success: true
records:
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 1
    description: gatewayID
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: d
    bitmask: 0
    formattedValue: Venus OS
    dataAttributeEnumValues:
      - nameEnum: 'VGR, VGR2 or VER'
        valueEnum: 0
      - nameEnum: Venus OS
        valueEnum: 1
      - nameEnum: Venus OS
        valueEnum: 2
      - nameEnum: LoRaWAN lopy
        valueEnum: 3
      - nameEnum: PHYSEE NodeMCU
        valueEnum: 4
    id: 1
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 386
    description: Productid
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: mi
    bitmask: 0
    formattedValue: C001
    id: 2
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 387
    description: MachineName
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: mn
    bitmask: 0
    formattedValue: Color Control GX
    id: 3
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 2
    description: Fw Version
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: v
    bitmask: 0
    formattedValue: v2.51
    id: 4
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 3
    description: Fw Build date
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: build
    bitmask: 0
    formattedValue: '20200301214607'
    id: 5
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 453
    description: Capabilities
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: cp
    bitmask: 1
    formattedValue: >-
      MQTT-RPC; MQTT-RPC new firmware update command; VNC-SSH authentication;
      VregLink (1111)
    dataAttributeEnumValues:
      - nameEnum: MQTT-RPC
        valueEnum: 1
      - nameEnum: MQTT-RPC new firmware update command
        valueEnum: 2
      - nameEnum: VNC-SSH authentication
        valueEnum: 4
      - nameEnum: VregLink
        valueEnum: 8
    id: 6
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 237
    description: Boot type
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: w
    bitmask: 0
    formattedValue: Cold boot or reboot
    dataAttributeEnumValues:
      - nameEnum: 'Tmp file already read, vrmlogger restarted!?'
        valueEnum: '-3'
      - nameEnum: Reading tmp file failed
        valueEnum: '-2'
      - nameEnum: Reading watchdog register failed
        valueEnum: '-1'
      - nameEnum: 'Old kernel, or hw without boottype support, etc.'
        valueEnum: 0
      - nameEnum: Cold boot or reboot
        valueEnum: 1
      - nameEnum: Unreproducable reset on CCGX
        valueEnum: 2
      - nameEnum: Reset button
        valueEnum: 3
      - nameEnum: Cold boot
        valueEnum: 4
      - nameEnum: Reboot command
        valueEnum: 5
      - nameEnum: Watchdog reboot
        valueEnum: 17
      - nameEnum: Max load avg exceeded (systems <= v2.06)
        valueEnum: 29997
      - nameEnum: Watchdog-ENOMEM
        valueEnum: 30012
      - nameEnum: Watchdog-EMAXLOAD (load average too high)
        valueEnum: 30253
    id: 7
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 154
    description: Remote support
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/System/RemoteSupport
    code: rss
    bitmask: 0
    formattedValue: Disabled
    dataAttributeEnumValues:
      - nameEnum: Disabled
        valueEnum: 0
      - nameEnum: Enabled
        valueEnum: 1
    id: 8
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 152
    description: Remote support port
    formatWithUnit: Port %.0F
    dbusServiceType: settings
    dbusPath: /Settings/System/RemoteSupportPort
    code: rs
    bitmask: 0
    formattedValue: Port 27089
    id: 9
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 148
    description: Remote ip address
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: ipr
    bitmask: 0
    formattedValue: 46.16.221.191
    id: 10
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 149
    description: Local ip address
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: ip
    bitmask: 0
    formattedValue: 192.168.178.37
    id: 11
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 577
    description: D-Bus Round-trip time
    formatWithUnit: '%.0F ms'
    dbusServiceType: null
    dbusPath: null
    code: rtt
    bitmask: 0
    formattedValue: 0 ms
    id: 12
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 150
    description: Auto update
    formatWithUnit: '%d'
    dbusServiceType: settings
    dbusPath: /Settings/System/AutoUpdate
    code: au
    bitmask: 0
    formattedValue: 'On'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
      - nameEnum: 'On'
        valueEnum: 1
      - nameEnum: Check
        valueEnum: 2
    id: 13
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 151
    description: Update to
    formatWithUnit: '%d'
    dbusServiceType: settings
    dbusPath: /Settings/System/ReleaseType
    code: ut
    bitmask: 0
    formattedValue: Official release
    dataAttributeEnumValues:
      - nameEnum: Official release
        valueEnum: 0
      - nameEnum: Release-candidate
        valueEnum: 1
      - nameEnum: Testing
        valueEnum: 2
      - nameEnum: Develop
        valueEnum: 3
    id: 14
  - idSite: 51473
    timestamp: 1611061550
    Device: Gateway
    instance: 0
    idDataAttribute: 558
    description: Update status
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: us
    bitmask: 0
    formattedValue: Idle
    dataAttributeEnumValues:
      - nameEnum: No update running
        valueEnum: 0
      - nameEnum: Update is running
        valueEnum: 1
    id: 15
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 278
    description: Free space rootfs
    formatWithUnit: '%d B'
    dbusServiceType: null
    dbusPath: null
    code: fr
    bitmask: 0
    formattedValue: 92721200 B
    id: 16
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 279
    description: Free space data
    formatWithUnit: '%d B'
    dbusServiceType: null
    dbusPath: null
    code: fd
    bitmask: 0
    formattedValue: 27238400 B
    id: 17
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 383
    description: load avg 1m
    formatWithUnit: '%.2f'
    dbusServiceType: null
    dbusPath: null
    code: la1
    bitmask: 0
    formattedValue: '5.34'
    id: 18
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 384
    description: load avg 5m
    formatWithUnit: '%.2f'
    dbusServiceType: null
    dbusPath: null
    code: la2
    bitmask: 0
    formattedValue: '2.08'
    id: 19
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 385
    description: load avg 10m
    formatWithUnit: '%.2f'
    dbusServiceType: null
    dbusPath: null
    code: la3
    bitmask: 0
    formattedValue: '0.76'
    id: 20
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 256
    description: VRM Log mode
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Vrmlogger/Logmode
    code: vl
    bitmask: 0
    formattedValue: Enabled
    dataAttributeEnumValues:
      - nameEnum: Disabled
        valueEnum: 0
      - nameEnum: Enabled
        valueEnum: 1
      - nameEnum: MicroSD or USB storage
        valueEnum: 2
    id: 21
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 216
    description: VRM Log time offset
    formatWithUnit: '%s s'
    dbusServiceType: null
    dbusPath: null
    code: TO
    bitmask: 0
    formattedValue: 2 s
    id: 22
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 255
    description: VRM Log interval
    formatWithUnit: '%d s'
    dbusServiceType: settings
    dbusPath: /Settings/Vrmlogger/LogInterval
    code: sl
    bitmask: 0
    formattedValue: 300 s
    id: 23
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 481
    description: VRM Log ram disk mode
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: rdm
    bitmask: 0
    formattedValue: normal
    dataAttributeEnumValues:
      - nameEnum: Normal
        valueEnum: 0
      - nameEnum: Ram disk
        valueEnum: 1
    id: 24
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 257
    description: User access level
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/System/AccessLevel
    code: al
    bitmask: 0
    formattedValue: User and installer
    dataAttributeEnumValues:
      - nameEnum: User
        valueEnum: 0
      - nameEnum: User and installer
        valueEnum: 1
      - nameEnum: Superuser
        valueEnum: 2
      - nameEnum: Service
        valueEnum: 3
    id: 25
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 258
    description: Modbus TCP service
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Services/Modbus
    code: mb
    bitmask: 0
    formattedValue: 'On'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
      - nameEnum: 'On'
        valueEnum: 1
    id: 26
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 572
    description: MQTT Local (https)
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Services/MqttLocal
    code: mql
    bitmask: 0
    formattedValue: 'Off'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
      - nameEnum: 'On'
        valueEnum: 1
    id: 27
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 573
    description: MQTT Local (http)
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Services/MqttLocalInsecure
    code: mqli
    bitmask: 0
    formattedValue: 'Off'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
      - nameEnum: 'On'
        valueEnum: 1
    id: 28
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 250
    description: Two way communication
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Services/MqttVrm
    code: tw
    bitmask: 0
    formattedValue: 'On'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
      - nameEnum: 'On'
        valueEnum: 1
    id: 29
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 262
    description: Demo modus on/off
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/Gui/DemoMode
    code: dm
    bitmask: 0
    formattedValue: 'Off'
    dataAttributeEnumValues:
      - nameEnum: 'Off'
        valueEnum: 0
    id: 30
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 266
    description: Time zone
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/System/TimeZone
    code: tz
    bitmask: 0
    formattedValue: Europe/Paris
    id: 31
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 454
    description: DVCC
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: bol
    bitmask: 0
    formattedValue: 1
    dataAttributeEnumValues: []
    id: 32
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 332
    description: ESS battery life state
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: H4bs
    bitmask: 0
    formattedValue: Restarting
    dataAttributeEnumValues:
      - nameEnum: External control or BL disabled
        valueEnum: 0
      - nameEnum: Restarting
        valueEnum: 1
      - nameEnum: Self-consumption
        valueEnum: 2
      - nameEnum: Self-consumption
        valueEnum: 3
      - nameEnum: Self-consumption
        valueEnum: 4
      - nameEnum: Discharged
        valueEnum: 5
      - nameEnum: Slow charge
        valueEnum: 6
      - nameEnum: Sustain
        valueEnum: 7
      - nameEnum: Auto-recharge
        valueEnum: 8
      - nameEnum: Keep batteries charged
        valueEnum: 9
      - nameEnum: BL Disabled
        valueEnum: 10
      - nameEnum: BL Disabled (Low SoC)
        valueEnum: 11
      - nameEnum: BL Disabled (Auto-recharge)
        valueEnum: 12
    id: 33
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 333
    description: ESS battery life SOC limit
    formatWithUnit: '%.1F %%'
    dbusServiceType: null
    dbusPath: null
    code: H4as
    bitmask: 0
    formattedValue: 10.0 %
    id: 34
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 334
    description: ESS Minimum SOC (unless grid fails)
    formatWithUnit: '%.1F %%'
    dbusServiceType: null
    dbusPath: null
    code: H4ms
    bitmask: 0
    formattedValue: 10.0 %
    id: 35
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 469
    description: ESS Scheduled Charging
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: sca
    bitmask: 0
    formattedValue: Not active
    dataAttributeEnumValues:
      - nameEnum: Not active
        valueEnum: 0
      - nameEnum: Active
        valueEnum: 1
    id: 36
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 269
    description: VNC Local
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/System/VncLocal
    code: Vl
    bitmask: 0
    formattedValue: Disabled
    dataAttributeEnumValues:
      - nameEnum: Disabled
        valueEnum: 0
      - nameEnum: Enabled
        valueEnum: 1
    id: 37
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 270
    description: VNC Internet
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/System/VncInternet
    code: Vi
    bitmask: 0
    formattedValue: Enabled
    dataAttributeEnumValues:
      - nameEnum: Disabled
        valueEnum: 0
      - nameEnum: Enabled
        valueEnum: 1
    id: 38
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 261
    description: Battery monitor setting
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/SystemSetup/BatteryService
    code: sb
    bitmask: 0
    formattedValue: com.victronenergy.battery/512
    id: 39
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 263
    description: Active battery service
    formatWithUnit: '%s'
    dbusServiceType: system
    dbusPath: /ActiveBatteryService
    code: abs
    bitmask: 0
    formattedValue: com.victronenergy.battery/512
    id: 40
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 253
    description: Has DC system
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/SystemSetup/HasDcSystem
    code: shd
    bitmask: 0
    formattedValue: 'No'
    dataAttributeEnumValues:
      - nameEnum: 'No'
        valueEnum: 0
      - nameEnum: 'Yes'
        valueEnum: 1
    id: 41
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 251
    description: 'AC Input 1 '
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/SystemSetup/AcInput1
    code: si1
    bitmask: 0
    formattedValue: Grid
    dataAttributeEnumValues:
      - nameEnum: Not available
        valueEnum: 0
      - nameEnum: Grid
        valueEnum: 1
      - nameEnum: Generator
        valueEnum: 2
      - nameEnum: Shore power
        valueEnum: 3
    id: 42
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 252
    description: AC Input 2
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/SystemSetup/AcInput2
    code: si2
    bitmask: 0
    formattedValue: Not available
    dataAttributeEnumValues:
      - nameEnum: Not available
        valueEnum: 0
      - nameEnum: Grid
        valueEnum: 1
      - nameEnum: Generator
        valueEnum: 2
      - nameEnum: Shore power
        valueEnum: 3
    id: 43
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 560
    description: Has AC out system
    formatWithUnit: '%s'
    dbusServiceType: settings
    dbusPath: /Settings/SystemSetup/HasAcOutSystem
    code: shao
    bitmask: 0
    formattedValue: 'Yes'
    dataAttributeEnumValues:
      - nameEnum: 'No'
        valueEnum: 0
      - nameEnum: 'Yes'
        valueEnum: 1
    id: 44
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 470
    description: Hung processes
    formatWithUnit: '%d'
    dbusServiceType: null
    dbusPath: null
    code: hp
    bitmask: 0
    formattedValue: 0
    dataAttributeEnumValues: []
    id: 45
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 479
    description: Zombie processes
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: zp
    bitmask: 0
    formattedValue: 0
    dataAttributeEnumValues: []
    id: 46
  - idSite: 51473
    timestamp: 1611061539
    Device: Gateway
    instance: 0
    idDataAttribute: 480
    description: Data partition status
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: dps
    bitmask: 0
    formattedValue: fine
    dataAttributeEnumValues:
      - nameEnum: Fine
        valueEnum: 0
      - nameEnum: Failed-once
        valueEnum: 1
      - nameEnum: Recovered
        valueEnum: 2
      - nameEnum: Failed
        valueEnum: 3
      - nameEnum: Failed-to-mount
        valueEnum: 4
    id: 47
  - idSite: 51473
    timestamp: 1611061558
    Device: Gateway
    instance: 0
    idDataAttribute: 306
    description: Relay 1 state
    formatWithUnit: '%s'
    dbusServiceType: system
    dbusPath: /Relay/0/State
    code: cRelay
    bitmask: 0
    formattedValue: Closed
    dataAttributeEnumValues:
      - nameEnum: Open
        valueEnum: 0
      - nameEnum: Closed
        valueEnum: 1
    id: 48
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 519
    description: Phase rotation
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Alarms/PhaseRotation
    code: ePR
    bitmask: 0
    formattedValue: Ok
    dataAttributeEnumValues:
      - nameEnum: Ok
        valueEnum: 0
      - nameEnum: Warning
        valueEnum: 1
    id: 49
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 581
    description: Waiting to perform relay test
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Devices/0/ExtendStatus/WaitingForRelayTest
    code: rt
    bitmask: 0
    formattedValue: OK
    dataAttributeEnumValues:
      - nameEnum: OK
        valueEnum: 0
      - nameEnum: Waiting to perform relay test
        valueEnum: 1
    id: 50
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 6
    description: mk2 version
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Interfaces/Mk2/Version
    code: vmk2
    bitmask: 0
    formattedValue: '1170207'
    id: 51
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 356
    description: Mk2 product name
    formatWithUnit: '%s'
    dbusServiceType: null
    dbusPath: null
    code: pmk2
    bitmask: 0
    formattedValue: MK3
    id: 52
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 264
    description: VE.Bus firmware version
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /FirmwareVersion
    code: vvv
    bitmask: 0
    formattedValue: '456'
    id: 53
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 265
    description: VE.Bus product id
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /ProductId
    code: vvp
    bitmask: 0
    formattedValue: '2629'
    id: 54
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 272
    description: VE.Bus ShortIDs
    formatWithUnit: '%d'
    dbusServiceType: vebus
    dbusPath: /ShortIds
    code: vid
    bitmask: 0
    formattedValue: Single unit
    dataAttributeEnumValues:
      - nameEnum: Single unit
        valueEnum: 1
      - nameEnum: Two units configured as split-phase
        valueEnum: 3
      - nameEnum: 'Three phase system, one unit per phase'
        valueEnum: 7
      - nameEnum: Two units configured in parallel
        valueEnum: 9
      - nameEnum: 'Three phase system, two units per phase'
        valueEnum: 63
      - nameEnum: Three units configured in parallel
        valueEnum: 73
      - nameEnum: 'Three phase system, three units per phase'
        valueEnum: 511
      - nameEnum: 'Three phase system, four units per phase'
        valueEnum: 4095
      - nameEnum: 'Three phase system, five units per phase'
        valueEnum: 32767
    id: 55
  - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 316
    description: VE.Bus connection
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Mgmt/Connection
    code: vmc
    bitmask: 0
    formattedValue: VE.Bus
    id: 56

I had to truncate it, because of limited number of characters in posting here.
Cheers.

And a set of one and two digit values:

- idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 316
    description: VE.Bus connection
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Mgmt/Connection
    code: vmc
    bitmask: 0
    formattedValue: VE.Bus
    id: 56
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 8
    description: Input voltage phase 1
    formatWithUnit: '%.1F VAC'
    dbusServiceType: vebus
    dbusPath: /Ac/ActiveIn/L1/V
    code: IV1
    bitmask: 0
    formattedValue: 233.9 VAC
    id: 57
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 11
    description: Input current phase 1
    formatWithUnit: '%.1F A'
    dbusServiceType: vebus
    dbusPath: /Ac/ActiveIn/L1/I
    code: II1
    bitmask: 0
    formattedValue: 0.5 A
    id: 58
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 14
    description: Input frequency 1
    formatWithUnit: '%.2F Hz'
    dbusServiceType: vebus
    dbusPath: /Ac/ActiveIn/L1/F
    code: IF1
    bitmask: 0
    formattedValue: 50.10 Hz
    id: 59
  - idSite: 51473
    timestamp: 1611061558
    Device: VE.Bus System
    instance: 0
    idDataAttribute: 17
    description: Input power 1
    formatWithUnit: '%.0F W'
    dbusServiceType: vebus
    dbusPath: /Ac/ActiveIn/L1/P
    code: IP1
    bitmask: 0
    formattedValue: 13 W
    id: 60

Cheers.

I get it. No, ‘Instance’ number is NOT the ‘idDataAttribute’ value, it is the ‘instance’ which is 0 for Gateway and 3-digit code for the actual devices. But if you can get the data from the Gateway then use 0 for instance all the time.

 - idSite: 51473
    timestamp: 1611061539
    Device: VE.Bus System
    instance: 0 # my comment: this IS the instance
    idDataAttribute: 316 # my comment: this IS NOT the instance
    description: VE.Bus connection
    formatWithUnit: '%s'
    dbusServiceType: vebus
    dbusPath: /Mgmt/Connection
    code: vmc
    bitmask: 0
    formattedValue: VE.Bus
    id: 56
1 Like

What happens is that installations usually have a number of devices like MPPT charger, battery monitor, inverter, etc. Each of these devices gets a VRM identifier which is typically 3-digit. And the control device, typically a CCGX also gets its number which is 0 (as in zero).
The CCGX or Gateway aggregates the data from the devices and may add its own system data so if you can find what you want there, got for it.

1 Like

YESSSSS!!!
You are right. I didn’t realise that. Was always looking for the 3 digits (and less), but could not believe the 0 (zero) was the correct one.

vrm_ha

You are my hero! Thank you so much!
Would like to offer you a beer, if possible!

Happy it works. As for the beer, thanks anyhow, nice gesture. Cheers :beers:

2 Likes

Hi :slight_smile:

I am totally new to HA (and MQTT) and i am trying to do what you did . Get HA to connect HAs mqtt broker connect to my Victron GX mqtt server.

I am able to connect to victron mqtt with mqtt fx and see whats getting published.

The problem i have is to get ha to connect to the victron mqtt server. The mosquita.config didnt exist on my HA installation, so i created it in etc since the HA mosquitto log said it was listening on that file. (And in share/mosquitto/mosquitto.conf to be sure)

Nothing seems to be happening. I can see any new devices getting found on HA, so i am thinking that it isnt connecting to Victron,. _Is there anyway of telling if it is connection. the HA broker log doesnt say anything.

In your post, you mention that you had to set up “Customize = true” but you didnt say anything where you did that. Where did you put this ?

Thanks for all the help you can provide :slight_smile:

Hi. Can you develop a bit further your installation?

  1. Are you running HassOS or are you running another installation? In other words can you install add-ons?
  2. How many CCGX/VenusOS controllers do you have? 1 or many?

If you can see data being published in MQTT vx then it’s already a good start.
If you installed the mqqt add-on and you configured it to your HA IP address then its also a good start.
Now go in Configuration/Integrations/MQTT and copy a topic from MQTT vx and paste it in the “Listen to a topic” field, hit “Start Listening” and see if you get something. If you do, you’re all set.

Now you need to configure the sensors using the topic you want to listen to such as the example below:

- platform: mqtt
  name: casa batterie soc
  state_topic: 'N/b827ebbbc6b6/battery/512/Soc'
  value_template: "{{ value_json.value }}"
- platform: template
  sensors:
    casa_bat_soc:
      unit_of_measurement: '%'
      value_template: "{{ states.sensor.casa_batterie_soc.state | float | round(2) }}"

Restart and you will now have 2 sensors, "sensor.casa_batterie_soc"which is the raw one, and “sensor.casa_bat_soc” which has 2 digits after the coma and % as unit of measurement.

You need to define each and every sensor you want to use in your front-end or automations. There is no automatics discovery (as far as I know).

2 Likes

Thanks for trying to help :slight_smile:

I am running HassOS on a Rpi4 and have one Victron Cerbo GX device

I can see data on my victron mqtt server on the CERBO, but i can NOT see any victron dato on my HA MQTT server when using MQTT explorer. I dont think the bridge has been set up.
Should i see anything in the logs on HA if the bridge is set up?

I have created a mosquitto.conf under /etc/mosqitto.conf (This get deleted when i reboot) and also tried /share/mosquitto/mosquitto.conf like you said in your post,.

You should point your MQTT explorer to your Cerbo and not your HA.
Find out your Cerbo IP address, in MQTT explorer create a connection mqtt:// port 1883 and hit connect.
You should see topics coming in.
As the Cerbo requires a keep-alive signal to send data, if you don’t see any installation data you need to publish the following:

R/b827ebbbxxxx/system/0/Serial

…where b827ebbbxxxx is the MAC address of your Cerbo. You will see it in the data coming in MQTT explorer. Once you publish this you’ll then see all the installation data coming in and you can browse it.
When you get to a data you want, there is a copy button in MQTT explorer which you can use and paste it in the HA sensor file.

You might want to get through this first step before attempting to get anything in HA.

1 Like

I see all the data on Victron MQTT server with MQTT browser, so there is no problem there. I though maybe i also would see the same on HA’s MQTT server when they were bridged. Never mind that :slight_smile:
MQTT data on the victron server

This is my mosquitto.conf file

connection Victron2
address 192.168.8.144:1883
topic N/c0847dc9a396/# in
topic R/c0847dc9a396/# out

This is my Mosquitto configuration file

logins: []
anonymous: false
customize:
  active: true
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

This my keep alive automation

- id: '1604576260450'
  alias: MQTT KeepAlive
  description: ''
  trigger:
  - platform: time_pattern
    seconds: '30'
  condition: []
  action:
  - data:
      topic: R/c0847dc9a396/system/0/Serial
    service: mqtt.publish
  mode: single

When going to "Configuration -> inegration - MQTT configuration and try to subscribe to something i get nothing. Even if i try to subscribe to N/c0847dc9a396/#


When trying to add a sensor N/c0847dc9a396/battery/278/Dc/0/Voltage i get nothing :frowning:

I dont think the servers are bridged. I dont think MQTT reads from the mosquitto.conf files.

ill think ill go with another route to integrate Victron into my HA :blush:

Here is the mosquitto log

[18:52:18] INFO: Setup mosquitto configuration
[18:52:18] WARNING: SSL not enabled - No valid certs found!
[18:52:18] INFO: No local user available
[18:52:18] INFO: Initialize Hass.io Add-on services
[18:52:18] INFO: Initialize Home Assistant discovery
[18:52:18] INFO: Start Mosquitto daemon
1611597138: mosquitto version 1.6.3 starting
1611597138: Config loaded from /etc/mosquitto.conf.
1611597138: Loading plugin: /usr/share/mosquitto/auth-plug.so
1611597138:  ├── Username/password checking enabled.
1611597138:  ├── TLS-PSK checking enabled.
1611597138:  └── Extended authentication not enabled.
1611597138: |-- *** auth-plug: startup
1611597138: Opening ipv4 listen socket on port 1883.
1611597138: Opening ipv6 listen socket on port 1883.
1611597138: Opening websockets listen socket on port 1884.
1611597138: Warning: Mosquitto should not be run as root/administrator.
1611597140: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1611597140: New client connected from 172.30.32.1 as 5jV4RflBjf4tVwHOjAWcjP (p2, c1, k60, u'homeassistant').
1611598690: Socket error on client 5jV4RflBjf4tVwHOjAWcjP, disconnecting.
1611598708: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1611598708: New client connected from 172.30.32.1 as 0ElTbYJzK9FKnN8OW61uUY (p2, c1, k60, u'homeassistant').
1611598940: Saving in-memory database to /data/mosquitto.db.
1611600741: Saving in-memory database to /data/mosquitto.db.
1611602541: Saving in-memory database to /data/mosquitto.db.
1611604343: Saving in-memory database to /data/mosquitto.db.
1611606144: Saving in-memory database to /data/mosquitto.db.
1611607945: Saving in-memory database to /data/mosquitto.db.

I have it working since December, but today VRM portal failed to connect to my device, so, ills love that, but I want to extract the “timestamp” of one of the sensors eg:

- idSite: 66xxx
  timestamp: 1615080595
  Device: System overview
  instance: 0
  idDataAttribute: 140
  description: DC System
  formatWithUnit: '%.0F W'
  dbusServiceType: system
  dbusPath: /Dc/System/Power
  code: dc
  bitmask: 0
  formattedValue: 0 W
  id: 143

as a single sensor, to know when I did receive the last info.

Is it possible Via Template? how?

I am having a big issue:
Same data appears with ID 50 and ID 49 depending o what ever Viltron VRM decides, is there a better way to extract the values than that template, is there any template that can extract values based on “description” and not “ID” ?

I understand you’re using the REST sensor and template extraction method. If that is the case, my experience was also that from time to time Victron would change the CCGX software (good thing, you should keep the software on your devices up to date) but with unintended consequences because something would change that would affect the template extraction.

So I moved to the MQTT solution (explained about in this thread) which is not only a local-only solution (keeps working even if you’ve lost internet connection) but is much more robust. Give it a try and if you have questions I’ll try to help.

1 Like

My advise for simplicity would be to add node red onto your home assistant instance as an add on.

You can then use http request to the Victron API to obtain the VRM data.

Then just use the entity nodes (home assistant node for node red) to input the data into home assistant as their specific entities.

Out of interest, because I am just starting to setup MQTT to replace modbus, why have 2 sensors like this instead of just the one already filtered?

Hi Michael.
I don’t quite understand your question. Why have MQTT and REST sensors? or why not read directly the modbus source data?
If the first, I’m not using REST anymore and moved on to MQTT which is working fine.
If I got it all wrong thanks for explaining your question and/or comment.
Cheers.

1 Like
- platform: mqtt
  name: casa batterie soc
  state_topic: 'N/b827ebbbc6b6/battery/512/Soc'
  value_template: "{{ value_json.value }}"
- platform: template
  sensors:
    casa_bat_soc:
      unit_of_measurement: '%'
      value_template: "{{ states.sensor.casa_batterie_soc.state | float | round(2) }}"

Blockquote
Restart and you will now have 2 sensors, "sensor.casa_batterie_soc"which is the raw one, and “sensor.casa_bat_soc” which has 2 digits after the coma and % as unit of measurement.

Sorry Luis, my previous post was not very clear. I was specifically talking about the setup of your mqtt sensor only, and the way you have them as two. In comparison to applying the float | round(2) ‘filter’ and unit of measure attribute to the original.

Thanks! For some reason I had tried it when I first configured these sensors but must have made a yaml error and got configuration check errors so went the dumb way and never bothered to go back and understand why. Too many things on the to-do list :slight_smile:
Thanks for raising this point, now I have a much cleaner configuration.

I see from your profile you’re also running an off-grid house, “down-under”. How’s it going?
Mine is nearing completion as it was a new build and we did get some delays. The PV system for the water well which takes care of the plants and providing water to the house and pool is running now for 5 years. During construction I used it to power small stuff in the house as its energy capacity is limited. The house system (14kW nominal PV capacity) is now running for more than one year. Now that I’m moving into the house I’m doubling the battery capacity (lithium) from 19 to 38kWh to limit the back-up generator running time. The one thing that consumes the most is the swimming pool pump but luckily it needs to work longer during the summer when we got plenty of daylight time.
Currently I use the PV data to limit pool pump time when not enough energy available as not living in the house yet consumption is very predictable. I’ve recently signed on to forecast.solar as well as Fronius premium to test next-day production forecast. Until now I notice Fronius is more on-target but I’ll look at it in the long run. I expect it to be helpful to add some intelligence to the logic starting the back-up generator to avoid early-day starts when within a couple of hours there’s lots of production capacity.
Thanks again and have a good day.

1 Like

I am having issues after some times the templating stops working and needs to be redone, probably due to updates.
I monitor a remote Victron setup, not local, so… Do I have any other option than keep using rest and templating?